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


Joined: 22 Sep 2005
Posts: 9

PostPosted: Sat Jul 22, 2006 10:12 pm   

please help with matching a target
 
I need some help with matching a target. I have a variable called mob that stores the name of my target, say 'a large yellow snake' and I want to hunt it with a trigger. I have triggers setup to automatically hunt, so the problem lies in parsing the target to make sure that i am hunting the right one. for instance:

hunt a
No-one in this area by that name.

hunt large
Your natural hunting skills track down your victim with ease.
A large mammal is north from here.

notice, that hunting 'large' finds an incorrect target.

hunt yellow
Your natural hunting skills track down your victim with ease.
A tiny yellow bird is north from here.

hunt snake
Your natural hunting skills track down your victim with ease.
A large yellow snake is north from here.

So the problem lies in the fact that I need to iterate through all of the word contained in my mob variable and then match the correct one.

Any ideas on how to do this?
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Sat Jul 22, 2006 10:20 pm   
 
Can you reproduce exactly what your triggers and the such are?
Reply with quote
brys0005
Newbie


Joined: 22 Sep 2005
Posts: 9

PostPosted: Sat Jul 22, 2006 10:32 pm   
 
well, i have triggers for automatically hunting something based on results of hunt <victim>. So when it says <victim> is <direction> from here i move in that direction. The hunting is started with autohunt <victim>
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sun Jul 23, 2006 12:12 am   
 
#TRIGGER {(%x) is (%w) from here.} {mob = %1;direction=%2}
_________________
Discord: Shalimarwildcat
Reply with quote
brys0005
Newbie


Joined: 22 Sep 2005
Posts: 9

PostPosted: Sun Jul 23, 2006 12:19 am   
 
I appreciate the help, but i think you guys are missing the point. If I have 'a large yellow snake' stored in a mob variable, i need to iterate through all of the words...i need to hunt large, hunt yellow, hunt snake, and at the same time i need to know when i've hunted the correct thing.
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Sun Jul 23, 2006 1:04 am   
 
sounds like you need to take the value of the mob variable and if it = %1 in the shalimar trigger do X else do y.

i.e.
#TRIGGER {(%x) is (%w) from here.} {mob = %1;direction=%2;#IF (@mob = %1) {#t- autohunt;%2}}

For the "Iteration" you speak of
#LOOP %numwords(@mob) {#t+ autohunt;hunt %item(@mob,%i)}

BTW this is just a quick example showing you how you can do those in relevance with your script. I didnt plan or write them out to work as they are (they might). This is merely an example of a possible way to do it so you can see iterations and triggers.
_________________
Confucious say "Bugs in Programs need Hammer"
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