On unban

From Scriptwiki
Revision as of 09:50, 2 July 2007 by Cail (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The on UNBAN event trigger when a user on a channel is unbanned.

on <level>:UNBAN:<#[,#]>:<commands>

There are several special identifier connected with this event:

  • $banmask refers to the banmask used to unban the user.
  • $bnick refers to the unbanned users nickname, however this would actually only be filled if the banmask itself includes a nickname. If the banmask does not include a nickname, $bnick is $null.

Note that $banmask is usually a wildcard string which means that it will be matching wildcard strings in your remote users section.

Example

on *:UNBAN:#: { echo -a $nick just unbanned: $banmask }

This simple example would just echo who unbanned a mask to the active window.

on *:UNBAN:#: {
 echo -a $nick just unbanned $banmask
 echo -a Matched nicks:
 var %i = 1
 ; lets loop through all affected nicks ($ialchan($banmask,$chan,0) returns the total number)
 while (%i <= $ialchan($banmask,$chan,0)) {
   ; actually echo it ($ialchan($banmask,$chan,%i) returns the %i's matching nick 
   echo -a $ialchan($banmask,$chan,%i)
   ; increase looping-variable
   inc %i
 }
}

This more complex example will additionally echo what nicks that are currently in the channel are affected by this unban.

See Also