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
krizchan
Newbie


Joined: 19 May 2002
Posts: 0
Location: Singapore

PostPosted: Fri Apr 19, 2002 8:45 am   

Mob Flee Trigger (zMud Newbie)
 
I looked over the write up Zugg did on triggers (very well written btw), but stil cant seem to accomplish what I need to do.

text : a goblin child flees to the south

trigger i have : %1 flees to the %2

action taken : %2;kill %1

Thus I move the direction mob flees %2, and then try to kill %1.

What happens is I do follow the direction properly, but when I go to kill it comes back and says 'a is not around here' is there a way to make it so I would use the second word and if that fails try the third word. Sometimes mob names are stuff like "the great guard" where only "kill guard" will work, etc etc.

Hope that made sense.

Thanks in advance for any help.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Apr 19, 2002 9:05 am   
 
%1 is matching "a goblin child"
In the action taken %1 will give you "a"
In the action taken "%1" will give you "a goblin child"

Pattern matching is best done with different
types than %#'s. You could get bitten by that
concept as you get more experienced.

text : a goblin child flees to the south

trigger: ^{A|An|The} (%*) flees to the ({north|south|east|west}).$
^ is used to match the beginning of the line
{A|An|The} helps reduce people emote spoofing you


action taken : %2;kill %word("%1",%numwords("%1"))
If you can 9/10 times kill the last word of the fleeing
thing then this will work 9/10 times

Ton Diening
Reply with quote
krizchan
Newbie


Joined: 19 May 2002
Posts: 0
Location: Singapore

PostPosted: Fri Apr 19, 2002 9:53 am   
 
Maybe I am doing something wrong, but I copied and pasted your trigger word for word and pattern does not match. Should I have left something out? I did not include your comments btw.

Thanks for the reply !
Reply with quote
krizchan
Newbie


Joined: 19 May 2002
Posts: 0
Location: Singapore

PostPosted: Sat Apr 20, 2002 2:18 am   
 
nevermind I figured it out myself. Thanks for all the replies ......*cough*
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