Thread Tools Display Modes
04-08-14, 10:35 AM   #1
Haegr
A Murloc Raider
Join Date: Apr 2014
Posts: 4
API Reference for looted item

I'm new to the API, brand new - this is the first addon I've ever bothered to try to create.

I'm crawling through the API but I can't find what I need so I figured I'd ask here.

First what I am trying to write; an addon that tells me what I have prospected / disenchanted. So I need to find the item I have just prospected / disenchanted as well as the addons that I have just looted from what I just prospected / disenchanted.

Any help / a point in the right direction would be fantastic.

Thanks.
  Reply With Quote
04-08-14, 02:59 PM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I would say you'll have to monitor an event that fires if you disenchant something or prospect something. I have no idea which are the proper events. But there are a least two ways to find it out:

1. Look at http://wowprogramming.com/docs/events for the events.

2. Or create a test frame and try RegisterAllEvents (http://wowprogramming.com/docs/widge...isterAllEvents). Then disenchant/prospect something and see which events are fireing.
  Reply With Quote
04-08-14, 03:14 PM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,362
There's an default tool for tracing events /eventtrace or /etrace
  Reply With Quote
04-08-14, 04:37 PM   #4
Haegr
A Murloc Raider
Join Date: Apr 2014
Posts: 4
/etrace helped me find the events I was looking for but none of them have given me the quantity of the item I am receiving, nor an ID it seems.
  Reply With Quote
04-08-14, 05:19 PM   #5
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
Often times, events just let you know when information is available. That being said, I've never tried to attempt what you are doing. If the events associated with DEing items don't return amounts and such, you may be able to filter chat events.

I know amounts DEed/prospected are printed to chat; you could pattern match chat to get the values.

That's off of the top of my head. I am sure someone knows a better way.
  Reply With Quote
04-08-14, 05:33 PM   #6
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by Dridzt View Post
There's an default tool for tracing events /eventtrace or /etrace
Wow. Never heared of it. Thanks.
  Reply With Quote
04-08-14, 09:19 PM   #7
Cybeloras
A Fallenroot Satyr
 
Cybeloras's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 28
Use UNIT_SPELLCAST_SUCCEEDED to determine when you have cast disenchant or prospect: http://wowprogramming.com/docs/event...CAST_SUCCEEDED
Use ITEM_LOCK_CHANGED to determine what item was targeted: http://wowprogramming.com/docs/events/ITEM_LOCK_CHANGED
Use the loot API to figure out what you have received: http://wowprogramming.com/docs/api_categories#loot

Last edited by Cybeloras : 04-08-14 at 09:26 PM.
  Reply With Quote
04-09-14, 12:41 AM   #8
Haegr
A Murloc Raider
Join Date: Apr 2014
Posts: 4
I looked at the loot API before Cybeloras but I don't know how it will perform when I am autolooting and there doesn't seem to be any method to return a count of a stacked item, just total items to be looted - unless GetNumLootItems is per slot, which it probably is.

I may actually just use the "GetItemInfo" method and count up all the known items when logging in and when logging out, which would suit my needs.

Thanks for all the help.

Last edited by Haegr : 04-09-14 at 12:43 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » API Reference for looted item


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