Trigger That Matches Strings in an Array of Vaiables

Posted by Errigour on Mon 06 Apr 2026 08:40 PM — 5 posts, 3,184 views.

USA #0
I want to make a trigger that will change the color of strings
that I put in a variable. Is it possible.

I want to match 10 monster names and put them in a variable.
Then change the color of text that matches those strings until
they are removed from the variable.

If I can't do it then that would be an awesome feature to add.
USA Global Moderator #1
I'm having a hard time understanding what you mean. Could you give an example?
Amended on Tue 07 Apr 2026 02:55 AM by Fiendish
Australia Forum Administrator #2
Make a variable (in the GUI interface), like this:


Name: mobs
Value: naga|kobold|wolf


Put the various mob names in the variable, separated by the "|" character.

Then make a trigger:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   expand_variables="y"
   match="(@!mobs)"
   regexp="y"
   repeat="y"
   sequence="100"
  >
  </trigger>
</triggers>


This expands out the variable "mobs" without escaping anything, and that becomes what is matched. Then in this example they are coloured yellow.

Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
Amended on Tue 07 Apr 2026 06:12 AM by Nick Gammon
USA #3
It isn't matching. Does that have to be in a script file or can I just put (@!mobs) in the trigger pattern?
USA #4
Oh it worked i just had to expand variables. Thank you so much!