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
mortie
Wanderer


Joined: 26 Sep 2002
Posts: 73
Location: United Kingdom

PostPosted: Thu Jun 12, 2003 10:30 pm   

correct trigger syntax
 
I am having trouble creating a trigger which will work on all the following matches

(6) (G)(H) glasses of wisdom [198] - matches
(6) (G) glasses of wisdom [198] - matches
(6) glasses of wisdom [198]
glasses of wisdom [198]

i can only get it to match 2 of them with the following trigger syntax

^~(%1~)%s{~(G~)|~(G~)~(H~)}%s(%2)%s~[%d~]

how can i get it to match all 4 with the same trigger or is this not possible?

thanks

mortie :)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jun 13, 2003 1:14 am   
 
First you should not use %1..%99 in the trigger pattern. Read the Pattern Matching help for more info there.

Next thing is use of *, it is capable of matching any number of characters including none but your 3rd and forth patterns will cause hiccups in which values things are stored to.

Since your current pattern indicates beggining of line, and the mud was nice enough to provide blanks for those portions that are not present you can use a fixed width pattern or a range, and parse it within the trigger for the numeric value you want. (I forgot to count the width so double check it if you go that way.)

#TR {^(&11) (*) ~[%d~]} {Count=%eval(%word("%1",1));#NOOP whatever else you wanted to do}

or

#TR {^([1234567890GH() ])(*) ~[%d~]} {Count=%eval(%word("%1",1));#NOOP whatever else you wanted to do}
Reply with quote
mortie
Wanderer


Joined: 26 Sep 2002
Posts: 73
Location: United Kingdom

PostPosted: Fri Jun 13, 2003 7:52 am   
 
Thanks for the reply Vijilante
I used a combo of the two

#TR {^(&5)([1234567890GHMI() ]) (*)%s~[%d~]}

and its working just great now

thanks for the help

mortie :)
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