Page 1 of 1

Check Item Durability

Posted: Fri Jan 27, 2012 7:31 am
by MustHave
Hi there,

tried to search for it but couldn't find any topic which could help me out.
I'm searching for a possibility to check the durability a of equipped Item .

I only found getMainhandDurability(). Is there any similar like getItemDurability(10)
where 10 stands for the slot I want to check?

Kind regards and a thousand of apologizes if there are topics I wasn't able to find.

Re: Check Item Durability

Posted: Fri Jan 27, 2012 7:41 am
by rock5
Sometimes it helps to look at the files themselves. If you look at "inventory:getMainHandDurability" which is in "inventory.lua" you will see that it just has one line

Code: Select all

return inventory:getDurability( 16 );		-- 16=Main Hand
So, yes you can use

Code: Select all

inventory:getDurability(10)
to get the durability of equiped slot 10.

Note: I think in game uses different equipment slot numbers than the bot, so make sure you test the slot number.

Re: Check Item Durability

Posted: Fri Jan 27, 2012 7:56 am
by MustHave
Thank you very much rock5.
As always I didn't thought to do the easiest thing - check what I already have :lol:
Will think about your hint the next time.