mIRC Homepage
Dear Khaled,

Would you please consider adding an optional 'channels' parameter to the On Quit event? The event would fire multiple times, once for each matching channel the user is in, when a user QUITs. This way novice and expert scripters alike don't have to fuss with $comchan() loops all the time.

On *:QUIT:[#chan1,#chan2,#chan*:] { echo $chan * $nick quit. }

I understand that QUIT events, at the IRCd level, don't have a channel parameter. But, mIRC can certainly derive context based on the channels a user is in, and produce an expected behavior similar to JOIN and PART events. It would make scripting a lot easier and cleaner for everyone.


On @banned:JOIN:#mIRC: ban $chan $nick 2
On @banned:PART:#mIRC: ban $chan $nick 2
On @banned:QUIT:#mIRC: ban $chan $nick 2


or

On @banned:QUIT:*: ban $chan $nick 2

Instead of:

On *:QUIT: {
  var %i = 1
  while ($comchan($nick,%i)) {
    if ($me isop $v1) ban $v1 $nick 2
    inc %i
} }


or

On *:QUIT: {
  if ($nick ison #mIRC) && ($me isop #v2) ban $v2 $nick 2
  if ($nick ison #IRCHelp) && ($me isop #v2) ban $v2 $nick 2
  if ($nick ison #Beginners) && ($me isop #v2) ban $v2 $nick 2
}
The idea is good, but changing the syntax of the QUIT event will affect many existing scripts. I'll suggest for those who have *:QUIT: event to work normally as is till now and for those who have *:QUIT:#: to act using this idea.
That's what I said. "Optional parameter." That is, the old version continues to work without any channel(s) specified, and when channels are specified then it works differently.

The difference being that it will be multi-fired in a channel context; $chan is populated by each channel name, behaving the same as someone parting many channels at once. The same QUIT from the server would fire On Quit = $comchan($nick,0)-times.
© mIRC Discussion Forums