Hi,
I'm trying to create a simple function for comparing spell cost and actual mana. I want it to be accessible in any alias/trigger that I create. I have possible a problem with syntax. I am saving this in a file named "myscript.lua", I'm new to mushclient and Lua as well.
sending:
/ManaCheck(GetVariable("p_mp_cur") , 320 , Yes ) -- p_mp_cur is Var saved from prompt
My questions:
Is this syntax right ? (def not)
Where is mcheck saved or how I can access it?
I'm trying to create a simple function for comparing spell cost and actual mana. I want it to be accessible in any alias/trigger that I create. I have possible a problem with syntax. I am saving this in a file named "myscript.lua", I'm new to mushclient and Lua as well.
function ManaCheck(actm, scost, command)
if actm > scost then
Send( "command" )
mcheck = "1"
else
mcheck = "0"
end -- for if/
return mcheck
end -- for function
sending:
/ManaCheck(GetVariable("p_mp_cur") , 320 , Yes ) -- p_mp_cur is Var saved from prompt
Run-time error
World: Brutus
Immediate execution
[string "Command line"]:1: attempt to call global 'ManaCheck' (a nil value)
stack traceback:
[string "Command line"]:1: in main chunk
My questions:
Is this syntax right ? (def not)
Where is mcheck saved or how I can access it?