Difference between revisions of "On action"
m |
|||
(5 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
on <level>:ACTION:<matchtext>:<*><?><#[,#]>:<commands> | on <level>:ACTION:<matchtext>:<*><?><#[,#]>:<commands> | ||
− | The matchtext can be a [[ | + | The matchtext can be a [[If-Then-Else#The_Operators|wildcard]] match or even a [[Regular_Expression|regular expression]]. |
To use regular expressions as matchtext, you need the [[Access_Levels|$-Prefix]]. | To use regular expressions as matchtext, you need the [[Access_Levels|$-Prefix]]. | ||
Line 15: | Line 15: | ||
== Example == | == Example == | ||
on *:ACTION:*:#: { | on *:ACTION:*:#: { | ||
− | + | [[If-Then-Else|if]] (*slaps [[$me]] * [[If-Then-Else#iswm|iswm]] [[$1-]]) { | |
− | + | [[msg]] [[$chan]] Don't slap me, [[$nick]] [[DollarPlus|$+]] ! | |
− | + | } | |
} | } | ||
This example will react on every slap, that hits you and sends a message to this channel: ''Dont slap me, <nickname who has slapped you>''. | This example will react on every slap, that hits you and sends a message to this channel: ''Dont slap me, <nickname who has slapped you>''. | ||
+ | |||
on *:ACTION:*moos*:#help.script: { | on *:ACTION:*moos*:#help.script: { | ||
− | + | msg #help.script $nick just moo'd!. | |
} | } | ||
This example will react on every "moos" in #help.script and sends a message to this channel. | This example will react on every "moos" in #help.script and sends a message to this channel. | ||
== See Also == | == See Also == | ||
− | + | * [[On_text|On Text event]] to react to "normal text". | |
− | + | * [[describe|/describe]] to send an action to a specific channel. | |
[[Category:Events]] | [[Category:Events]] |
Latest revision as of 09:59, 2 July 2007
The on ACTION event triggers when you receive private and/or channel action.
on <level>:ACTION:<matchtext>:<*><?><#[,#]>:<commands>
The matchtext can be a wildcard match or even a regular expression. To use regular expressions as matchtext, you need the $-Prefix.
Read access levels to get more info about the <level> field.
The location where this event occurrs can be either a channel (#), a query (?) or both (*).
You can also use variables as matchtext and location parameter.
Note that you can't test these events by typing it yourself. To test them, use another connection, that you can establish via /server.
Example
on *:ACTION:*:#: { if (*slaps $me * iswm $1-) { msg $chan Don't slap me, $nick $+ ! } }
This example will react on every slap, that hits you and sends a message to this channel: Dont slap me, <nickname who has slapped you>.
on *:ACTION:*moos*:#help.script: { msg #help.script $nick just moo'd!. }
This example will react on every "moos" in #help.script and sends a message to this channel.
See Also
- On Text event to react to "normal text".
- /describe to send an action to a specific channel.