Difference between revisions of "On unban"

From Scriptwiki
Jump to: navigation, search
 
m
 
Line 27: Line 27:
  
 
== See Also ==
 
== See Also ==
To react on a ban, take a look at the [[On_ban|On ban event]].
+
* [[On_ban|On ban event]] to react when someone is banned.
  
 
[[Category:Events]]
 
[[Category:Events]]

Latest revision as of 09:50, 2 July 2007

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