|
Morpheus Newbie
Joined: 01 Feb 2002 Posts: 8 Location: Norway
|
Posted: Thu May 02, 2002 9:49 am
Untrigger problem |
I have a trigger in the class Teamkills
Pattern: Xar killed
When Xar leaves my team I want this trigger gone
Thus I have a trigger like this..
Pattern: %0 left your team.
#untrigger {%0 killed} {Teamkills}
However nothing happens. The trigger is still there.
IF I change the trigger like this.
Pattern: %0 left your team.
#untrigger {Xar killed} {Teamkills}
the Xar trigger is removed. Thus it seems to me that I use the wildcards wrong or something…
Any ideas?
Morph |
|
|
|
GiriFox Wanderer
Joined: 25 Sep 2001 Posts: 59 Location: Australia
|
Posted: Thu May 02, 2002 10:42 am |
heh, I don't even know what %0 does, so I'm keen to see an answer too.
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu May 02, 2002 11:36 am |
Yes, the wildcards are wrong. There is no %0, in zMUD, and the %1, %2, %3, etc. are not to be used inside patterns. This works, I think, to provide some compatibility with TinTin, but it sometimes produces unexpected results. You ned to change the pattern of your trigger to:
(%w) left your team.
and then the command to:
#UNTRIGGER {%1 killed} {Teamkills}
Look at the help file entry called Pattern Matching, for more info on this.
Kjata |
|
|
|
Morpheus Newbie
Joined: 01 Feb 2002 Posts: 8 Location: Norway
|
Posted: Thu May 02, 2002 12:15 pm |
Wow.. works like a charm
Why do I need the () around he w in he pattern though. Or more to the point, what do the () do?
I hear vague questions gets vague answers
Wondering
Morph |
|
|
|
Rehcra Novice
Joined: 10 Oct 2000 Posts: 43
|
Posted: Thu May 02, 2002 2:06 pm |
Yes, you need the ( ).
They tell the parser that you want to load this information into the %1 var. Without them %1 never get's set. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu May 02, 2002 4:50 pm |
Yeah, what Rehcra said. More specifically, the parenthesis tell zMUD you want to store whatever is matched by the wildcard contained inside them. Thus, whatever is matched by the wildcard inside the first set of parenthesis is tored in %1. The next set of parenthesis define %2, and so on.
Kjata |
|
|
|
Malachi Newbie
Joined: 03 May 2002 Posts: 3
|
Posted: Fri May 03, 2002 5:10 am |
And to re-stress: (%1) won't capture anything. It's (%w) that captures a word, and sticks it into the %1 variable.
|
|
|
|
Morpheus Newbie
Joined: 01 Feb 2002 Posts: 8 Location: Norway
|
Posted: Fri May 03, 2002 12:43 pm |
Thank you all for clearing this up for me
Most helpfull!
Morph |
|
|
|
|
|