## Chapter 8. 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.