Chapter 8. Triggers

Table of Contents
8.1. Creating and Editing Triggers
8.1.1. Adding Triggers
8.1.2. Editing Triggers
8.2. Basic Triggers
8.3. Changing the Style of the Matched Text
8.4. Gags
8.5. Other trigger features
8.5.1. Rewriter Triggers
8.6. Defining Triggers in the Command Line
8.6.1. Editing Triggers
8.6.2. Assigning Names to Triggers
8.6.3. Reordering Triggers
8.7. Importing and Exporting
8.8. Testing Triggers

Triggers allow you to react automatically to text that comes from the MUD. This reaction can be of two forms: sending something to the MUD in reply, or doing something else with no direct interaction with the MUD, such as printing something in the screen.

Sometimes the action of a trigger is to change the line that was received and that activated the trigger. You might want to match all lines that contain a certain word (such as your character's name) and print these lines (or part of these lines) in a different color to draw attention. (This feature is sometimes called highlighting.) Additionaly, sometimes you might want to omit some lines, such as everything said by some annoying player, or some messages that are not relevant for you. This kind of trigger is often called a gag. Both these features are supported by KildClient.

Triggers are defined by specifying a pattern against which all lines received from the MUD are matched. If there is indeed a match, an action specified by you is executed. If the trigger is a gag, then the line that matched will not be printed in the screen, otherwise it is printed normally. (Note that printing actually happens before the action is executed, even if here things were described in another order for ease of understanding.)

The above description was very brief and was meant just to give a basic idea of how triggers work. Next follows a more detailed explanation of all aspects involving triggers.