mIRC Homepage
Hi. How do you retrieve the channel name which you have received a notice in? For example, if myself and someone else are in channel #test, and they send me a /notice, the notice msg will go to my #test window whether I'm currently in that window or not (which is how I like it). If I have an `on *:NOTICE:*:?:{ .. }` function, how do I find out what channel that msg was received in? I'd expect $chan to be "#test" but $chan is empty.

Thanks
mIRC's behavior is such that private (direct to user) notices will be displayed in all channels in which you and the sender share in common.

So, to discover which channel windows those are, you would iterate through $comchan($nick,%i)

In addition, mIRC options allows you to show notices in the Active Window as well, so that window would be identified by $active

If $chan is populated in the On Notice event, then the target was a channel and not just to you privately. In which case, the notice would only appear in that channel window.

As of this time, there is no NOTICE command that allows you to notice a single person with a specific channel-context. On some IRCDs (networks), there exists a WHISPER command that does this.

Another thing that NOTICE allows is to target only a channel's ops, voices, or halfops by prefix, ie, "NOTICE @#mIRC That guy wants to get banned real bad." and the client command /onotice is an alias for this.
$target will be populated with "@#mIRC" on networks where this is supported.
Thanks for the explanation Raccoon, it makes complete sense now. I was able to take advantage of the $comchan function you mentioned and do what I was looking for.

Cheers!
© mIRC Discussion Forums