P

PlayMUD.online

Triggers

Triggers

React to MUD output with commands and highlights.

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

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 Advanced Triggers. For live debugging, use the Activity tab.