I've been scouring the forum for a few hours, I've watched a few videos, and I can't find a solution to what I'm sure is a simple problem. I'm sorry if this is the 300th time it's been posted.
I have created a miniwindow, with a rectangle, with a hotspot mapped to that rectangle, with a simple mouseup function that sends some text to the mud. I want a client variable to be evaluated against a condition, and depending on that send various text to the mud.
Everything seems to be fine, but I cannot get the conditional statement to evaluate to anything but false.
I have a variable on the client called char_name, which is set via trigger. This works fine. I click on the variables button on the client, it says "char_name Bob", no problems there.
When I try to evaluate this in my script (which is in an xml file and added via plugins) its always false. This is the exact format I've been using in the client, and it evaluates properly there. I'm sure I'm missing some little something.
It always prints "Dick" even though the variable is set to "Bob".
I have created a miniwindow, with a rectangle, with a hotspot mapped to that rectangle, with a simple mouseup function that sends some text to the mud. I want a client variable to be evaluated against a condition, and depending on that send various text to the mud.
Everything seems to be fine, but I cannot get the conditional statement to evaluate to anything but false.
I have a variable on the client called char_name, which is set via trigger. This works fine. I click on the variables button on the client, it says "char_name Bob", no problems there.
When I try to evaluate this in my script (which is in an xml file and added via plugins) its always false. This is the exact format I've been using in the client, and it evaluates properly there. I'm sure I'm missing some little something.
if (GetVariable("char_name") == "Bob") then
name = "Bob"
else
name = "Dick"
end
function mouseup (flags, hs1)
print(name)
end --mouseup
It always prints "Dick" even though the variable is set to "Bob".