Not sleeping well tonight. Other than that... had this happen:
Code: Select all
Did not find any crashed game clients.
4:49am - ...Desktop/micromacro/scripts/rom/classes/player.lua:1803: Error
in your profile: onLeaveCombat error: ...Desktop/micromacro/scripts
/rom/functions.lua:756: bad argument #1 to 'memoryReadByte' ((null))
I guess that's my fault? Too much going on in my onLeaveCombat code?
Code: Select all
<onLeaveCombat><![CDATA[
if inventory:itemTotalCount(0) == 0 then
__WPL:setWaypointIndex(__WPL:findWaypointTag("sell"));
end
if inventory:itemTotalCount("Arrowhead Carved with Name") > 499 then
__WPL:setWaypointIndex(__WPL:findWaypointTag("sell"));
end
GuildDonate();
CheckLP();
-- Additional Lua code to execute after killing an enemy
catchCavy(cavy);
if player:findNearestNameOrId("Mysterious Bag") and inventory:itemTotalCount(0) ~= 0 then
player:target_Object("Mysterious Bag")
yrest(500) -- If not enough time to pick up bag, increase it.
player:target_Object("Mysterious Bag")
yrest(500)
elseif inventory:itemTotalCount(0) == 0 then
__WPL:setWaypointIndex(__WPL:findWaypointTag("sell"));
end
local dura = inventory:getDurability(1);
printf("Head durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(1)");
end
local dura = inventory:getDurability(0);
printf("Head durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(0)");
end
local dura = inventory:getDurability(16);
printf("Main hand durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(16)");
end
local dura = inventory:getDurability(2);
printf("Hands durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(2)");
end
local dura = inventory:getDurability(3);
printf("Feet durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(3)");
end
local dura = inventory:getDurability(4);
printf("Chest durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(4)");
end
local dura = inventory:getDurability(5);
printf("Chest durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(5)");
end
local dura = inventory:getDurability(6);
printf("Cloak durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(6)");
end
local dura = inventory:getDurability(7);
printf("Belt durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(7)");
end
local dura = inventory:getDurability(8);
printf("Shoulders durability:%s\n", dura);
if ( 90 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(8)");
end
local dura = inventory:getDurability(9);
printf("Necklace durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(9)");
end
-- Repair Ranged
local dura = inventory:getDurability(10);
printf("Head durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(10)");
end
local dura = inventory:getDurability(11);
printf("Ranged Weapon durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(11)");
end
local dura = inventory:getDurability(12);
printf("Ring Left durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(12)");
end
local dura = inventory:getDurability(13);
printf("Ring Right durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(13)");
end
local dura = inventory:getDurability(14);
printf("Earring Left durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(14)");
end
-- Repair main hand
local dura = inventory:getMainHandDurability(15);
printf("Earring Right durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(15)");
end
local dura = inventory:getDurability(17);
printf("Off hand durability:%s\n", dura);
if ( 95 > dura ) then
inventory:useItem("Simple Repair Hammer");
RoMScript("PickupEquipmentItem(17)");
end
if (not player:hasBuff("506690")) then
inventory:useItem(207206);
end
]]></onLeaveCombat>
Oh, and now I see it alluding to line 756 of the functions.lua but I have no idea what all this means:
Code: Select all
while( memoryReadByte(getProc(), macro_address + addresses.macroSize *(resultMacro - 1) + addresses.macroBody_offset) == 6 ) do
if( deltaTime(getTime(), startWaitTime) > 800 ) then
if settings.options.DEBUGGING then
printf("0x%X\n", addresses.editBoxHasFocus_address)
end
if memoryReadUInt(getProc(), addresses.editBoxHasFocus_address) == 0 then
keyboardPress(settings.hotkeys.ESCAPE.key); yrest(500)
if RoMScript("GameMenuFrame:IsVisible()") then
-- Clear the game menu and reset editbox focus
keyboardPress(settings.hotkeys.ESCAPE.key); yrest(300)
RoMCode("z = GetKeyboardFocus(); if z then z:ClearFocus() end")
end
end
tryagain = true
break
end;
rest(1);
end