EPIC Enhanced Programmable IRC-II Client

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:

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