I'm going nuts here trying to track down what's causing this code to not work
Code:
local AnnoyingSelfBuffReminder = CreateFrame("Button", "AnnoyingSelfBuffReminder", UIParent)
AnnoyingSelfBuffReminder:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
AnnoyingSelfBuffReminder:SetScript("OnEvent", function(frame,event,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if a3 == UnitGUID("player") then
DEFAULT_CHAT_FRAME:AddMessage("YAY!");
if a2 == "SPELL_AURA_REMOVED" then
DEFAULT_CHAT_FRAME:AddMessage("YAY! :D");
if a10 == "Lifebloom" then
DEFAULT_CHAT_FRAME:AddMessage("LB FTW!");
end
end
end
end)
As is, if I cast Lifebloom on myself, the first chat message, 'YAY!' fires on application and removal of the spell, as well as on each tick, but neither of the other two messages show up. 'YAY!' shows up anytime I cast anything at all, so that part seems to be working.
If I comment out the first 'if' statement, and cast Lifebloom, I get the second and third chat messages when it fades.
If I comment out the second 'if' statement, and un-comment the first, and cast Lifebloom, I get the first and third chat messages.
Indepentantly, they work. Put together, they don't. I'm really stumped as to why, any thoughts?