how to get the type of an item?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

how to get the type of an item?

#1 Post by Rickster »

there is a function to compare the type of an item to a string, which returns a boolean:

Code: Select all

item:isType("xxx")
is there a way to get the type of an item?

i tried these, which both do not work

Code: Select all

item:getType()
item.Type
is there a place i can find informations like that?
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: how to get the type of an item?

#2 Post by lisa »

item:isType is a function in micromacro/rom/classes/item.lua

Code: Select all

function CItem:isType(typename)
there is also this

Code: Select all

function CItem:getTypes()
which you would use like this.

Code: Select all

for slot, item in pairs(inventory.BagSlot) do
local itemtype, itemsubtype, itemsubsubtype = item:getTypes()
--some code stuff here to use the info
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Post Reply