Wow dragonflight Combat log unfiltered basic question

115 views Asked by At

I'm trying to write a wow addon that will simply yell a statement when I interrupt a spell. Below is my code.

local frame = CreateFrame("Frame")
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

frame:SetScript("OnEvent", function(self, event)
      -- Extract information about the combat event
      local timestamp, eventType, hideCaster, 
      srcGUID, srcName, srcFlags, srcFlags2, 
      dstGUID, dstName, dstFlags, dstFlags2, 
      spellID, spellName, spellSchool, 
      extraSpellID, extraSpellName, extraSchool = CombatLogGetCurrentEventInfo()
      
      -- Check if the event type is SPELL_INTERRUPT and the source is the player
      if eventType == "SPELL_INTERRUPT" and srcName == UnitName("Player") then
         SendChatMessage("Grats on the kick", "YELL")
      end
end)

I can't seem to get this to work in /wowlua , the script will run but I either get interface failed because of an addon or simply nothing.

Any ideas?

0

There are 0 answers