Page 1 of 1

getMainHandDurability() don't work

Posted: Fri Jan 04, 2013 5:23 am
by solembum05
hi i had a problem with this function (not error) but doesn't work:

Code: Select all

function checkdura()
			local dura = inventory:getMainHandDurability();
			        if 95 > dura 
				        then __WPL:setWaypointIndex(__WPL:findWaypointTag("mech"))
			        end 
                        end
My dagger is 105 so i want to repair when she is under 101 for have bonus, but nothing work, i try to change "95" by an other but don't work too...

An idea? or other function for repair ?

Re: getMainHandDurability() don't work

Posted: Fri Jan 04, 2013 6:32 pm
by lolita
maybe cose

Code: Select all

105/100=1.05
95*1.05=99.75 -- Low Dura
but
96*1.05=100.8 -- High Dura
try

Code: Select all

function checkdura()
	if ( 96 > inventory:getMainHandDurability() ) then 
		__WPL:setWaypointIndex(__WPL:findWaypointTag("mech"))
	end
end

Re: getMainHandDurability() don't work

Posted: Sat Jan 05, 2013 3:05 pm
by solembum05
thx !!! Work perfectly ;)