Whenever the bot tries to run this code, it generates an error (see below). Basically, with this code, I am checking my inventory every time I kill an enemy to check to see if it is full. I don't entirely know why the error is ocurring. Should I change "50" to 50, or is there anything else I need to change?
<onLeaveCombat><![CDATA[
-- Additional Lua code to execute after killing an enemy
if(sendMacro("GetBagCount();") > "50") then
inventory:update();
end
if(sendMacro("GetBagCount();") == "60") then
loadPaths("boarstomerch.xml");
end
]]>
</onLeaveCombat>
Tue Jan 26 17:37:55 2010 : ...micromacro/scripts/rom/classes/player.lua:804: Error in your profile: onLeaveCombat error: [string "..."]:3: attempt to compare string with number
Tue Jan 26 17:37:55 2010 : Execution error: Runtime error
giantenigma wrote:Whenever the bot tries to run this code, it generates an error (see below). Basically, with this code, I am checking my inventory every time I kill an enemy to check to see if it is full. I don't entirely know why the error is ocurring. Should I change "50" to 50, or is there anything else I need to change?
<onLeaveCombat><![CDATA[
-- Additional Lua code to execute after killing an enemy
if(sendMacro("GetBagCount();") > "50") then
inventory:update();
end
if(sendMacro("GetBagCount();") == "60") then
loadPaths("boarstomerch.xml");
end
]]>
</onLeaveCombat>
Tue Jan 26 17:37:55 2010 : ...micromacro/scripts/rom/classes/player.lua:804: Error in your profile: onLeaveCombat error: [string "..."]:3: attempt to compare string with number
Tue Jan 26 17:37:55 2010 : Execution error: Runtime error
Thanks in advance!
I am not good at programming but this code will must work.
<onLeaveCombat>
-- Additional Lua code to execute after killing an enemy
if(sendMacro("GetBagCount();") > 50) then
inventory:update();
end
if(sendMacro("GetBagCount();") == 60) then
loadPaths("boarstomerch.xml");
end
</onLeaveCombat>
There could always be, that you get a wrong value back from the "sendMacro" function. e.g. if you press/hold a key while the bot try to press the macro key. So you should be prepared for getting back all kind of values string/nil/numbers and check internaly if it's a valid value.