On ban

From Scriptwiki
(Redirected from $banmask)
Jump to: navigation, search

The on BAN event trigger when a user on a channel is banned.

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

There are several special identifier connected with this event:

  • $banmask refers to the banmask used to ban the user.
  • $bnick refers to the banned 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.


on *:BAN:#help.script: { echo -a $nick just banned $banmask }

This will just react on every ban in #help.script echoing who banned what mask.

The next example is kind of the same as the one above, but it will additionally echo what nicks are affected:

on *:Ban:#help.script: {
 ; echo the first sentence as above
 echo -a $nick just banned $banmask $+ . This has effect on:
 ; now lets loop through all affected
 var %i = 1
 ; $ialchan($banmask,$chan,0) returns the total number of matched nicks.
 while (%i <= $ialchan($banmask,$chan,0)) {
  ; actually echo the nicks. $ialchan($banmask,$chan,%i) returns the %i's matched nick.
  echo -a $ialchan($banmask,$chan,%i)
  ; increase the looping-variable
  inc %i

See Also