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
dazed-n-confused
Novice


Joined: 14 Jan 2004
Posts: 31

PostPosted: Thu Feb 12, 2004 6:25 am   

triggers to recognize a variable
 
Back to the drawing board. Im trying to create a trigger to auto-fill my pipes during combat. Here is the idea, when I type pipelist I get the following:
Pipe#15635 An ebony pipe No herb.
Pipe#63829 An ebony pipe Megillos (11 puffs).
Pipe#83592 An ebony pipe Arkasu (3 puffs).

I would like a trigger to recognize which herb goes into pipe#15635, and automatically outpouch herb;fill pipe#15635 with herb.
Someone please help, I can't count the times this would have saved my life.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Feb 12, 2004 7:01 am   
 
Something like this:

#TRIGGER {^Pipe~#(%d) * (%w) ~(%d puffs~).} {#ADDKEY PipeList %1=%2}
#TRIGGER {^Pipe~#(%d) * No herb.} {outpouch %db(@PipeList,%1);fill Pipe~#%1 with %db(@PipeList,%1)}
Reply with quote
dazed-n-confused
Novice


Joined: 14 Jan 2004
Posts: 31

PostPosted: Thu Feb 12, 2004 8:02 am   
 
Oh that is so close. When it goes to fill pipe#1234 with megillos, the trigger should fill pipe1234 with megillos not pipe#1234. How it appears in pipelist and how you issue the command are different. Being the master programmer that I am Very Happy I tried to alter the code a little myself, but it had undesirable results.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Feb 12, 2004 8:48 am   
 
#TRIGGER {^Pipe~#(%d) * No herb.} {outpouch %db(@PipeList,%1);fill Pipe%1 with %db(@PipeList,%1)}


Remove the ~# in the last part :P
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