|
Post by me3you2 on Dec 19, 2005 21:33:14 GMT -5
I was board and the one thing that I always wanted was a simple calculator in FFXI. So I made one. It can +,-,*,/
function GetArguments() ArgArray = {} ArgCount=Windower.script_GetArgCount( ) for arg=1,ArgCount,1 do ArgArray[arg] = Windower.script_GetArg(arg) Windower.script_Sleep(50) end table.remove(ArgArray , 1) end
function CheckArgument(ThisArray) if table.getn(ThisArray) >=3 then var1=ThisArray[1] var2=ThisArray[3] if ThisArray[2] == '+' then wprint(var1+var2) end if ThisArray[2] == '-' then if var2 >= var1 then wprint(var1 - var2) else wprint(var2 - var1) end if ThisArray[2] == '*' then wprint(var1 * var2) end if ThisArray[2] == '/' then wprint(var1 / var2) end end end
function wprint (text) Windower.console_Write(text) end
GetArguments() CheckArgument(ArgArray)
to use just type ".Lunar load math.lua 1 + 1" it will out put it to the console.
|
|