Originally Posted by Eommus
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:
local my_event = "CHAT_MSG_LOOT"
local f = CreateFrame('Frame')
f:RegisterEvent(my_event)
f:SetScript('OnEvent', function(self, event, arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11, ...)
if event == my_event then
print("arg1=",arg1,"arg2=",arg2,"arg3=",arg3,"arg4=",arg4,"arg5=",arg5)
print("arg6=",arg6,"arg7=",arg7,"arg8=",arg8,"arg9=",arg9,"arg10=",arg10)
print("arg11=",arg11)
end
end)