(EDIT: Haley-ninja'd :( )
You've hit a pretty common gotcha, actually. The Send code is pre-processed before it's run as Lua code. The @var and %wildcard syntax is not part of Lua, and MUSHclient replaces them with their true values before running the code. So in your code, @prone is actually retrieved
before you set it.
Just use GetVariable("prone") or "%3" instead of @prone:
SetVariable ("prone", "%3")
if "%3" == 'p' then
Send("handspring")
end
-- Or this:
SetVariable ("prone", "%3")
if GetVariable("prone") == 'p' then
Send("handspring")
end
There's also another problem in your code: @ and % identifiers are inserted directly into the code, so if we assume that @prone does contain the letter p, it would look like this before going into Lua:
SetVariable ("prone", "%3")
if p == 'p' then
Send("handspring")
end
It looks like p is a variable, not a string. So you need to quote @ and % identifiers yourself if you're going to use them as strings:
SetVariable ("prone", "%3")
if "%3" == 'p' then
Send("handspring")
end
Final nitpick: Make sure you use double quotes "" instead of single quotes '' when quoting the @/% identifiers. If a variable contains a double quote, MUSHclient will escape it for you so it doesn't cause a script error (because Lua will think the string ended early). I don't believe it does the same with single quotes, so you need to make sure you use the doubles!