|
shazara Beginner
Joined: 17 Feb 2003 Posts: 16 Location: USA
|
Posted: Sun Apr 10, 2005 12:18 am
{bleh|blah|gah} patterns |
I have the following trigger:
You{ |*$*}may{ |*$*}enter{ |*$*}the{ |*$*}wilderness{ |*$*}map{ |*$*}from{ |*$*}here.$
It is written this way to account for: a space, a linebreak, a space-linebreak, a linebreak-space, or a space-linebreak-space (after any one of the words). It seems to work, however if I set the trigger value to: "#ECHO It worked!" I am spammed with multiple echoes.
This is in a room where there is a space and a linebreak after "the".
With the settings "newline" and "trigger on trigger": I get 7 consecutive echoes.
Code: |
You may enter the
wilderness map from here.
It worked!
It worked!
It worked!
It worked!
It worked!
It worked!
It worked!
You see exits leading northeast, east, and south.
3189h, 4369m ex-
|
With the settings "newline" only:
Code: |
You may enter the
wilderness map from here.
It worked!
You see exits leading northeast, east, and south.
It worked!
3189h, 4369m ex-
It worked!
3189h, 4369m ex-
It worked! |
With no settings (newline, trig on trig, prompt OFF): The trigger doesn't fire.
With the settings "trigger on trigger" and "prompt" I get:
Code: |
You may enter the
wilderness map from here.
You see exits leading northeast, east, and south.
3189h, 4369m ex-It worked!
3189h, 4369m ex-It worked!
3189h, 4369m ex-It worked! |
With the settings "prompt" I get:
Code: |
You may enter the
wilderness map from here.
You see exits leading northeast, east, and south.
3189h, 4369m ex-It worked!
3189h, 4369m ex-It worked!
3189h, 4369m ex-It worked!
|
Question 1: Why is it firing multiple times?
Question 2: Can I trigger such a line in one trigger, and if yes, howso? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Apr 10, 2005 5:37 am |
You don't need stringlists for this, just use %q. I'm not sure what the asterisks are for, but that's probably your problem.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
shazara Beginner
Joined: 17 Feb 2003 Posts: 16 Location: USA
|
Posted: Sun Apr 10, 2005 7:48 pm Hmm.. |
My questions weren't really answered.
I used the { |*$*} pattern to match either word-space, word-space-linebreak, word-linebreak, word-linebreak-space, or word-space-linebreak-space. If that description is unclear, let me know?
What would %q do for me in this case? Not anything about it in the manual (unless you mean %query or %quote, in which case I'm still confused).
Help is appreciated! |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Sun Apr 10, 2005 9:30 pm Re: Hmm.. |
shazara wrote: |
What would %q do for me in this case? Not anything about it in the manual (unless you mean %query or %quote, in which case I'm still confused). |
zMud help | references | pattern matching
Answer 1: Because your pattern is totally goofy... well a little goofy, anyway. I'm surprised it doesn't fire on every line with that many line-breaks ($) and catch-alls (*).
Answer 2: Yes. Use %q or maybe a regular expression.
I'm no good at writing regular expressions, or I'd do it. Hopefully someone else will be by soon. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Apr 11, 2005 4:06 am |
Quote: |
Not anything about it in the manual
|
Actually, there is. You didn't look hard enough or in the right place. It's listed with all the other wildcard patterns under the heading of Pattern Matching. If I recall rightly, there's a link to this specific topic in the Aliases or Triggers section of the help menu found in the Settings Editor. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Mon Apr 11, 2005 2:13 pm |
Try this:
#TRIGGER {^*$} {#IF (%regex(%line2%line,"^You may enter the wilderness map from here\.$")) {#ECHO {It Worked!}}} |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|