Originally Posted By: westor
In this case use : ON *:DISCONNECT: { } event, the on part event does not trigger while u disconnect from an server and i am sure that ON EXIT is not useful here.

Be careful that in the ON *:DISCONNECT: { } event you must add an loop to track down the channels that you are in using the $chan identifier.


  var %t = $chan(0)
  var %i = 1
  while (%i <= %t) {
    var %c = $chan(%i)
    var %tot = $addtok(%tot,%c,44)
    inc %i
  echo -a Disconnected from $server IRC Server, you were into the: $iif(%tot,$v1,None) channel(s).

/help on disconnect
/help $chan (it has 2, read both to understand)

That is great but I want a catchall. Correct me if I am wrong but that doesn't fire if I just close a chat window for a specific channel.