Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Morpheus
Newbie


Joined: 01 Feb 2002
Posts: 8
Location: Norway

PostPosted: 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
Reply with quote
GiriFox
Wanderer


Joined: 25 Sep 2001
Posts: 59
Location: Australia

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
Morpheus
Newbie


Joined: 01 Feb 2002
Posts: 8
Location: Norway

PostPosted: 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
Reply with quote
Rehcra
Novice


Joined: 10 Oct 2000
Posts: 43

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
Malachi
Newbie


Joined: 03 May 2002
Posts: 3

PostPosted: 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.
Reply with quote
Morpheus
Newbie


Joined: 01 Feb 2002
Posts: 8
Location: Norway

PostPosted: Fri May 03, 2002 12:43 pm   
 
Thank you all for clearing this up for me

Most helpfull!

Morph
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net