Here is the combat log debugging function I promised, extremely simple, it logs every combat log event cast by player or cast to current target:
local eventFrame = CreateFrame("Frame");
eventFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
eventFrame:SetScript("OnEvent", function(_, event)
local _, subEvent, _, sourceGUID, sourceName, _, _, destGUID, destName, _, _, spellID, spellName = CombatLogGetCurrentEventInfo();
if ( sourceGUID == UnitGUID("player") or sourceGUID == UnitGUID("pet") or destGUID == UnitGUID("target") ) then
print("Combat log event:", subEvent, sourceName, destName, spellName, spellID);
end
end)
Addon authoring demystified - combat log debugging & how to get started with addon writing
A few folks have reached out to me asking "I have coding experience but not addon / Lua, how do I get started?"
95% I needed to get onboarded when I started is from:
-
warcraft.wiki.gg/wiki/World_…
- Blizzard Interface code. For this one you can either check out their GitHub repo (
github.com/tomrus88/Blizzard…) or you can extract the code locally (follow
warcraft.wiki.gg/wiki/Viewin…) and open the folder with VSCode (I personally prefer to view the code locally, VSCode is more convenient than navigating through a GitHub repo)
5% came from ace3 documentation (which is done poorly) for options UI coding
I also highly highly recommend that you set up VSCode with GitHub Copilot, it is insanely helpful (e.g., predicts entire functions for you as you code, and 80% of what it writes makes sense and just needs minor adjustments)
For combat log debugging, I'll share some scripts later in a reply to this post