View Single Post
03/02/14, 04:21 PM   #10
Son of a Sailor
Join Date: Feb 2014
Posts: 7
Hmm, still having issues. I may just be doing something dumb again, but for now I'll just enjoy the rest of the beta and try again later. Once we get closer to release hopefully there'll be more documentation and tutorials.

Lua Code:
  1. local cs = CHAT_SYSTEM
  2. local em = GetEventManager()
  3.  
  4. local function p(str)
  5.     cs:AddMessage(str)
  6. end
  7.  
  8. local function New()
  9.     local addonName = "XPTracker"
  10.     OnLoad()
  11. end
  12.    
  13. local function OnLoad()
  14.     em:RegisterForEvent(EVENT_EXPERIENCE_GAIN, function(...) OnXPGain(...) end)
  15.    
  16. end
  17.  
  18. local function OnXPGain(...)
  19.     local eventCode, value, reason = ...
  20.     --print xp to chat
  21.     p("printing")
  22.     p( "!!!XP Gained: "..value )
  23. end
  24.  
  25. New()
  Reply With Quote