TRIGGERS
All available triggers in TinTin++ are displayed when you use the #info
command without an argument. All of them are written to file when you
use the #write command, except commands, histories, and paths.
Triggers can be disabled with the #ignore command. The #message
command can be used to disable messages generated or related to the
corresponding trigger, though this is generally not needed.
The #debug command will generate useful debugging information for the
corresponding trigger when enabled. The #info command can be used on
triggers to generate additional information that might be of use.
Example: #info event on
When #info event is set to on you will see when most events are raised.
Since this can get rather spammy some of the events won't generate
messages, unless you have an event in the same category set already.
Text triggers
When a block of text arrives from the host it is split into individual
lines, and all action, prompt, gag, substitute, and highlight triggers
are checked for each line. Only one action can trigger per line, while
the other triggers can trigger multiple times.
Packet fragmentation
MUDs that send long blurbs of text, don't have MCCP support, have a bad
connection, or a combination of all three, will deliver broken packets.
This can cause triggers to not fire, as well as displaying problems if
#split is enabled.
To mitigate this you can use #config packet_patch 0.5.
TinTin++ will automatically enable packet patching if the IAC GA or IAC
EOR telnet sequences are used to mark the end of the prompt. A MUD can
negotiate the EOR option: https://tintin.mudhalla.net/protocols/eor
In addition #prompt can be used to make packet patching less noticable.
Color triggers
By default most color, control, and vt100 codes are stripped from
incoming text before being ran through the trigger engine. To create
a trigger that runs on the unstripped text, the regular expression in
the trigger should start with a ~.
To view control codes you can use #config convert_meta on which will
translate both input and output codes to PCRE escape sequences.
Multi-line triggers
If an action or substitution contains the \n sequence it will be
turned into a multi-line trigger. A multi-line trigger is executed on
incoming blocks of text from the MUD, and they will not trigger if the
regular expression spans more than one block. You can visualize
incoming blocks by using the following event:
#event {RECEIVED OUTPUT} {#echo <058>%+80h BLOCK}
Since the %* expression does not capture the \n sequence it is required
to use %a to capture multiple lines. To capture the start of the block
use \A and for the end use \Z. You can use ^ and $ to capture the
start and end of a line.
Multi-line triggers trigger before regular triggers. Multiple
multi-line actions can trigger per block, and each multi-line action
can trigger multiple times per block. Packet fragmentation is not
currently handled.
Multi-line triggers are experimental and subject to change.
Input triggers
The alias, history and pathdir triggers are checked for each line of
input. The macro and tab triggers are checked for key presses.
Time triggers
The delay, path, and ticker triggers will execute at a set timed
interval.
Substitution triggers
The function and variable triggers will generally execute right
before the final processing of a line of text.
Mouse triggers
The button trigger is checked for each mouse input. #config mouse
must be set to on to enable mouse tracking.
Event triggers
Events can be used for a wide variety of pre-defined triggers.
Related: pcre, substitutions and escape_codes.
|