"Projectile or Arrow" rom API function
"Projectile or Arrow" rom API function
How do i check if an item is a Projectile or an Arrow with RoM API (ingame macro)?
Re: "Projectile or Arrow" rom API function
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:
the digits are the itemids
hope that helps.
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
hope that helps.
Re: "Projectile or Arrow" rom API function
kkulesza wrote:RoM API (ingame macro)?
ahh i just noticed, you don't want to use rombot. So this solution is useless for you
Re: "Projectile or Arrow" rom API function
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:
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/
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")
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/
Who is online
Users browsing this forum: No registered users and 2 guests