From WikiChip
Difference between revisions of "mirc/on events/on quit"
m (→Compatibility: This was added in 3.7) |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{mirc title|On Quit - Events}} |
The '''ON QUIT''' event is triggered when a user quits/disconnects from the IRC network while on the same channel as the local mIRC client. | The '''ON QUIT''' event is triggered when a user quits/disconnects from the IRC network while on the same channel as the local mIRC client. | ||
Line 5: | Line 5: | ||
<pre>ON <level>:QUIT:<commands></pre> | <pre>ON <level>:QUIT:<commands></pre> | ||
− | <span style="display: inline-block; width: 105px;">'''<level>'''</span>The | + | |
+ | == Parameters == | ||
+ | <span style="display: inline-block; width: 105px;">'''<level>'''</span>The corresponding {{mIRC|access levels}} for the event to trigger. | ||
<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. | ||
Line 11: | Line 13: | ||
== Example == | == Example == | ||
When a user disconnects, stop mIRC's default message and, instead, echo to the active window a custom message: | When a user disconnects, stop mIRC's default message and, instead, echo to the active window a custom message: | ||
− | <source lang="mIRC"> | + | <source lang="mIRC">on ^*:QUIT:{ |
echo -a * $nick just disconnected from $network | echo -a * $nick just disconnected from $network | ||
haltdef | haltdef | ||
}</source> | }</source> | ||
+ | |||
+ | <source lang="mIRC"> | ||
+ | Because ON QUIT is not associated with # or $chan, to show a quit message in all channels you share with that nick, you can use $comchan. You can simulate mIRC's default Quit message in channels with: | ||
+ | |||
+ | on ^*:QUIT:{ | ||
+ | var %i $comchan($nick,0) | ||
+ | while (%i) { | ||
+ | echo -ctg quit $comchan($nick,%i) * $nick $+($chr(40),$address,$chr(41)) Quit $iif($1,$+($chr(40),$1-,$chr(41))) | ||
+ | dec %i | ||
+ | } | ||
+ | haltdef | ||
+ | } | ||
+ | </source> | ||
== Compatibility == | == Compatibility == | ||
− | {{mIRC compatibility| | + | {{mIRC compatibility|3.7}} |
== See Also == | == See Also == |
Latest revision as of 08:35, 6 February 2024
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
The ON QUIT event is triggered when a user quits/disconnects from the IRC network while on the same channel as the local mIRC client.
Synopsis[edit]
ON <level>:QUIT:<commands>
Parameters[edit]
<level>The corresponding access levels for the event to trigger.
<commands>The commands to be performed when the event listener's criteria is met.
Example[edit]
When a user disconnects, stop mIRC's default message and, instead, echo to the active window a custom message:
on ^*:QUIT:{ echo -a * $nick just disconnected from $network haltdef }
Because ON QUIT is not associated with # or $chan, to show a quit message in all channels you share with that nick, you can use $comchan. You can simulate mIRC's default Quit message in channels with: on ^*:QUIT:{ var %i $comchan($nick,0) while (%i) { echo -ctg quit $comchan($nick,%i) * $nick $+($chr(40),$address,$chr(41)) Quit $iif($1,$+($chr(40),$1-,$chr(41))) dec %i } haltdef }
Compatibility[edit]
Added: mIRC v3.7
Added on: 12 Oct 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See Also[edit]
mIRC on event list