on action
Synopsis
/on [<noise>]action "<pattern>" [(<argument list>)] { <commands> }
Description
Triggered when someone sends a nonempty CTCP action to you or a channel. Actions are normally generated by me and describe. Your own outgoing action uses on send_action.
Use the standard on matching and noise controls. The pattern matches the sender, destination, and message body together. There are no action-specific options.
Parameters
| Parameter | Meaning |
|---|---|
$0 |
Sender's nickname. |
$1 |
Destination as received, normally your nickname or a channel. |
$2- |
Action description, after incoming character-set conversion. |
An empty description does not trigger this event. The built-in CTCP handler processes actions carried by either privmsg or notice, without sending an automatic reply. The event does not prove that the sender used a particular client command.
Default behavior
If the hook permits default display, EPIC formats the action at the action message level and routes it through the normal window context for its sender and destination:
* sender descriptionfor a channel that is current in a window on the receiving server.* sender:channel descriptionfor another channel.*> sender descriptionfor a non-channel destination.
A suppressing hook, such as a serial-zero ^action hook, prevents this built-in line; its commands can supply replacement output. It does not retract the incoming message or send anything to the server.
The event is reached through the built-in CTCP action handler, enabled by default. Script CTCP handlers can replace it; on ctcp_request can suppress request processing before it runs. The CTCP parser also discards some payloads before the action handler, including messages with more than eight CTCP delimiter characters, destinations beginning with $, and # channels the client has not joined. See CTCP action.
Example
Distinguish personal actions from actions to channels while replacing the built-in display:
on ^action * (sender, recvr, body) {
if (recvr == servernick()) {
echo *> $sender $body;
} else if (iscurchan($recvr)) {
echo * $sender $body;
} else {
echo * $sender/$recvr $body;
};
};
History
This event already existed in ircII.
Source references
source/ctcp.c:init_ctcp,do_ctcp, anddo_atmosphereregister the handler, apply parser limits, invoke the event, and format default output.source/parse.c:p_privmsgandp_noticepass incoming messages through CTCP processing.source/hook.c: theactionhook registration anddo_hookimplement matching, argument handling, and default-display suppression.source/window.c:real_set_contextselects the output context.