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
brinlong
Newbie


Joined: 13 Mar 2004
Posts: 8
Location: USA

PostPosted: Sat Mar 13, 2004 5:30 am   

Strings of items
 
Heres an odd trigger question. lets say i have 20 chests, and I want to pick them all. I know the output it shows when it picks the chest. Is there a syntax so that the trigger would run:

->pick chest
you pick the lock on the iron chest
->pick chest+1
you failed
->pick chest+1
you pick the lock on the wood chest
->pick chest+2

And so on? I know the syntax for the pattern would be {you pick the lock on the (%1) chest} but what would I put for the output to the pattern?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Mar 13, 2004 9:13 pm   
 
No, a trigger Pattern should not use %1. Use * for a general wildcard or the appropriate specific wildcard when you have a better idea what type of text will need to be matched.

#VAR chests 1 1
#VAR pick 0 0
#AL picks {#VAR chests %1;#T+ PickChest;#IF (%numparam() > 1) {pick chest~+%2} {#VAR pick 0;pick chest}}
#CLASS PickChest
#TR {you pick the lock on the * chest} {#ADD pick 1;#IF (@pick < @chests) {picks @chests @pick} {#T- PickChest}}
#TR {you failed} {#IF (@pick > 0) {picks @chests @pick} {picks @chests}}
#CLASS 0
Reply with quote
brinlong
Newbie


Joined: 13 Mar 2004
Posts: 8
Location: USA

PostPosted: Sat Mar 13, 2004 10:55 pm   
 
Thanks man Smile
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