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

(Created On error event - mIRC)
 
m (Bot: adding missing title)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''ON ERROR''' event is triggered when an [[Server - IRC|IRC Server]] sends an error message, most-likely a disconnect message.
+
{{mirc title|On Error - Events}}
 
+
The '''ON ERROR''' event is triggered when an server sends an error message, most-likely a disconnect message.
This event fills the '''$1-''' identifier with the entire error message.
 
  
 
== Synopsis ==
 
== Synopsis ==
Line 7: Line 6:
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The level for the event to trigger.
+
* '''<level>''' - The corresponding {{mIRC|access levels}} for the event to trigger.
 +
* '''<matchtext>''' - The corresponding {{mIRC|on text|matchtext}} for the event to trigger.
 +
* '''<commands>''' - The commands to be performed when the event triggers
  
<span style="display: inline-block; width: 105px;">'''<matchtext>'''</span>The text that to be matched. Can also be a [[wildcard]].
+
== {{mIRC|local identifiers}} ==
  
<span style="display: inline-block; width: 105px;">'''<commands>'''</span>The commands to be performed when the event listener's criteria is met.
+
=== {{mIRC|$N|$1-}} ===
 +
 
 +
Returns the error message.
  
 
== Example ==
 
== Example ==
 +
This example will trigger if the response ''full'' is in the server-returned error:
 
<source lang="mIRC">ON *:ERROR:*full*:echo -s This server is most-likely full. Server sent error: $1-</source>
 
<source lang="mIRC">ON *:ERROR:*full*:echo -s This server is most-likely full. Server sent error: $1-</source>
  
 +
This example triggers if the word ''ban'' is within the server error:
 
<source lang="mIRC">ON *:ERROR:*ban*:echo -s You're most-likely banned from this server. Server sent error: $-</source>
 
<source lang="mIRC">ON *:ERROR:*ban*:echo -s You're most-likely banned from this server. Server sent error: $-</source>
  
 
== Compatibility ==
 
== Compatibility ==
Added: mIRC v4.7
+
{{mIRC compatibility|4.7}}
 
 
Added On: 09/12/96
 
  
 
== See Also ==
 
== See Also ==
Line 28: Line 31:
 
* [[On disconnect - mIRC|ON DISCONNECT]]
 
* [[On disconnect - mIRC|ON DISCONNECT]]
 
* [[On exit - mIRC|ON EXIT]]
 
* [[On exit - mIRC|ON EXIT]]
 +
{{mIRC on event list}}
  
[[Category:mIRC on events]]
+
[[Category:mIRC on events|error]]

Latest revision as of 19:14, 15 June 2017

The ON ERROR event is triggered when an server sends an error message, most-likely a disconnect message.

Synopsis[edit]

ON <level>:ERROR:<matchtext>:<commands>

Parameters[edit]

  • <level> - The corresponding access levels for the event to trigger.
  • <matchtext> - The corresponding matchtext for the event to trigger.
  • <commands> - The commands to be performed when the event triggers

local identifiers[edit]

$1-[edit]

Returns the error message.

Example[edit]

This example will trigger if the response full is in the server-returned error:

ON *:ERROR:*full*:echo -s This server is most-likely full. Server sent error: $1-

This example triggers if the word ban is within the server error:

ON *:ERROR:*ban*:echo -s You're most-likely banned from this server. Server sent error: $-

Compatibility[edit]

Added: mIRC v4.7
Added on: 09 Dec 1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also[edit]