Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Jagged
Newbie


Joined: 04 May 2002
Posts: 9
Location: Denmark

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Jagged
Newbie


Joined: 04 May 2002
Posts: 9
Location: Denmark

PostPosted: Sun May 05, 2002 4:40 pm   
 
Thanks guys that did the trick
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net