Thread Tools Display Modes
03-23-18, 02:20 AM   #1
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
GetItemInfo

Hi guys

I am trying to "peek" at all items dropped (loot messages) and am at the point where I have the item ID from the message, eg " Mïckeyy receives loot: [Thu'rayan Lash]." or "You receive item: [Illidari Shoulders]." and from there I can get item ID:[133318] [01:56:02] [Illidari Shoulders] [660] [Armor] [Leather] [INVTYPE_SHOULDER]

However I have not yet tried it in a party/raid because the documentation of GetItemInfo() says that unless it's in your bags/bank you will not be able to use it.

If this therefore does not work, is there a better way to get information on dropped loot?
  Reply With Quote
03-23-18, 03:00 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
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 GET_ITEM_INFO_RECEIVED fires
12:00:03 local itemName=GetItemInfo(itemID)
12:00:03 itemName now has the item name

Last edited by Kanegasi : 03-23-18 at 03:06 AM.
  Reply With Quote
03-23-18, 09:11 AM   #3
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
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 GET_ITEM_INFO_RECEIVED fires
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

WoWInterface » Developer Discussions » Lua/XML Help » GetItemInfo

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off