Originally Posted by SnowmanDK
Follow up question:
How do you know what return value is equal to what?
I can't seem to find any tables showing that.
As I can see 9 = ITEMTYPE_TOOL
If I do a
Lua Code:
GetItemType(item.bag, item.slot)
then I just get an integer.
|
You are correct there are several item types that are not used.
You can look on the wiki site under constants here:
http://wiki.esoui.com/Constants_in_100008_API
and search for ITEMTYPE it will take you to a list that shows each item types values.
I don't remember for sure if that is a complete list, but you can create an up to date list by using the following code to grab all of the values of item types
Lua Code:
-- Initialize ItemTypes
local itemTypeTable = {}
for key, value in zo_insecurePairs(_G) do
if (key):find("ITEMTYPE_") and type(value) == "number" then
itemTypeTable [key] = value -- sorts by itemType name
-- or reverse the key & value to sort them by number
itemTypeTable [value ] = key-- sorts by itemType number
end
end
Props to Garkin for showing me this trick it has come in handy MANY times when I wanted to find all possible values of certain types of constants, or even to look for functions with certain words in them to see if a function existed for something I was trying to do
(in case it was not listed on the wiki).