

There is three ways to save your changes. Activated triggers show a green tick in the little blue box on the left side of the trigger name in the trigger tree on the left side of the script editor dialog. By default, new triggers are deactivated and thus will do nothing unless you explicitly activate them. Finally, you need to save the new trigger and then activate it with the padlock icon button.

Clear text command can be defined in the "send plain text" input box next to the trigger name above the pattern table. In the beginning, you can simply chose the "highlight trigger" option to make your trigger highlight the text that it has triggered on or send a clear text command to the game whenever the trigger fires until you have learned enough Lua to more meaningful scripts. Usually, this will be done by a Lua script in the Lua editor below the table with the pattern list. The next step is to define what should happen when the trigger matches. For more advanced information on AND and OR trigger see the corresponding AND/OR trigger section below. If you define multiple patterns in the same trigger, your trigger will run whenever any one of these patterns matches unless you chose the AND-trigger option, in which case the trigger will only fire if all patterns match within a specified amount of lines from the game. in the second column of the trigger pattern table. Afterwards, chose the correct pattern type of your trigger pattern in the drop down list on the right side of the trigger pattern i.e. Then put the text pattern that you’d like to trigger on into the trigger conditions table on the right side of the screen above the script editor. To begin with, click on the "Add" button to create a new trigger.
#Mudlet triggers how to#
Note: QUICKSTART: Here is a simple video tutorial on how to make basic triggers in Mudlet. In other words, triggers react to text that has been sent by the game, whereas alias react to user commands that have been typed into the command line. Unlike alias that define patterns that match on user input, triggers define patterns that match on game output.
#Mudlet triggers code#
1.7 Lua Code Conditions & Variable Triggers - Expression Triggers.1.6 Named capturing groups in Perl regex triggers and tempRegexTrigger.1.5 Multi-Line Triggers and Multi-Condition Triggers.1.3 "multiline / AND" and "OR" Condition Triggers.
