trouble writing to take variable value then execute action

Posted by Erick on Sun 07 Dec 2008 11:20 PM — 3 posts, 12,650 views.

#0
I have trouble scripting for healing in my MUD.
im using LUA. I have set the triggers
FEELING SAD to send to variable sad the value of 1
FEELING MAD to send to variable mad the value of 1
and I see 1 in both mad and sad under variables when the triggers comeup.

My trouble is executing an action when my alias shows that im mad or sad.
this is what ive tried to write
the alias is diagnoss and I send to script:

if @sad=1 then
Execute "eat ash"
elseif @mad=1 then
Execute "eat ash"
else
Note "you are not sad or mad"
end

I apologize for being such a caveman, but I am having fun learning and I'm really stuck.
Respectfully, Erick
Australia Forum Administrator #1
I hope you have "expand variables" checked, and that you are talking about MUSHclient variables and not Lua variables.

In any case, the test for equality is == not =. so it should read:


if @sad == 1 then


#2
Mr. Gammon,
You are my hero! It works!
This is great,
Thank You