## 8.1. Creating and Editing Triggers

The easiest way to create and alter triggers is from the World Editor, the place where all settings of a World are altered (see Chapter 4, Editing a World).

Trigger are defined in the Triggers section inside the Automation section. When you open that section, you'll see a list of the defined triggers and some buttons like this:

Figure 8.1. The graphical Trigger editor

The main part of the window is the list of defined triggers. The columns are as follows:

- Enabled specifies whether the trigger is enabled or not. Triggers that are not enabled are not active and will not be tried when a line is received, but they remain in the list so that they can later be enabled again.

- Name is a name that is assigned to a trigger. This helps you identify the trigger's purpose and is useful when editing a trigger via the command line (as described in Section 8.6.1, “Editing Triggers”). Assigning a name to a trigger is optional.

- Pattern and Action are the parameters for the trigger, and they define the trigger's action, as described above.

- I Case (for "Ignore Case"), if set, means the case is not considered while matching the pattern, that is, a case-insensitive match is done.

- Gag defines if the line that matches the trigger will be printed. If this is active, the line is gaged (omitted) from the main screen.

- Gag Log defines if the line that matches the trigger will be written to the log file. If this is active, the line is gaged (omitted) from the log file, if logging is enabled (see Chapter 14, Logging the Output).

- Keep Exec defines what happens when the trigger is matched. By default, if a trigger matches further matching of that line against other triggers is stopped. If, however, this option is active and the trigger matches, the line continues being tried against other triggers.

- Rewriter defines if the trigger is a rewriter trigger, a special kind of trigger described in Section 8.5.1, “Rewriter Triggers”.

- Plugin: if this is non-empty, it means that the trigger belongs to a plugin (and the name of the plugin is displayed). However, by default plugin triggers are not displayed. See Section 4.7, “Advanced” for information on how to display plugin triggers here.

### 8.1.1. Adding Triggers

To add a new trigger, press the Add button. This will open a window for you to edit the new trigger's parameters:

Figure 8.2. The window to edit triggers

What can be set represents the columns described above.

When you are finished, press OK and the trigger will be added. If you change your mind, press Cancel and the trigger will not be added.

The next sections will describe some things that can be done with triggers.

### 8.1.2. Editing Triggers

To edit a trigger, select it by clicking its line in the list (the line will be highlighted), and press the Edit button. A window like the one used for adding trigger (see Section 8.1.1, “Adding Triggers”) will be opened, filled with the trigger's parameters. Change what you want, and press the OK to commit the changes. If, however, you change you mind, press Cancel and the changes will be not be made, the trigger will remain as it was before.

Another shorter way to edit a trigger is to double click its line in the list.

It is also possible to change the value of the boolean options (those represented by a check box) directly from the trigger list. Make sure that the trigger you want to change is selected, and click in the check button. The state will be toggled.

To delete a trigger, select it and press the Delete button. You will be asked for confirmation, and can cancel the operation, but once deleted, you cannot recover the trigger. If you want, you can disable this confirmation dialog (see Section 4.7, “Advanced”), but if you do so and click the Delete button, the only way to undo your action will be creating the trigger again. To delete several triggers at once, select them all and press Delete.

The final thing that needs to be explained with regard to triggers is how to reorder them. Triggers as tried from the first one to the last, so in a few cases the order might matter. To move a trigger up or down in the list, select it and press the corresponding button.