mIRC Home    About    Download    Register    News    Help

Print Thread
K
KewlioMZX
KewlioMZX
K
I have a custom On Quit script, it goes kinda like this:

Code:
 on *:quit:{
  if ($nick == KewlioMZX) && (ping isin $1-) {
    /echo 14 -at # 4BROKEN NICK PING OUT: Reclaiming your nick...
    /nick KewlioMZX
  }
  else {
    if (ping isin $1-) /echo 14 -at 4PING OUT: $nick
...
...
    else /echo 14 -at # 4EXIT IRC: " $+ $1- $+ 4" <- $nick
  }
}


What I want to do is put those Quit messages into the windows in which the quitting user was participating. Right now, it only shows within the active window.

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
Since quit's don't have a channel property, use $comchan using the nick, and N representing the Nth common channel.

i.e.
Code:
on *:QUIT: {
  var %c = 1
  while ($comchan($nick, %c)) {
    var %chan = $ifmatch
    /echo %chan This is a quit msg ( $+ $nick $+ ) $1-
  }
}

Then use %chan, not $chan >:P

K
KewlioMZX
KewlioMZX
K
Well, now I have this:

Code:
  if (...)
  else {
    var %c = 1
    while ($comchan($nick, %c)) {
      var %chan = $ifmatch
      if (ping isin $1-) /echo 14 -t %chan 4PING OUT: $nick
...
...
      else /echo 14 -t %chan 4EXIT IRC: " $+ $1- $+ 4" <- $nick
    }
  }


...and the script wigs out on me. It's stuck in an endless loop.

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
I'm sorry, i forgot one thing. Just before the closing } of the while loop, add an /inc %c

ex:

while ($comchan($ncik, %c)) {
. blah .
/inc %c
}

K
KewlioMZX
KewlioMZX
K
Well, I got to "accidentally" test it as a NetSplit just so conveniently happened right after I finished. Seems to work just fine. Thanks!


Link Copied to Clipboard