|
aslanthekat Novice
Joined: 17 Sep 2007 Posts: 44 Location: Missouri
|
Posted: Thu Jun 18, 2009 1:54 pm
Or expression |
I have a trigger that looks like...
Code: |
#TR ^{Bob tells you 'hi'|You dream of Bob telling you 'hi'} {tell Bob hello} |
That trigger works just fine, but when I do this.
Code: |
#TR ^{%1 tells you 'hi'|You dream of %1 telling you 'hi'} {tell %1 hello} |
Nothing happens
I look forward to enlightenment. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Jun 18, 2009 2:19 pm |
Firstly, you need another set of {}, so your trigger will be:
#TR ^{{Bob tells you 'hi'|You dream of Bob telling you 'hi'}} {tell Bob hello}
Secondly, %1 isn't a proper wildcard. It'll work in some cases, but it won't always do what you want it to. Use a proper wildcard. |
|
|
|
aslanthekat Novice
Joined: 17 Sep 2007 Posts: 44 Location: Missouri
|
Posted: Thu Jun 18, 2009 2:38 pm |
You're right , I mistyped my trigger I have #TRIGGER {^{%1 telling you 'test'|%1 tells you 'test'}} {#SA worked}
Using %w instead of %1 doesn't work either.
Any more suggestions are appreciated |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu Jun 18, 2009 2:38 pm |
You've got two things going on here. First, as proper syntax you shouldn't use %1 in your trigger pattern. What you really want is %w.
Second what's really affecting you is that you can use wild cards in pattern alternations with zMUD.
You have a few options.
First you can create two triggers. I'll assume this is a no-go since you used pattern alternation in the first place.
Second you can rewrite the pattern so the wildcards are outside of the alternation.
Code: |
^{You dream of |}(%w) tell{s|ing} you 'hi' |
Third you can switch to a #REGEX which are very powerful, but a bit daunting at first.
Code: |
(?:You dream of \a+ telling you \'hi\'|\a+ tells you \'hi\') |
Just paste the pattern into your trigger and make sure the Perl Regular Expression button is checked.
I hope that helps. |
|
_________________ Asati di tempari! |
|
|
|
aslanthekat Novice
Joined: 17 Sep 2007 Posts: 44 Location: Missouri
|
Posted: Thu Jun 18, 2009 3:07 pm |
You're right I have it in two triggers at the moment. I tried your first code and it worked perfectly. I've never worked with regex but I might have to look into that.
Thanks both of you for the help. |
|
|
|
|
|