WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   GetItemInfo (https://www.wowinterface.com/forums/showthread.php?t=56118)

doofus 03-23-18 02:20 AM

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?

Kanegasi 03-23-18 03:00 AM

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

doofus 03-23-18 09:11 AM

Quote:

Originally Posted by Kanegasi (Post 327327)
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...


All times are GMT -6. The time now is 03:48 PM.

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