Skip to content

Writing Triggers

Avi Kelman edited this page Feb 3, 2015 · 12 revisions

Scripting is a complicated subject that has been addressed by documentation for MUSHclient itself. See the following pages for some help on writing triggers:

I tried making a trigger but it isn't firing. What did I do wrong?

In zMUD, if you make a pattern that looks like

This is a pattern

It will match on

HELLO This is a pattern FROM THE FUTURE!!!

Because zMUD's standard pattern format is sloppy and begins and ends with implicit "*".

MUSHclient works differently. MUSHclient's standard pattern format treats your pattern as if it begins with "^" and ends with "$". There is no implicit allowance for extra garbage outside of the pattern. In MUSHclient if you want to catch

HELLO This is a pattern FROM THE FUTURE

and also just

This is a pattern

Then you would need to make your pattern something like

*This is a pattern*

Or switch to using regular expressions, which are much more expressive (but are trickier to get right).

How do I make multi-state triggers?

See this forum post explaining how to translate the zMUD/CMUD multi-state trigger concept into MUSHclient triggers:

http://www.mushclient.com/forum/bbshowpost.php?bbsubject_id=10338

zMUD lets me add triggers from the input bar. How do I do that in MUSHclient?

See the guide page on that subject here: Command-Line-Aliase-And-Triggers

Clone this wiki locally