m (Bot: Fixing links) |
m (→Parameters: Correct typo) |
||
(14 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | The '''ON BAN''' event is triggered whenever a user on a channel has been banned | + | {{mirc title|On Ban - Events}} |
+ | The '''ON BAN''' event is triggered whenever a user on a channel has been banned. | ||
== Synopsis == | == Synopsis == | ||
− | <pre>ON <level>:BAN:<#[,#]>:<commands></pre> | + | <pre>ON <level>:BAN:<*,#[,#]>:<commands></pre> |
== Parameters == | == Parameters == | ||
− | + | * '''<level>''' - The corresponding {{mIRC|access levels}} for the event to trigger. | |
+ | * '''<matchtext>''' - The corresponding {{mIRC|on text|matchtext}} for the event to trigger. | ||
+ | * '''<*><#[,#]>''' - The place, or places where the event listens, you can separate them by comma. | ||
+ | ** '''*''' - Any channel window | ||
+ | ** '''#''' - Any channel window | ||
+ | ** '''#channel[,#]''' - one or more specific channels, separate them by comma | ||
+ | * '''<commands>''' - The commands to be performed when the event triggers | ||
− | + | == {{mIRC|local identifiers}} == | |
− | + | === {{mIRC|$banmask}} === | |
− | + | Returns the banmask used to ban the user. | |
− | < | + | === {{mIRC|$bnick}} === |
+ | |||
+ | Returns the nickname of the user being banned. It is important to note that {{mIRC|$bnick}} is not always filled, as some bans don't always contain the nickname. | ||
+ | |||
+ | == Comparing levels == | ||
+ | |||
+ | You can compare the levels of the banner and the banned by prefixing the line with <, >, <=, =>, <> (different than), or =, in the following way: | ||
+ | |||
+ | <source lang="mIRC"> | ||
+ | on >=2:BAN:#mIRC:/msg $chan $nick banned $banmask (legal) | ||
+ | on 1:BAN:#mIRC:/msg $chan $nick banned $banmask (illegal) | ||
+ | </source> | ||
+ | |||
+ | In this situation, if the banners level is larger than or equal to the banned users level, then it is a legal ban. | ||
+ | |||
+ | Otherwise, it defaults to the second ON BAN line which indicates that it is an illegal ban. Remember, this is comparing the banners and banned users levels and has nothing to do with the level 2 in the definition. | ||
+ | |||
+ | Remember that $banmask is usually a {{mirc|wildcard}} string which means that it will match both wildcard and non-wildcard user strings in your remote users section. | ||
== Examples == | == Examples == | ||
Line 27: | Line 51: | ||
ON *:BAN:#myChannel,#myOtherChannel:msg # Wow, so $iif($bnick,$bnick just got in trouble,$banmask was just added to the channel's ban list) $+ .</source> | ON *:BAN:#myChannel,#myOtherChannel:msg # Wow, so $iif($bnick,$bnick just got in trouble,$banmask was just added to the channel's ban list) $+ .</source> | ||
− | |||
− | |||
== Compatibility == | == Compatibility == | ||
− | + | {{mIRC compatibility|4.5}} | |
− | |||
− | |||
== See Also == | == See Also == | ||
* {{mIRC|$banmask}} | * {{mIRC|$banmask}} | ||
* {{mIRC|$bnick}} | * {{mIRC|$bnick}} | ||
− | * | + | * {{mIRC|$ibl}} |
* {{mIRC|/ban}} | * {{mIRC|/ban}} | ||
− | * | + | * {{mIRC|on events/on unban|on unban event}} |
{{mIRC on event list}} | {{mIRC on event list}} | ||
− | [[Category: | + | [[Category:mIRC on events|ban]] |
Latest revision as of 07:39, 6 February 2024
The ON BAN event is triggered whenever a user on a channel has been banned.
Contents
Synopsis[edit]
ON <level>:BAN:<*,#[,#]>:<commands>
Parameters[edit]
- <level> - The corresponding access levels for the event to trigger.
- <matchtext> - The corresponding matchtext for the event to trigger.
- <*><#[,#]> - The place, or places where the event listens, you can separate them by comma.
- * - Any channel window
- # - Any channel window
- #channel[,#] - one or more specific channels, separate them by comma
- <commands> - The commands to be performed when the event triggers
local identifiers[edit]
$banmask[edit]
Returns the banmask used to ban the user.
$bnick[edit]
Returns the nickname of the user being banned. It is important to note that $bnick is not always filled, as some bans don't always contain the nickname.
Comparing levels[edit]
You can compare the levels of the banner and the banned by prefixing the line with <, >, <=, =>, <> (different than), or =, in the following way:
on >=2:BAN:#mIRC:/msg $chan $nick banned $banmask (legal) on 1:BAN:#mIRC:/msg $chan $nick banned $banmask (illegal)
In this situation, if the banners level is larger than or equal to the banned users level, then it is a legal ban.
Otherwise, it defaults to the second ON BAN line which indicates that it is an illegal ban. Remember, this is comparing the banners and banned users levels and has nothing to do with the level 2 in the definition.
Remember that $banmask is usually a wildcard string which means that it will match both wildcard and non-wildcard user strings in your remote users section.
Examples[edit]
; 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) $+ .
Compatibility[edit]
Added: mIRC v4.5
Added on: 30 Jun 1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.