Page 1 of 1

inventory:getMainHandDurability() not working since updates

Posted: Wed Aug 11, 2010 6:27 pm
by althalos
I updated to the 8/10/10 RoM patch and got the newest rombot revision via SVN. Now I can't retrieve the durability of my main hand weapon.

Here's my code on leaving combat:

Code: Select all

<onLeaveCombat>
		-- Additional Lua code to execute after killing an enemy
			printf("\nCurrent Stats:\n");
			printf("---------------------------\n\n");
			printf("Health:%s\n", player.HP);
			local dura = inventory:getMainHandDurability();
			printf("Weapon Durability:%s\n", dura);
			if (0.55 > dura) then
			player:update();
			__WPL:setForcedWaypointType("TRAVEL");
			loadPaths("Ystra Frostwood Cyclops Exit.xml");
			__WPL:setForcedWaypointType("TRAVEL");
			end; 
			local poti = inventory:itemTotalCount("Crystal Mana Medicine");
			printf("Mana Potions:%s\n\n", poti);
			if (11 > poti) then
			player:update();
			__WPL:setForcedWaypointType("TRAVEL");
			loadPaths("Ystra Frostwood Cyclops Exit.xml");
			__WPL:setForcedWaypointType("TRAVEL");
			end;			
	</onLeaveCombat>

And here's the error message I receive on rombot:

Code: Select all

Use 8: PRIEST_CHAIN_OF_LIGH=>   * Failed to cast *
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (2053/3130)
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (2053/3130)
Use 8: PRIEST_CHAIN_OF_LIGH=>   Frostwood Valley Cyclops (1223/3130)
Use 3: PRIEST_RISING_TIDE  =>   * Failed to cast *
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (917/3130)
Use 8: PRIEST_CHAIN_OF_LIGH=>   * Failed to cast *
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (408/3130)
Use 6: PRIEST_REGENERATE   =>   Frostwood Valley Cyclops (0/3130)
Fight finished. Killed 1 Frostwood Valley Cyclops. (fight #1 / runtime 0 minutes
)

Current Stats:
---------------------------

Health:831
...s of Magic/micromacro/scripts/rom/classes/player.lua:1069: Error in your prof
ile: onLeaveCombat error: ...f Magic/micromacro/scripts/rom/classes/inventory.lu
a:244: attempt to perform arithmetic on field 'MaxDurability' (a nil value)
Any ideas would be greatly appreciated. Thanks.

Re: inventory:getMainHandDurability() not working since upda

Posted: Wed Aug 11, 2010 11:53 pm
by rock5
althalos wrote:I updated to the 8/10/10 RoM patch and got the newest rombot revision via SVN. Now I can't retrieve the durability of my main hand weapon.

Here's my code on leaving combat:

Code: Select all

<onLeaveCombat>
		-- Additional Lua code to execute after killing an enemy
			printf("\nCurrent Stats:\n");
			printf("---------------------------\n\n");
			printf("Health:%s\n", player.HP);
			local dura = inventory:getMainHandDurability();
			printf("Weapon Durability:%s\n", dura);
			if (0.55 > dura) then
			player:update();
			__WPL:setForcedWaypointType("TRAVEL");
			loadPaths("Ystra Frostwood Cyclops Exit.xml");
			__WPL:setForcedWaypointType("TRAVEL");
			end; 
			local poti = inventory:itemTotalCount("Crystal Mana Medicine");
			printf("Mana Potions:%s\n\n", poti);
			if (11 > poti) then
			player:update();
			__WPL:setForcedWaypointType("TRAVEL");
			loadPaths("Ystra Frostwood Cyclops Exit.xml");
			__WPL:setForcedWaypointType("TRAVEL");
			end;			
	</onLeaveCombat>

And here's the error message I receive on rombot:

Code: Select all

Use 8: PRIEST_CHAIN_OF_LIGH=>   * Failed to cast *
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (2053/3130)
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (2053/3130)
Use 8: PRIEST_CHAIN_OF_LIGH=>   Frostwood Valley Cyclops (1223/3130)
Use 3: PRIEST_RISING_TIDE  =>   * Failed to cast *
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (917/3130)
Use 8: PRIEST_CHAIN_OF_LIGH=>   * Failed to cast *
Use 3: PRIEST_RISING_TIDE  =>   Frostwood Valley Cyclops (408/3130)
Use 6: PRIEST_REGENERATE   =>   Frostwood Valley Cyclops (0/3130)
Fight finished. Killed 1 Frostwood Valley Cyclops. (fight #1 / runtime 0 minutes
)

Current Stats:
---------------------------

Health:831
...s of Magic/micromacro/scripts/rom/classes/player.lua:1069: Error in your prof
ile: onLeaveCombat error: ...f Magic/micromacro/scripts/rom/classes/inventory.lu
a:244: attempt to perform arithmetic on field 'MaxDurability' (a nil value)
Any ideas would be greatly appreciated. Thanks.
I don't see any mention of MaxDurability in CItem:update(). I think it's just a value they missed in the new inventory system. I suspect Voidmain will fix it soon after seeing this post.

Re: inventory:getMainHandDurability() not working since upda

Posted: Thu Aug 12, 2010 7:40 am
by VoidMain
Fixed now, update from SVN.

Re: inventory:getMainHandDurability() not working since upda

Posted: Thu Aug 12, 2010 4:37 pm
by althalos
Much appreciated. Works beautifully.

Re: inventory:getMainHandDurability() not working since upda

Posted: Sat Aug 14, 2010 10:29 am
by salient
The mainhand durability seems to be returning as a ##.###### string instead of the 0.####### that it used to. I fixed the problem by changing the flag in my profile to flip at 90 instead of 0.9

Just throwing that out there for anyone else who runs into this change and isn't sure what happened.