ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Identifying items - different methods? (https://www.esoui.com/forums/showthread.php?t=1297)

DerVagabund 05/01/14 03:11 AM

Identifying items - different methods?
 
Hello,

currently I use item names in order to recognize items - but this is not very well suited for different languages because of different translations. Is there another way how to identify item without using the name? As for the documentation of API functions I did not find any method that gives me an ID for a given item, except the lootid, which is per session and not unique to special items. What I would like to have would be at least for crafting mats an id I can use instead of the material name.

I am open for any suggestions :)

Thanks,
best regards,
DV

Garkin 05/01/14 03:20 AM

Lua Code:
  1. local link = GetItemLink(bagId, slotId)
  2. local itemID = select(4,ZO_LinkHandler_ParseLink(link))

BTW you can find itemIDs on Esohead - it is the number in URL:
http://www.esohead.com/items/23103.

DerVagabund 05/01/14 04:48 AM

Ah, so these are the correct values? I already wrote a programm to mine esohead data :rolleyes: but I was not sure if that data is accurate.

But thanks for the tip to parse the link - didn't know there as a function provided.

Is there a list of these ZO_xx functions somewhere?

lyravega 05/01/14 05:18 AM

Use Zgoo add-on. You can browse through... pretty much anything. Wish we had those .lua files in the 000.dat though...

Sharlikran 05/01/14 11:42 AM

Is there a way to get the item link from just the ItemID?
Lua Code:
  1. local link = GetLink(ItemID)
That is totally made up, but is there one that will do that?

Iyanga 05/01/14 11:53 AM

Quote:

Originally Posted by Sharlikran (Post 6613)
Is there a way to get the item link from just the ItemID?
Lua Code:
  1. local link = GetLink(ItemID)
That is totally made up, but is there one that will do that?

No, because an itemId is just an id for an item template, not an id for an instance of an item. You can have multiple items with the same itemId in your bagpack.

ingeniousclown 05/01/14 12:29 PM

Quote:

Originally Posted by Iyanga (Post 6615)
No, because an itemId is just an id for an item template, not an id for an instance of an item. You can have multiple items with the same itemId in your bagpack.

You say that, but an item's "itemInstanceId" is also the same for the same items.

ins 05/01/14 12:42 PM

itemID + Enchant = ItemName
itemID + itemQuality 49/50 = ItemName (Unique/Named items)


This is what I use to get some item info.


Lua Code:
  1. -- strip the gear and return a lot of stuff that was asked...
  2. local function stripGear(itemLoc)
  3.         local itemFILTER= GetItemFilterTypeInfo(1, itemLoc)  -- 1/2 weapon/Apparel
  4.         local itemTRAIT = GetItemTrait(1,itemLoc)
  5.         local itemTYPE  = GetItemType(1,itemLoc)
  6.         local link = GetItemLink(1, itemLoc)   
  7.        
  8.         local name,col,typID,id,qual,levelreq,enchant,ench1,ench2,un1,un2,un3,un4,un5,un6,un7,un8,un9,style,un10,bound,charge,un11=ZO_LinkHandler_ParseLink(link)
  9.         local icon,stack,sellprice,meets,locked,equiptype,itemstyle,quality = GetItemInfo(1,itemLoc)
  10.         -- whinstone, a02ef7, item, 45159, 5,   36,  26848,  5, 36,  0,   0,  0,  0,  0,  0,  0,  0,  0,  6,    0,    0,   368,   0
  11.         --   name      color, type,  id,  qual, lvl,  ench, str, str,un1,un2,un3,un4,un5,un6,un7,un8,un9,style,un10,bound,charge, un11
  12.     if insJY.SVG.debug == true then
  13.         d(link)
  14.         d("Texture: "..tostring(icon))
  15.         d("Itemname: "..tostring(name))
  16.         d("Type: "..GetString("SI_ITEMTYPE",itemTYPE).. " - Filter: "..GetString("SI_ITEMFILTERTYPE", itemFILTER))
  17.         d("ID: "..tostring(id))
  18.  
  19.         d(qual)
  20.         local colour=QualCol(quality)
  21.         d("Quality: "..tostring("|c"..colour.." - "..qual.." - "..quality))
  22.  
  23.         if tonumber(itemTRAIT)>0 then
  24.             d("Trait: "..tostring(itemTRAIT).."-"..GetString("SI_ITEMTRAITTYPE",itemTRAIT))
  25.         end
  26.         d("Bound: "..tostring(bound))
  27.         -- weapon/armor related
  28.         if itemFILTER==ITEMFILTERTYPE_ARMOR or itemFILTER==ITEMFILTERTYPE_WEAPONS then
  29.                 d("Level Required: "..tostring(levelreq))
  30.                 d("Enchant: "..tostring(enchant).. " - Strenght: "..tostring(ench1).."-"..tostring(ench2))
  31.                 d("Style: "..tostring(style).. " - "..GetString("SI_ITEMSTYLE", style))
  32.         end
  33.         -- weapon related
  34.         if itemFILTER==ITEMFILTERTYPE_WEAPONS then
  35.                 d("Charges: "..tostring(charge))
  36.         end
  37.     end
  38.        
  39.     return name,tonumber(id),tonumber(quality),tonumber(sellprice),tonumber(levelreq),enchant,tonumber(style),tonumber(bound),tonumber(itemFILTER),tonumber(itemTRAIT),tonumber(itemTYPE)
  40. end


All times are GMT -6. The time now is 11:26 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI