Ok i recently made a new waypoint for farming mobs. I tried to incorporate the simple repair hammer with that.
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
changeProfileOption("MAX_TARGET_DIST", 50)
changeProfileOption("LOOT_DISTANCE", 50)
function WC()
inventory:update()
local hammer = inventory:itemTotalCount(201967);
if ( 100 > inventory:getMainHandDurability() ) then
if hammer > 0 then
cprintf(cli.lightred,"repairing mainhand....");
inventory:useItem(201967);
RoMScript("PickupEquipmentItem(15)");
cprintf(cli.yellow,"done!\n");
inventory:update();
else
cprintf(cli.lightred,"No simple rapair hammers in bag!\n");
--player:clearTarget();
player:sleep();
end
end
end
oldOnLeaveCombat = settings.profile.events.onLeaveCombat
function settings.profile.events.onLeaveCombat()
if oldOnLeaveCombat then
oldOnLeaveCombat()
end
if (not player:hasBuff("506684")) then
inventory:useItem(207200); ------- Unbridled Enthusiasm
end
if (not player:hasBuff("623770")) then
inventory:useItem(241959);end ------- Wedding Food
if (not player:hasBuff("506685")) then
inventory:useItem(207201);end -------- Princely Look
if (not player:hasBuff("506271")) then
inventory:useItem(206874);end ------- Grassland Mix
if (not player:hasBuff("506687")) then -------- Luck Pot
inventory:useItem(207203);end
if (not player:hasBuff("623767")) then ------- Meaningful Love Cake Slice
inventory:useItem(202895);end
end
</onload>
<!-- # 1 --><waypoint x="-9153" z="-15107" y="155"> WC() </waypoint>
</waypoints>
I am facing few problems:
1. It behaves weird when the function is used. For ex- i tried changing the dura value to 108, my wep had dura of 113. Now when i start the waypoint it uses hammer as soon as dura falls to 111 or so. Any idea?
2. I farm mobs which are in combat with each other. If you remember event area near KBN where npc used be in fight with some mobs. So the problem is i can't use Changeprofileoption(MOB). If i do that bot won't target those mobs as they are in combat with npc already.
3. What are the Equipment id for rings necklace and other things?'
EDIT: Tried this, but this didn't work either
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
changeProfileOption("MAX_TARGET_DIST", 50)
changeProfileOption("LOOT_DISTANCE", 50)
oldOnLeaveCombat = settings.profile.events.onLeaveCombat
inventory:update()
local hammer = inventory:itemTotalCount(201967);
if ( 108 > inventory:getMainHandDurability() ) then
if hammer > 0 then
cprintf(cli.lightred,"repairing mainhand....");
inventory:useItem(201967);
RoMScript("PickupEquipmentItem(15)");
cprintf(cli.yellow,"done!\n");
inventory:update();
else
cprintf(cli.lightred,"No simple rapair hammers in bag!\n");
--player:clearTarget();
player:sleep();
end
end
function settings.profile.events.onLeaveCombat()
if oldOnLeaveCombat then
oldOnLeaveCombat()
end
if (not player:hasBuff("506684")) then
inventory:useItem(207200); ------- Unbridled Enthusiasm
end
if (not player:hasBuff("623770")) then
inventory:useItem(241959);end ------- Wedding Food
if (not player:hasBuff("506685")) then
inventory:useItem(207201);end -------- Princely Look
if (not player:hasBuff("506271")) then
inventory:useItem(206874);end ------- Grassland Mix
if (not player:hasBuff("506687")) then -------- Luck Pot
inventory:useItem(207203);end
if (not player:hasBuff("623767")) then ------- Meaningful Love Cake Slice
inventory:useItem(202895);end
end
</onload>
<!-- # 1 --><waypoint x="-9153" z="-15107" y="155"> </waypoint>
</waypoints>