"Projectile or Arrow" rom API function

Talk about anything in Runes of Magic. This does not need to pertain to botting.
Post Reply
Message
Author
kkulesza
Posts: 150
Joined: Fri May 27, 2011 9:00 pm
Location: Poland

"Projectile or Arrow" rom API function

#1 Post by kkulesza » Tue Dec 18, 2012 9:42 am

How do i check if an item is a Projectile or an Arrow with RoM API (ingame macro)?

User avatar
Rintintin
Posts: 55
Joined: Tue Jan 01, 2013 7:45 am
Location: Germany

Re: "Projectile or Arrow" rom API function

#2 Post by Rintintin » Tue Jan 01, 2013 8:22 am

The only idea i have is to put all available ammo items in a table and check against this table wheter an item is an arrow or something knifelike.

here is a very short example, of wehat i mean:

Code: Select all

function getAmmoType(_itemid)
ammotype={}
table.insert(ammotype,210295,"thrown");
table.insert(ammotype,210306,"arrow");

  if type(_itemid) == "number" then
   return ammotype[_itemid];
 end
end
the digits are the itemids
hope that helps.

User avatar
Rintintin
Posts: 55
Joined: Tue Jan 01, 2013 7:45 am
Location: Germany

Re: "Projectile or Arrow" rom API function

#3 Post by Rintintin » Tue Jan 01, 2013 8:27 am

kkulesza wrote:RoM API (ingame macro)?

ahh i just noticed, you don't want to use rombot. So this solution is useless for you :roll:

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: "Projectile or Arrow" rom API function

#4 Post by Jandrana » Fri Jan 04, 2013 10:51 am

There is no Rom API function for this, as far as I know.

But if you like to use it in a macro you can use something like this:

Code: Select all

function isAmmo(bagIndex)
  return
    string.find(GetBagItemLink(GetBagItemInfo(bagIndex)),"Arrow") > 0 
    or 
    string.find(GetBagItemLink(GetBagItemInfo(bagIndex)),"Projectile") > 0 
end;

SendChatMessage(tostring(isAmmo(1)),"SAY")
It is not perfect. If an item should have "Arrow" or "Projectile" in its regular name, it will also return true.
For a perfect solution, you need to parse the ItemLink. Look into the source of Lootomatic for this.

Use IGSC to define the function. Then you can use it in a macro with: /igs Script1
http://rom.curseforge.com/addons/ingamescripts/

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests