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
kymon
Novice


Joined: 29 Jan 2003
Posts: 40

PostPosted: Mon Feb 03, 2003 10:09 am   

only most specific trigger firing possible?
 
i want to trigger on two very similar outputs, which are:
^You {hit|slash|pierce|blast|whip} (*) hard in {his|her|its} {head|chest|left arm|right arm|left leg|right leg}.$
^You {hit|slash|pierce|blast|whip} (*) VERY hard in {his|her|its} {head|chest|left arm|right arm|left leg|right leg}.$

because of the (*) before the VERY, both triggers fire at an output like:
"You hit a samurai-guard VERY hard in his left leg."

Is it possible to have only the second one, eg the one with the most specific pattern, firing by some trick?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Feb 03, 2003 1:36 pm   
 
The best way is to change the first pattern to:
^You {hit|slash|pierce|blast|whip} ({^VERY}) hard in {his|her|its} {head|chest|left arm|right arm|left leg|right leg}.$

This is fine as long as you dont store anything else into the %n variables in this trigger. If you do, then it won't work correctly because of a bug.

The other way of doing it is to have the first trigger check to see if it actually matched on a line that was supposed to fire the second trigger:
#IF (!("%1" =~ "VERY$")) {The line that fired this trigger is not for the second trigger, so do something}

Kjata
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