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

(Created On Chat event - mIRC)
 
m (Bot: adding missing title)
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The '''ON Chat''' event, much like the [[On serv - mIRC|ON Serv]] event, is triggered when a message is sent via a [[DCC Chat - mIRC|DCC Chat]] window.
+
{{mirc title|On Chat - Events}}
 +
The '''ON Chat''' event, much like the [[On serv - mIRC|ON Serv]] event, is triggered when a message is sent via a {{mIRC|/dcc|dcc chat}} window.
  
 
== Synopsis ==
 
== Synopsis ==
Line 5: Line 6:
  
 
== 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.
  
<span style="display: inline-block; width: 105px;">'''<matchtext>'''</span>The text that you wish to match. Much like the [[On text - mIRC|ON TEXT]] event, this can be any combination of text letters, numbers, and [[wildcards]].
+
* '''<matchtext>''' - The corresponding {{mIRC|on text|matchtext}} 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.
+
* '''<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 15: Line 20:
 
; command !time and then relays back to them the current time
 
; command !time and then relays back to them the current time
  
ON *:CHAT:!time:msg =$nick The current time is: 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 '''[[$nick identifier - mIRC|$nick]]''' identifier. Instead, the [[=$nick identifier - mIRC|=$nick]] identifier has been used. This special identifier tells mIRC that the event should not simply send a private message 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 ==
Added: mIRC v3.8
+
{{mIRC compatibility|3.8}}
 
 
Added On: 25/11/95
 
  
 
== See Also ==
 
== See Also ==
 
* [[On serv - mIRC|ON SERV]]
 
* [[On serv - mIRC|ON SERV]]
 
* [[On text - mIRC|ON TEXT]]
 
* [[On text - mIRC|ON TEXT]]
 +
{{mIRC on event list}}
  
[[Category:mIRC on events]]
+
[[Category:mIRC on events|chat]]

Latest revision as of 20:12, 15 June 2017

The ON Chat event, much like the ON Serv event, is triggered when a message is sent via a dcc chat window.

Synopsis[edit]

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

Parameters[edit]

  • <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[edit]

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

Examples[edit]

; 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[edit]

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[edit]