View Single Post
05-20-17, 06:03 AM   #16
Eommus
An Aku'mai Servant
Join Date: Apr 2017
Posts: 34
Originally Posted by Kakjens View Post
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)
Thank you, I will continue from this and see how to get itemlink.

Isn't there a way to directly trigger at CHAT_MSG_LOOT event, rather than checking all events and triggering IF the event is CHAT_MSG_LOOT? I mean your use of if event == my_event.

I checked the eventtrace and noticed that hundreds of events are taking place in a minute, even when your character is just standing still.
  Reply With Quote