I want to loot a given number of corpses.
For this I created the following alias:
The script looks like this:
I am getting the following scripting error:
[string "Script file"]:45: attempt to compare number with string
stack traceback:
[string "Script file"]:45: in function <[string "Script file"]:43>
Line 43 is the function name -> function loot(x)
Line 45 is the while loop -> while i <= x
How do I make sure that the passed variable, x, is interpreted as a number? I tried around with the tonumber() function but didn't get it to work.
Please help
For this I created the following alias:
<alias
script="loot"
match="loot *"
enabled="y"
group="exploring"
regexp="y"
send_to="12"
sequence="100"
>
<send>%1</send>
</alias>
The script looks like this:
function loot(x)
local i=1
while i <= x
do
Send("get all from @i. corpse")
i=i+1
end -- do
end -- loot
I am getting the following scripting error:
[string "Script file"]:45: attempt to compare number with string
stack traceback:
[string "Script file"]:45: in function <[string "Script file"]:43>
Line 43 is the function name -> function loot(x)
Line 45 is the while loop -> while i <= x
How do I make sure that the passed variable, x, is interpreted as a number? I tried around with the tonumber() function but didn't get it to work.
Please help