lisa wrote:
You are pretty close
use this instead of the dura check you use.
also you need to target the equipment slot to make it use the hammer, can't think of that code off hand.
Code: Select all
<onLeaveCombat>
local dura = inventory:getMainHandDurability();
printf("Durability:%s\n", dura);
if ( 90 > dura ) then
inventory:useItem("Simple Repair Hammer");
-- add in click main weapon here
end
</onLeaveCombat>
Really? I'm using < and it works just fine.
Using the greater or lesser than symbol directly gives me a phasing profile error. I believe it's due to the fact the greater symbol is being perceived or read as a close/open bracket as in </onLeaveCombat>
lisa wrote:
also you need to target the equipment slot to make it use the hammer, can't think of that code off hand.
This is the bit that has been driving me nuts.
lisa wrote:
I think use would be right click, so that prob wouldnt work. I would go with pickup item.
Would be a good idea to add in a check to make sure icon has changed before using that code, you don't really want to pick up your weapon.
Already ahead of you on that one. I knew I was close a couple of days ago when I got the mouse icon to change to a repair hammer but then the bot would halt due to my trial by error codng or nothing at all.
rock5 wrote:I think it's UseEquipmentItem or PickupEquipmentItem
or
Code: Select all
RoMScript("PickupEquipmentItem(16)")
I'm not 100% sure it's 16 though. I think it's 15 in the game.
I'll give this a try later and you know how things turn out but your right, it is slot 16 for the mainhand. I believe 17 is the offhand.
Much appreciate both your inputs.