|
Sarden Newbie
Joined: 23 Dec 2007 Posts: 3
|
Posted: 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. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
|
|