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

m (Parameters)
m (Parameters: Link access levels)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The '''ON CLOSE''' event triggers within mIRC when a specific window type is closed, either locally, through server interaction, or due to a scripted circumstance. This event can be used to trigger scripted situations for actions to perform when a certain window is closed.
+
{{mirc title|On Close - Events}}
 
+
The '''ON CLOSE''' event triggers within mIRC when a specific window type is closed.
The '''ON CLOSE''' event triggers the [[$target identifier - mIRC|$target]] identifier to be filled with the window related to the event. This identifier can now be used to reference the specific window during these events.
 
  
 
== Synopsis ==
 
== Synopsis ==
<pre>ON <level>:CLOSE:<?|@|=|!|*>:<commands></pre>
+
<pre>ON <level>:CLOSE:<?|#|@|=|!|*>:<commands></pre>
  
 
== 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.
 +
* '''<*><#><?><@><=><!>''' - The place, or places where the event listens, you can specify specific name of window, seperate them by comma.
 +
** '''*''' - Any channel/query/dcc/custom windows
 +
** '''#''' - Any #channel windows
 +
** '''?''' - Any query windows
 +
** '''=''' - Any dcc chat windows
 +
** '''!''' - Any dcc server windows
 +
* '''<commands>''' - The commands to be performed when the event triggers
  
<span style="display: inline-block; width: 105px;">'''<?|@|=|!|*>'''</span>The window type that the event should trigger for:
+
== {{mIRC|Local identifiers}} ==
  
<div style="background-color: rgba(0,0,0,.03); display: block;"><span style="border-right: 1px dashed rgba(0,0,0,.15); display: inline-block; margin-left: 105px; margin-right: 25px; width: 30px;">'''?'''</span>Private messages/query windows.</div>
+
{{mIRC|$target}} is filled with the name of the window related to the event.
  
<div style="background-color: rgba(0,0,0,.06); display: block;"><span style="border-right: 1px dashed rgba(0,0,0,.15); display: inline-block; margin-left: 105px; margin-right: 25px; width: 30px;">'''@'''</span>[[Custom Windows - mIRC|Custom @windows]]</div>
+
== Examples ==
 
+
<source lang="mIRC">; When Channel window are closed, print a message to
<div style="background-color: rgba(0,0,0,.03); display: block;"><span style="border-right: 1px dashed rgba(0,0,0,.15); display: inline-block; margin-left: 105px; margin-right: 25px; width: 30px;">'''='''</span>DCC Chat windows.</div>
+
; the "Status Window".
  
<div style="background-color: rgba(0,0,0,.06); display: block;"><span style="border-right: 1px dashed rgba(0,0,0,.15); display: inline-block; margin-left: 105px; margin-right: 25px; width: 30px;">'''!'''</span>DCC Fileserv windows.</div>
+
ON *:CLOSE:#: { echo -sg Closed $target window. }</source>
  
<div style="background-color: rgba(0,0,0,.03); display: block;"><span style="border-right: 1px dashed rgba(0,0,0,.15); display: inline-block; margin-left: 105px; margin-right: 25px; width: 30px;">'''*'''</span>All window types.</div>
 
 
<span style="display: inline-block; width: 105px;">'''<commands>'''</span>The commands to be performed when the event listener's criteria is met.
 
 
== Examples ==
 
 
<source lang="mIRC">; When DCC Chats are closed, send a notice to
 
<source lang="mIRC">; When DCC Chats are closed, send a notice to
 
; the person.
 
; the person.
Line 39: Line 40:
  
 
== Compatibility ==
 
== Compatibility ==
Added: mIRC v5.3
+
{{mIRC compatibility|5.3}}
 
 
Added On: 13/12/97
 
  
 
== See Also ==
 
== See Also ==
 
[[On open - mIRC|ON OPEN]]
 
[[On open - mIRC|ON OPEN]]
 +
{{mIRC on event list}}
  
[[Category:mIRC on events]]
+
[[Category:mIRC on events|close]]

Latest revision as of 07:35, 6 February 2024

The ON CLOSE event triggers within mIRC when a specific window type is closed.

Synopsis[edit]

ON <level>:CLOSE:<?|#|@|=|!|*>:<commands>

Parameters[edit]

  • <level> - The corresponding access levels for the event to trigger.
  • <*><#><?><@><=><!> - The place, or places where the event listens, you can specify specific name of window, seperate them by comma.
    • * - Any channel/query/dcc/custom windows
    • # - Any #channel windows
    • ? - Any query windows
    • = - Any dcc chat windows
    • ! - Any dcc server windows
  • <commands> - The commands to be performed when the event triggers

Local identifiers[edit]

$target is filled with the name of the window related to the event.

Examples[edit]

; When Channel window are closed, print a message to
; the "Status Window".
 
ON *:CLOSE:#: { echo -sg Closed $target window. }
; When DCC Chats are closed, send a notice to
; the person.
 
ON *:CLOSE:=:notice $nick Hey, thank you so much for the chat!
; When any window is closed, echo the window name
; to a custom @windowWatcher window. If that window doesn't exist,
; create it first.
 
ON *:CLOSE:*: {
  $iif(!$window(@windowWatcher),window @windowWatcher)
  echo @windowWatcher Window Closed: $target $+ .
}

Compatibility[edit]

Added: mIRC v5.3
Added on: 13 Dec 1997
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also[edit]

ON OPEN