Page 1 of 1

Function Error

Posted: Tue Aug 18, 2009 8:26 am
by master121
I want to add a function : GetInventoryItemDurable("player", index)
When i use that as a macro it works without problems :/
Try

Code: Select all

/script curD,maxD,itemName,curDfull,maxDfull = GetInventoryItemDurable("player", 15)
/script DEFAULT_CHAT_FRAME:AddMessage(curD)
It will show the current durability of your weapon.
I want to use that in MicroMacro.
So i did this :

Code: Select all

<!-- # 1 --><waypoint x="-11675" z="-2596">
          GetDurability()
</waypoint>
In the functions.lua i added this.

Code: Select all

function GetDurability()
local curD,maxD,itemName,curDfull,maxDfull = GetInventoryItemDurable("player", 15)
local percentD = math.ceil((curD/maxD)*1000)/10
printf("Wapon 1 Durability = ");
printf(percentD);
if( percentD <= 50 ) then
   load_paths( "repair.xml");
end
end;
Actually im not very good in lua and this code is maybe improvable but it doesn´t work.
I get this error : scripts\rom\functions.lua attempt to call global "GetInventoryItemDurable" <a nil value>

Re: Function Error

Posted: Tue Aug 18, 2009 8:34 am
by Administrator
MicroMacro does not import functions from RoM. And even if it did, they would still be in separate processes, meaning the data still wouldn't be (easily) accessible. Therefor, you cannot use RoM API functions inside your MicroMacro scripts.

Re: Function Error

Posted: Tue Aug 18, 2009 8:38 am
by master121
Thanks for that info ..
Then i have to find another way to get the durability...
Maybe with cheat engine find a pointer
No way to find a pointer :(

Re: Function Error

Posted: Tue Aug 18, 2009 8:51 am
by droppen
master121 wrote:Thanks for that info ..
Then i have to find another way to get the durability...
Maybe with cheat engine find a pointer
No way to find a pointer :(
if you can get the offsets for anything new, durability, item info, anything, that would be great!