Documentation

Editing Triggers

When you select a Trigger setting and open the advanced options panel at the bottom, you will get an editor panel like this:
Trigger editor

Enabled
Determines if this alias is enabled or disabled.
Pattern
This is the pattern for the trigger to match text sent by the server. Clicking the down-arrow at the right of the pattern will open a multiline edit box for editing very long trigger patterns.
Script
This is the script executed when the trigger pattern matches text send by the server. See the Scripting topic for more information.
Language
Select the scripting language used for this trigger. Built-in languages include: zScript, Lua, VBScript, and JavaScript. But any other scripting language installed into the Windows Scripting Host can also be used.
Pattern / Wizard / Script Text / XML / Compiled Code / Compiled Pattern
The Pattern tab will display the Trigger Pattern tester panel.  The Wizard tab will display the script wizard.  Selecting the Compiled Code tab will show the low-level code generated by this trigger. The Compiled Pattern tab will show the low-level code generated by the trigger pattern and the Compiled Code tab will show the low-level code generated by the script. These are only displayed when Advanced Tabs is enabled and are for internal testing purposes and are not documented further. Selecting the XML tab will allow you to edit the raw XML data used for copy/paste and import/export.
Type
Sets the Trigger Type of the trigger.
Priority
This is the order in which triggers are executed. The smaller priority numbers are executed first. TeSSH automatically adds space between priority numbers to make adding new triggers more efficient. So you shouldn't normally care about the exact priority numeric value. It's usually easier to drag/drop triggers in the main settings tree view to change priorities relative to other triggers.
ID
This is the shortcut name for the trigger. This name can be used in commands such as #T+, #T-, #COND, etc to reference the trigger without using the full pattern name.
Notes
Used to store comments with the trigger. You might use this to remind yourself what the trigger is used for.
Case Sensitive
If checked, then the pattern must match the proper case (upper/lower) of text from the server.
ANSI Trigger
If checked, then ANSI color codes from the server are added to the text, so the pattern can contain the %e escape character, followed by ANSI color codes to match an exact color line from the server. To match a single line color, see the Line Color option below. Using the ANSI Trigger option requires that you have knowledge of the low-level ANSI color codes being sent by the server
Verbatim
The trigger pattern is matched exactly and no special characters are parsed. This is quicker than matching text that contains wildcard characters.
Trigger on Trigger
When checked, other triggers are enabled during the processing of the script for the current trigger (allowing other triggers to fire on the results of the script). When unchecked, all other triggers are disabled while this trigger is running. Note that if you uncheck this option and then use a command like #WAIT in your trigger, other triggers will be disabled during the #WAIT time, but text from the server will still be received. This might cause some other triggers to not fire normally.
Stop further processing
When this option is checked, no other triggers will be tested if this trigger fires. This option should be used with care since it can prevent triggers loaded in other packages from firing on the same text from the server.
Repeat within line
When enabled, the trigger pattern is tested more than once on a single line and will fire for every match of the pattern on the line. (Added in v2.0)
Regular Expression
Normally the trigger Pattern field uses pattern matching characters optimized for TeSSH (See the Pattern Matching topic). If you prefer to use standard Perl Regular Expression syntax, check this option.
Trigger on Newline
Only tests the trigger on entire lines of text received from the server (ending in a newline character).
Trigger on Prompt
Only tests the trigger on text from the server that doesn't end in a newline (such as the server prompt).
Line Color
If enabled, the starting color of the line of text from the server must match the color indicated in the color box. Click on the color box to change this color.

To add additional trigger states, use the New/Trigger State menu command.

Add comment

Login or register to post comments