|
krizchan Newbie
Joined: 19 May 2002 Posts: 0 Location: Singapore
|
Posted: 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. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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 |
|
|
|
krizchan Newbie
Joined: 19 May 2002 Posts: 0 Location: Singapore
|
Posted: 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 ! |
|
|
|
krizchan Newbie
Joined: 19 May 2002 Posts: 0 Location: Singapore
|
Posted: Sat Apr 20, 2002 2:18 am |
nevermind I figured it out myself. Thanks for all the replies ......*cough*
|
|
|
|
|
|