 |
Lain Novice
Joined: 26 Oct 2001 Posts: 38
|
Posted: Sun Apr 27, 2003 1:35 am
Triggering and not triggering on similar patterns |
I've setup a trigger which will store, into a variable, the name of a person I am following,
Pattern: You follow (*).
Value: #VAR follow {%1}
I have another trigger that will move inside the map, in the direction I follow the person in.
Pattern: You follow {@follow} (*).
Value #MOVE %1
Where (*) is the direction they move "You follow Blah north.
Unfortunately I haven't figured out how to stop the first trigger from triggering on the second's pattern (As a player's name can be more than one word), which means the variable '@follow' gets changed to "Person's Name north".
The only way I've so far succeeded is to put the first trigger into a class and have it disabled when it has triggered, and re-enabled when yet another trigger sees "You stop following Blah."
I'm not always able to stop following normally; the person may disappear before I get a chance, this means there is nothing to trigger from to re-enable the class folder unless I do it manually. Is there an easier way to accomplish this without using a class folder?
Lain |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Apr 27, 2003 3:47 am |
Use an alias or an oninput trigger to set the variable when you decide to follow someone.
#ONINPUT {^follow (*)} {~follow %1}
#COND {You follow (*).} {#VAR follow {%1}} {within|param=5}
LightBulb
Advanced Member |
|
|
 |
Spectrum Beginner
Joined: 13 Feb 2003 Posts: 13 Location: Philippines
|
Posted: Sun Apr 27, 2003 12:10 pm |
Related to the follow trigger I would also like to ask how to propery get the direction of the guy/gall you are ff. I play achaea and the message looks like this:
You follow Adam east to Cave.
I use this trigger pattern:
"You follow (*) (%w) to (*)" which works.
%1=Adam
%2=east
%3=Cave
But when the message becomes:
You follow Adam to the Entrance to the Cave.
Its:
%1=Adam east to
%2=Entrace
%3=the Cave
The Entrance to the Cave is suppose to be the room name but since there is word "to" in the sentence it dont work well. so How? |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Apr 27, 2003 1:06 pm |
It would have been more polite to start your own topic, in case Lain had additional questions about this. However, just change the first * to %w.
LightBulb
Advanced Member |
|
|
 |
Lain Novice
Joined: 26 Oct 2001 Posts: 38
|
Posted: Mon Apr 28, 2003 4:33 am |
Great, thanks Lightbulb.
The only other thing I've noticed as a potential problem; if I choose to follow "a something" or "an something", the following message changes from "You follow Somebody north." to "You follow the somebody north". How may I tell the trigger to look for either a or an if it occurs and alter to look for the in the next trigger?
I thought of making a seperate trigger for an occurance of a or an and having the trigger add a the into the variable:
#VAR follow] {the %1}
But that would probably complicate things.
Lain |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Apr 28, 2003 5:21 am |
That makes things slightly more complicated, Lain. Here's what I came up with.
#ONINPUT {^follow (*)} {~follow %1}
#COND {You follow (*).} {#VAR follow {%1};#IF %begins( {%1}, "a ") {#VAR follow {the %remove( "a ", @follow)}};#IF %begins( {%1}, "an ") {#VAR follow {the %remove( "an ", @follow)}}} {within|param=5}
LightBulb
Advanced Member |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Apr 28, 2003 7:09 am |
I deleted my post before Lightbulbs as it confused even myself upon rereading your post.
Spectrum:
To handle this concept:
You follow Adam to the Entrance to the Cave.
The key is to know who you are following.
Lets say @follow is "Adam"
Trigger:You follow @follow to (*).
Value:#SH I followed @follow to %1
Else you parse it out:
Trigger: You follow (*).
Value:
#IF (!%pos(" to ",{%1})>0) {#SH I just followed someone ({%1}) not to somewhere?} {
#VAR followedwho %copy({%1},1,%pos(" to ",{%1}) -3)
#VAR followedto %copy({%1},%pos(" to ",{%1})+4,%len({%1}))
}
Ton Diening |
|
|
 |
|
|