Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-20-17, 03:36 AM   #9
Kakjens
A Cliff Giant
Join Date: Apr 2017
Posts: 75
Originally Posted by Eommus View Post
Thank you. It looks using CHAT_MSG_LOOT is more efficient than using BAG_UPDATE. I would assume, CHAT_MSG_LOOT is fired for any type of item acquisition. I will study how CHAT_MSG_LOOT works and try to use it instead.
You'll need to verify that the one due to whom is the event was your character (not party member - gamepedia article has info how to do it), and it's a item receive event (not, for example, selecting need/greed/pass/DE - gamepedia article doesn't disclose it but checking the OnEvent variables should make it possible).
Test it, with, for example, this:
Lua Code:
  1. local my_event = "CHAT_MSG_LOOT"
  2. local f = CreateFrame('Frame')
  3. f:RegisterEvent(my_event)
  4. f:SetScript('OnEvent', function(self, event, arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11, ...)
  5.     if event == my_event then
  6.         print("arg1=",arg1,"arg2=",arg2,"arg3=",arg3,"arg4=",arg4,"arg5=",arg5)
  7.         print("arg6=",arg6,"arg7=",arg7,"arg8=",arg8,"arg9=",arg9,"arg10=",arg10)
  8.         print("arg11=",arg11)
  9.     end
  10. end)
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Logging the item my character acquired


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