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

(Examples)
Line 11: Line 11:
  
 
* '''<commands>''' - The commands to be performed when the event listener's criteria is met.
 
* '''<commands>''' - The commands to be performed when the event listener's criteria is met.
 +
 +
== {{mIRC|Local identifiers}} ==
 +
 +
You can use {{mIRC|identifiers/{{=}}$nick|{{=}}$nick}} to refer to the dcc chat window, rather than a query window.
  
 
== Examples ==
 
== Examples ==
Line 18: Line 22:
 
ON *:CHAT:!time:msg =$nick The current time is: $time(hh:nntt)</source>
 
ON *:CHAT:!time:msg =$nick The current time is: $time(hh:nntt)</source>
  
In the above example, the '''msg''' is not simply followed by the '''{{mIRC|$nick}}''' identifier. Instead, the {{mIRC|identifiers/{{=}}$nick|{{=}}$nick}} identifier has been used. This special identifier tells mIRC that the event should not simply send a private message to the user, but rather it should message the user's DCC Chat window, if there is one.
+
In the above example, the message is sent to the dcc chat window
  
 
== Compatibility ==
 
== Compatibility ==

Revision as of 13:50, 6 February 2016

Template:mIRC Guide The ON Chat event, much like the ON Serv event, is triggered when a message is sent via a DCC Chat window.

Synopsis

ON <level>:CHAT:<matchtext>:<commands>

Parameters

  • <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 listener's criteria is met.

Local identifiers

You can use =$nick to refer to the dcc chat window, rather than a query window.

Examples

; This event waits for any user on a DCC Chat to use the
; command !time and then relays back to them the current time
 
ON *:CHAT:!time:msg =$nick The current time is: $time(hh:nntt)

In the above example, the message is sent to the dcc chat window

Compatibility

Added: mIRC v3.8
Added on: 25 Nov 1995
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also