WoWInterface - View Single Post - GetItemInfo
Thread: GetItemInfo
View Single Post
03-23-18, 09:11 AM   #3
A Flamescale Wyrmkin
Join Date: Feb 2018
Posts: 126
Originally Posted by Kanegasi View Post
Only if you use the item name. If you plug the itemID into GetItemInfo, you will get the info, but if you donít have the item, you will initially not get info. Listen for the GET_ITEM_INFO_RECEIVED event and plug the first return back into GetItemInfo (which is the itemID you received the info for) and youíll get the returns.

Hereís a short timeline of what I mean:

12:00:01 Loot message
12:00:01 local itemName=GetItemInfo(itemID)
12:00:01 itemName is nil
12:00:03 local itemName=GetItemInfo(itemID)
12:00:03 itemName now has the item name
Because item levels are not unique, I think it might work like this.

Say we are interested in the item level. We receive a loot message, we get the item string and from that calling GetItemInfo(itemString) returns all the information, including the ilvl.

Supposing we get nils, now we then wait for GET_ITEM_INFO_RECEIVED which sends us only the itemID so I assume that now I can call GetItemInfo(itemString) and will see the information. And I assume that since the GET_ITEM_INFO_RECEIVED carries only the itemID and no other parameters it tells me that it has updated my client on ALL possible variations of this itemID.

Have not tried it yet...
  Reply With Quote