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


Joined: 23 Dec 2007
Posts: 3

PostPosted: Wed Jan 02, 2008 12:52 pm   

Creating a trigger from a Variable
 
I am somehow messing up the expansion rules. I have tried %expand it does not seem to be what I want here.


#VAR fooON="You turned on the switch."
#VAR fooOFF="The switch just shut off!"

#TRIGGER {@fooON} {switchON=1}

#TRIGGER {@fooOFF} {#ECHO @fooOFF;switchON=0}

This is not exactly what I'm trying to accomplish but the idea is where there is a variable I want to use the contents of the variable
as a string.

The trigger pattern should be the contents of the variable not @fooON for example. The variable inside the trigger commands needs to be the text inside the variable as well. All expanded as if I manually typed in the text.

The reason for this are the variables are dynamic. I want to create the triggers and destroy them as I read through a database, execute a few commands, and move on to the next record.

Thank you for your help.
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Jan 02, 2008 3:51 pm   
 
Hm, it works fine for me in CMUD. The syntax you used to create the variable wasn't right, but I'm guessing that was just a slip
fooON = "You turned on the switch."

Maybe force expansion using
#TRIGGER {{@fooON}} {switchON=1}
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
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