getMainHandDurability() not returning dura in % anymore

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

getMainHandDurability() not returning dura in % anymore

#1 Post by Rickster »

Hello,

I just wondered why my scripts make my characters running to the mearchant all the time :D

I set the userprofile to check MainHandDurability after each fight end then decide wether to go to repair or not at 90% of the main hand dura.

some characters are equiped with weapons with over 90 durability e.g. 97/97, and they repair their weapons when dura drops below 90 (absolute value)
others are equiped with weapons with lower dura e.g. 85/85. they alway want to repair, coz they never reach a MainHandDurability over 85 for exsample.

inventory:getMainHandDurability() no more returns the dura in %. It returns the absolute value of the actual dura.
This behaviour seems to be new, since I used the scripts for a long time, but now i run into this prob.

Can we fix this or how do i get the actual dura and the max dura of the mainhand weapon to calculate the durability in %?

Thanx
Ric
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: getMainHandDurability() not returning dura in % anymore

#2 Post by rock5 »

As far as I can see, getMainHandDurability still returns % and hasn't been changed.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: getMainHandDurability() not returning dura in % anymore

#3 Post by Rickster »

I am using this

Code: Select all

dura = inventory:getMainHandDurability()
to get the dura and it returns the actual dura, not % of max dura.
Am I doing somethinig wrong to get the dura?

Can someone please check this also?
I do not know where else I can look at my side for errors :(

Thanx
Ric
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: getMainHandDurability() not returning dura in % anymore

#4 Post by rock5 »

I have an item to test that has durability of 101/105

Code: Select all

Command> print(inventory:getMainHandDurability())
96.590476190476
96.5% is correct. What version of the bot are you using?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: getMainHandDurability() not returning dura in % anymore

#5 Post by Rickster »

actual revision is 744.

using the commandline like you did it returns "74" for a 74/80 item, that should be at 92,5% :(
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: getMainHandDurability() not returning dura in % anymore

#6 Post by rock5 »

All I can think of is maybe you have a userfunction that overwrites that function. Maybe you could try renaming your userfunctions folder temporarily and see if it still does it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: getMainHandDurability() not returning dura in % anymore

#7 Post by Rickster »

I disabled all of my userfunctions and the behaviour is just the same, but i figured out, that this happens only with items, which have a dura below 100.
for dura 100 and above it shows the correct %, otherwise it shows the absolut dura.

I am not sure, if it is exact 100 for making this difference. I tested with a weapon 69/80 and another 111/113.

can you reproduce this on your side?

i am sorry, i can not find the code for this calculation to have a look at it myself.
can you tell me, where to find it?


[edit] found the code for equipment in rom\classes\equipment.lua ... and tried this for

1. mainhand weapon 69/80 which returns the absolut value

Code: Select all

Command> print(equipment:getDurability(15))
69.99
2. ranged weapon 111/113 which returns the % value

Code: Select all

Command> print(equipment:getDurability(10))
98.530973451327
Ric
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: getMainHandDurability() not returning dura in % anymore

#8 Post by rock5 »

I just tried an item with 83/84 dura and got 99% so it worked. I'm at a loss.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: getMainHandDurability() not returning dura in % anymore

#9 Post by Rickster »

hehe, ok ;) ... so lets leave it at this. and thanx for having a look at.
I´ll report, if I can find anything about it.
Post Reply