|
brys0005 Newbie
Joined: 22 Sep 2005 Posts: 9
|
Posted: 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? |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Sat Jul 22, 2006 10:20 pm |
Can you reproduce exactly what your triggers and the such are?
|
|
|
|
brys0005 Newbie
Joined: 22 Sep 2005 Posts: 9
|
Posted: 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>
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Sun Jul 23, 2006 12:12 am |
#TRIGGER {(%x) is (%w) from here.} {mob = %1;direction=%2}
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
brys0005 Newbie
Joined: 22 Sep 2005 Posts: 9
|
Posted: 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.
|
|
|
|
edb6377 Magician
Joined: 29 Nov 2005 Posts: 482
|
Posted: 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" |
|
|
|
|
|