Skip to content

Writing Triggers

Avi Kelman edited this page Nov 16, 2023 · 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 has 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.

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:

https://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 Aliases And Triggers

How do I trigger on new GMCP data?

The short answer is that you can't do it with MUSHclient triggers, but you can do something else. Read Using-GMCP to learn about how to do this from inside plugins.

Clone this wiki locally