Page 1 of 1
New Functions
Posted: Tue Sep 01, 2009 7:07 am
by master121
I would like to know how i can use the new functions in my waypoints.
Like Inventory:getMainHandDurability() but this doesn´t work.
And i recommend to make a threat in which the new functions are explained
Re: New Functions
Posted: Tue Sep 01, 2009 7:20 am
by Administrator
The inventory functions are still developmental, so you can expect problems. After a quick look at the function, it looks like return value is actually a ratio. 0 would be broken, and 1 would be full durability remaining. Perhaps this is your problem?
Oh, also, you should be using
Code: Select all
CInventory:getMainHandDurability();
Make sure the C is in there.
You'll also need to set up a macro for the new macro system. Open your macro screen with /macro. The first two slots will be used by the bot. Create a new, empty macro in the top left slot, and move it to your hotkey bar. Then set
Code: Select all
<hotkey name="MACRO" key="VK_0" />
in the hotkeys section of your profile (where 0 is your actual hotkey). You can leave the second one blank, but do
not leave a macro you wish to keep there.
Re: New Functions
Posted: Tue Sep 01, 2009 7:24 am
by master121
Ahh okay atm i use this ....
Code: Select all
local durability, durabilityMax = RoMScript("GetInventoryItemDurable('player', 15);");
a = durability/durabilityMax;
if( a < 0.99 ) then
printf("low")
end
but i get an error with this Oo
if( a < 0.99 )
okay got it :
Seems micromacro has a problem with "<" ...
Code: Select all
if( a >= 0.51 ) then
else
printf("low")
end
Re: New Functions
Posted: Tue Sep 01, 2009 7:41 am
by Administrator
Yes. You cannot use the '<' character inside of an XML tag like that because it confuses the XML parser. It can't tell the difference between you using it as a less-than sign in code or opening a new XML tag. You should use '<' instead of '<'.