From WikiChip
Difference between revisions of "mirc/on events/on ban"
< mirc‎ | on events

(Created On ban event - mIRC)
 
Line 7: Line 7:
 
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The level for the event to trigger.
 
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The level for the event to trigger.
  
<span style="display: inline-block; width: 105px;">'''<#[,#]>'''</span>The channel or channels for which the ban occurred. Optionally, you can use just a single '''#''' tag which refers to all channels, or you can specify a channel name directly, such as '''#myChannel'''. Furthermore, mIRC allows you the option of including multiple channels, which are separated with a comma, like so: #myChannel,#myOtherChannel,#lastChannel
+
<span style="display: inline-block; width: 105px;">'''<#[,#]>'''</span>The channel or channels for which the ban occurred. Optionally, a single '''#''' tag can be used which refers to all channels, or a channel name can be specified directly, such as '''#myChannel'''. Furthermore, mIRC allows the option of including multiple channels, which are separated with a comma, like so: #myChannel,#myOtherChannel,#lastChannel
  
 
<span style="display: inline-block; width: 105px;">'''<commands>'''</span>The commands to be performed when the event listener's criteria is met.
 
<span style="display: inline-block; width: 105px;">'''<commands>'''</span>The commands to be performed when the event listener's criteria is met.
  
 
== Examples ==
 
== Examples ==
<source lang="mIRC">; Let's create a ban event that listens for a ban
+
<source lang="mIRC">; This ban event listens for a ban
 
; on all channels, and responds by messaging the channel.
 
; on all channels, and responds by messaging the channel.
  
 
ON *:BAN:#:msg # Looks like the address $banmask has just been added to this channel's ban list.</source>
 
ON *:BAN:#:msg # Looks like the address $banmask has just been added to this channel's ban list.</source>
  
<source lang="mIRC">; This next example will watch for a ban on two
+
<source lang="mIRC">; This example will watch for a ban on two
 
; specific channels: #myChannel and #myOtherChannel. When a ban is
 
; specific channels: #myChannel and #myOtherChannel. When a ban is
 
; noticed, the script will also attempt to find out if a $bnick was set.
 
; noticed, the script will also attempt to find out if a $bnick was set.

Revision as of 14:09, 24 June 2014

The ON BAN event is triggered whenever a user on a channel has been banned. When the ban occurs, the two identifiers that are most closely associated with the event are the $banmask identifier, and the $bnick identifier. It is important to note that $bnick is not always filled, as some bans don't always contain the nickname, but rather a wildcard in the form of a banmask.

Synopsis

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

Parameters

<level>The level for the event to trigger.

<#[,#]>The channel or channels for which the ban occurred. Optionally, a single # tag can be used which refers to all channels, or a channel name can be specified directly, such as #myChannel. Furthermore, mIRC allows the option of including multiple channels, which are separated with a comma, like so: #myChannel,#myOtherChannel,#lastChannel

<commands>The commands to be performed when the event listener's criteria is met.

Examples

; This ban event listens for a ban
; on all channels, and responds by messaging the channel.
 
ON *:BAN:#:msg # Looks like the address $banmask has just been added to this channel's ban list.
; This example will watch for a ban on two
; specific channels: #myChannel and #myOtherChannel. When a ban is
; noticed, the script will also attempt to find out if a $bnick was set.
; If it was not, it will use it, otherwise it will use $banmask.
 
ON *:BAN:#myChannel,#myOtherChannel:msg # Wow, so $iif($bnick,$bnick just got in trouble,$banmask was just added to the channel's ban list) $+ .

The above script utilizes the $iif() identifier, which is a very powerful inline comparison tool within mIRC.

Compatibility

Added: mIRC v4.5

Added On: 30/06/96

See Also