View Single Post
04/21/17, 06:22 PM   #3
Rugnir_viking
Join Date: Apr 2017
Posts: 3
Unfortunately it does not seem to cover it
After a bit more experimentation, I believe its not entirely to do with d() and perhaps my lack of understanding, but here is my code

I'm expecting when I enter/exit combat for stuff to appear in chat

here is my attempt at code

Lua Code:
  1. function Initialise()
  2.     EVENT_MANAGER:RegisterForEvent("TestAddon1", EVENT_PLAYER_COMBAT_STATE, combatStatusChanges)
  3. end
  4.  
  5. function combatStatusChanges()
  6.     -- literally anything sould cause it to debug output
  7.     d("help me")
  8. end
  9.  
  10. function addOnInit(event, addonName)
  11.   if addonName == "TestAddon1" then
  12.     Initialise()
  13.   end
  14. end
  15.  
  16.  
  17. EVENT_MANAGER:RegisterForEvent("TestAddon1", EVENT_ADD_ON_LOADED, addOnInit)
  Reply With Quote