P

PlayMUD.online

Triggers

Triggers

React to MUD output with commands and highlights.

Triggers are automation items that scan incoming text after ANSI codes are stripped. They can match simple text, exact lines, or regular expressions.

Where To Find Them

Open Automation and click Add Trigger. You can keep triggers at the root or move them into folders with drag and drop or the Move to selector.

If a parent folder is disabled, the trigger is effectively disabled even if the trigger's own checkbox is still on.

Trigger Fields

  • Enabled controls whether the trigger runs.
  • Name is used in test results and the Activity tab.
  • Pattern is the text or regex to match.
  • Kind can be contains, exact, or regex.
  • Command is submitted when the trigger fires.
  • Cooldown prevents repeated firing within the configured milliseconds.
  • Text and Bg color controls highlight matching terminal lines.

Regex Captures

Regex triggers can insert capture groups into commands.

Pattern: ^You receive (\d+) gold
Command: say I received $1 gold

Supported substitutions are $1, $2, and so on. $0 and $& mean the full match. $$ inserts a literal dollar sign.

Variables In Trigger Commands

Trigger commands are passed through the normal command expansion path, so they can use variables.

Command: kill {target}

The Activity tab shows the final expanded command sent to the active MUD server.

Testing

The trigger tester lets you paste a sample MUD line and see which triggers match, what command would be produced, capture values, cooldown status, and invalid regex errors.

For Lua scripts, use Lua Triggers. For live debugging, use the Activity tab.