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

m (Bot: Fixing compatibility)
m (Parameters: Link access levels)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{mirc title|On Open - Events}}
 
The '''ON OPEN''' event triggers within mIRC when a specific window type is opened, 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 opened.
 
The '''ON OPEN''' event triggers within mIRC when a specific window type is opened, 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 opened.
  
Line 7: Line 8:
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 105px;">'''<level>'''</span>The level for the event to trigger.
+
<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;">'''<?|@|=|!|*>'''</span>The window type that the event should trigger for:
 
<span style="display: inline-block; width: 105px;">'''<?|@|=|!|*>'''</span>The window type that the event should trigger for:
Line 21: Line 22:
 
<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>
 
<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;">'''<matchtext>'''</span>The text that should be matched. Can be a [[wildcard]]. Specifically for this event, this text will most-likely be from a private message query window opening up. The reason is that this will allow interaction with the text, during the event of a query window opening, immediately, rather than waiting for an [[On text - mIRC|ON TEXT]] event to trigger.
+
<span style="display: inline-block; width: 105px;">'''<matchtext>'''</span>The text that should be matched. Can be a {{mirc|wildcard}}. Specifically for this event, this text will most-likely be from a private message query window opening up. The reason is that this will allow interaction with the text, during the event of a query window opening, immediately, rather than waiting for an [[On text - mIRC|ON TEXT]] 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 39: Line 40:
 
{{mIRC on event list}}
 
{{mIRC on event list}}
  
[[Category:MIRC on events]]
+
[[Category:mIRC on events|open]]

Latest revision as of 06:58, 6 February 2024

The ON OPEN event triggers within mIRC when a specific window type is opened, 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 opened.

Much like the ON CLOSE event, the ON OPEN event triggers the $target identifier, and fills it with the window name related to the event. During the ON OPEN events, $target now refers to the window the event is dealing with.

Synopsis[edit]

ON <level>:OPEN:<?|@|=|!|*>:<matchtext>:<commands>

Parameters[edit]

<level>The corresponding access levels for the event to trigger.

<?|@|=|!|*>The window type that the event should trigger for:

?Private messages/query windows.
=DCC Chat windows.
!DCC Fileserv windows.
*All window types.

<matchtext>The text that should be matched. Can be a wildcard. Specifically for this event, this text will most-likely be from a private message query window opening up. The reason is that this will allow interaction with the text, during the event of a query window opening, immediately, rather than waiting for an ON TEXT event to trigger.

<commands>The commands to be performed when the event listener's criteria is met.

Examples[edit]

; When a query window opens, recognize if
; the user has typed the !yourserver command, which will
; relay to the user the current server for the mIRC client
 
ON *:OPEN:?:!yourserver:msg $nick Current IRC Server: $server $+ .

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 CLOSE