Function Error

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
master121
Posts: 45
Joined: Mon Dec 29, 2008 10:40 am

Function Error

#1 Post by master121 » Tue Aug 18, 2009 8:26 am

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>

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Function Error

#2 Post by Administrator » Tue Aug 18, 2009 8:34 am

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.

master121
Posts: 45
Joined: Mon Dec 29, 2008 10:40 am

Re: Function Error

#3 Post by master121 » Tue Aug 18, 2009 8:38 am

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 :(

User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

Re: Function Error

#4 Post by droppen » Tue Aug 18, 2009 8:51 am

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!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Semrush [Bot] and 5 guests