|
snorkymn Newbie
Joined: 16 Jun 2006 Posts: 4
|
Posted: Fri Jun 16, 2006 5:50 pm
Silly Trigger question |
How do I differentiate in a trigger when I have the following two lines..
You see traces of your quarry to the north
You see traces of your quarry to the northeast
Right now the trigger for north will also go off for northeast as well.
I tried looking through other posts and searching a bit, but can't see how to tell it end of line or something. |
|
|
|
Ceres Wanderer
Joined: 25 May 2006 Posts: 88
|
Posted: Fri Jun 16, 2006 6:34 pm |
One trigger will be able to be used for both situations you simply need to capture the word which can change and then perform an #IF on it, something like this:
Code: |
#TRIGGER {You see traces of your quarry to the (%w)} {#IF (%1="north") {#ECHO The word north was detected, place the commands you want if this occurs inside these brackets} {#ECHO The word north was NOT detected, place the commands you want if this occurs inside these brackets}} |
That code was off ther top of my head so it is untested, use the zMud help Files to better understand the commands used and also take a look at the 'Pattern matching' section. |
|
|
|
snorkymn Newbie
Joined: 16 Jun 2006 Posts: 4
|
Posted: Fri Jun 16, 2006 6:54 pm |
Hmm.. There are actually about 8 directions, can you do if statements for all choices?
|
|
|
|
Ceres Wanderer
Joined: 25 May 2006 Posts: 88
|
Posted: Fri Jun 16, 2006 7:02 pm |
Ther are many ways you can process the information, What are you actually trying to do?
|
|
|
|
snorkymn Newbie
Joined: 16 Jun 2006 Posts: 4
|
Posted: Fri Jun 16, 2006 7:04 pm |
Well basically if it says a mob is a certain direction, go that direction.
|
|
|
|
Ceres Wanderer
Joined: 25 May 2006 Posts: 88
|
Posted: Fri Jun 16, 2006 8:00 pm |
This should do what you want:
Code: |
#TRIGGER {You see traces of your quarry to the (%w)} {%eval(%1)} |
Personally I wouldn't use a trigger to do that automatically but each to their own... |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jun 16, 2006 11:30 pm |
Even better, you can use a #CASE command (or %case() function, as applicable). Regardless of whether you use IF or CASE, you're going to need to track whether you have decided to go somewhere or not, and if so to disregard other such lines until after you've moved.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
edb6377 Magician
Joined: 29 Nov 2005 Posts: 482
|
Posted: Sat Jun 17, 2006 3:55 pm |
#CASE only works in cmud right?
|
|
_________________ Confucious say "Bugs in Programs need Hammer" |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Jun 17, 2006 4:14 pm |
Nope, #CASE predates CMud. You are thinking of #SWITCH, I believe.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
edb6377 Magician
Joined: 29 Nov 2005 Posts: 482
|
Posted: Sat Jun 17, 2006 10:53 pm |
blah ur right lol my head is swimming.
|
|
_________________ Confucious say "Bugs in Programs need Hammer" |
|
|
|
Mixsel Wanderer
Joined: 02 Feb 2003 Posts: 99 Location: Seattle, Wa
|
Posted: Sun Jun 18, 2006 1:24 pm |
Wouldn't this work?
#trigger {You see traces of your quarry to the &targetdir} {#echo mob went @targetdir Im gonna get that rascal!;@targetdir}
I always put in #echo in when im trying new stuff to help me figure out bugs.
OR i think this works also
#trigger {You see traces of your quarry to the (%w)} {#echo friggen chicken went %1;%1} |
|
_________________ Spin |
|
|
|
snorkymn Newbie
Joined: 16 Jun 2006 Posts: 4
|
Posted: Mon Jun 19, 2006 2:33 am |
Thanks, the simplest thing seeme dto be the last one you suggested Spin!
|
|
|
|
porsche Beginner
Joined: 23 Jul 2002 Posts: 22 Location: United Kingdom
|
Posted: Fri Jun 23, 2006 11:28 am |
How about using the $ at the end? So:
Code: |
#TRIGGER {You see traces of your quarry to the north$} { do stuff} |
|
|
|
|
|
|