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

m (Bot: adding missing title)
(Examples)
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
== Synopsis ==
 
== Synopsis ==
<pre>ON <level>:CLOSE:<?|@|=|!|*>:<commands></pre>
+
<pre>ON <level>:CLOSE:<?|#|@|=|!|*>:<commands></pre>
  
 
== Parameters ==
 
== Parameters ==
  
* '''<*><?><@><=><!>''' - The place, or places where the event listens, you can specify specific name of window, seperate them by comma.
+
* '''<*><#><?><@><=><!>''' - The place, or places where the event listens, you can specify specific name of window, seperate them by comma.
** '''*''' - Any query/dcc/custom windows
+
** '''*''' - Any channel/query/dcc/custom windows
 +
** '''#''' - Any #channel windows
 
** '''?''' - Any query windows
 
** '''?''' - Any query windows
 
** '''=''' - Any dcc chat windows
 
** '''=''' - Any dcc chat windows
Line 19: Line 20:
  
 
== Examples ==
 
== Examples ==
 +
<source lang="mIRC">; When Channel window are closed, print a message to
 +
; the "Status Window".
 +
 +
ON *:CLOSE:#: { echo -sg Closed $target window. }</source>
 +
 
<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.

Revision as of 18:24, 21 February 2021

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

Synopsis

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

Parameters

  • <*><#><?><@><=><!> - 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

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

Examples

; 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

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

ON OPEN