|
Ambelghan Novice
Joined: 04 Apr 2010 Posts: 49
|
Posted: Sun Apr 04, 2010 6:15 am
How do you use the the OR operator in triggers |
Hi, I loved zMUD thought I would like cMUD and it is starting to be a massive hassle. Before I could just
Code: |
#TRIGGER{*match1*|*match2*|*match3*} {do what I want} |
I tried
Code: |
#TRIGGER{*match1*||*match2*||*match3*} {do what I want} |
and that doesn't work. Is there no way to do this in cMUD? There an easier way to highlight the text when someone says something (says, asks, ect)?
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Apr 04, 2010 6:59 am |
You need to do #TRIGGER {{*match1*|*match2*|*match3*}}, not #TRIGGER {*match1*|*match2*|*match3*}
Note the doubling of the brackets. {} within a trigger pattern means a group of things to check for. You might be better off, though, putting what you want to match into a variable, then doing #TRIGGER {{@@variable}} so it doesn't get so messy.
Charneus |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Sun Apr 04, 2010 7:18 am |
For starters, you do not need the * in your trigger pattern. The pattern will match if the words you're searching for appear anywhere in the line anyway. Secondly, to match an item in a string list, you need to put that string list inside curly brackets. Hence your trigger would look like:
#TRIGGER {{match1|match2|match3}} {do what I want} |
|
|
|
Ambelghan Novice
Joined: 04 Apr 2010 Posts: 49
|
Posted: Sun Apr 04, 2010 9:12 am |
That worked, thank you for the prompt response.
|
|
|
|
|
|