Difference between revisions of "On quit"

From Scriptwiki
Jump to: navigation, search
m
m (fixed $conchan($nick,1))
 
Line 18: Line 18:
 
   [[while]] (%i <= $comchan($nick,0)) {
 
   [[while]] (%i <= $comchan($nick,0)) {
 
     ; echo the quit in this channel with timestamp.
 
     ; echo the quit in this channel with timestamp.
     [[echo]] -t $comchan($nick,1) $nick just quitted. Reason: $1- $+ .
+
     [[echo]] -t $comchan($nick,%i) $nick just quitted. Reason: $1- $+ .
 
     ; increase the looping-variable.
 
     ; increase the looping-variable.
 
     [[inc]] %i  
 
     [[inc]] %i  

Latest revision as of 10:31, 4 July 2007

The on QUIT event triggers when a user quits IRC while on the same channel as you.

on <level>:QUIT:<commands>

Read access levels to get more info about the <level> field.

The $1- parameters hold the user's quit message.

This $nick parameter holds the user's nickname.

Note that this event has no channel parameter ($chan will return $null), as you quit global, not just one channel.

Example

The following example will show howto echo a quit of a user in every common channel:

ON *:QUIT: {
 var %i = 1
 ; loop through all channels both you and the one who quitted were in.
 ; $comchan() returns these common channels, with N = 0, it returns the total number of common channels.
 while (%i <= $comchan($nick,0)) {
   ; echo the quit in this channel with timestamp.
   echo -t $comchan($nick,%i) $nick just quitted. Reason: $1- $+ .
   ; increase the looping-variable.
   inc %i 
 }
}

See Also