 |
Jagged Newbie
Joined: 04 May 2002 Posts: 9 Location: Denmark
|
Posted: Sat May 04, 2002 12:09 pm
Really stupid question from a complet newbie. |
Hi, i'm trying to make a trigger that will allow me to automaticly pick up coins if there are any on the ground.
Pattern will be fx. 20 gold coins.
I have no problem setting up a trigger that picks em up, but it also triggers if it is fx. you buy sword for 200 gold coins. How do I make it ignore it if there is anything infront of the pattern?
My trigger is:
pattern: %1 gold coins.
action: get %1 gold coins. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat May 04, 2002 3:46 pm |
Start your pattern with a ^. That means it will only trigger if your pattern is at the beginning of the line (nothing in front of it).
LightBulb
Vague questions get vague answers  |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sat May 04, 2002 3:56 pm |
Might want to consider using a different
pattern matching method for your trigger.
Its considered better form to use something
like:
Pattern: ^(%d) gold coins.
Action: get %1 gold coins.
Using %1 in your pattern could cause you grief.
TonDiening
Beta Upgrading to 6.26 |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat May 04, 2002 9:44 pm |
To further what TonDiening said, %1...%99 are variables, and any use of variables within a pattern is considered the same as the * or possibly even the %* wildcards--which catch everything and everything plus special characters, respectively. &Variable would do exactly the same thing here.
li'l shmoe of Dragon's Gate MUD |
|
|
 |
Jagged Newbie
Joined: 04 May 2002 Posts: 9 Location: Denmark
|
Posted: Sun May 05, 2002 4:40 pm |
Thanks guys that did the trick 
|
|
|
 |
|
|