Code:
local frame = CreateFrame("FRAME");
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
frame:SetScript("OnEvent", function(self, event, ...)
local timestamp, type, hideCaster,
sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = ...
--[[
* Note, for this example, you could just use 'local type = select(2, ...)'. The others are included
so that it's clear what's available.
* You can also lump all of the arguments into one block (or one really long line):
local timestamp, type, hideCaster, -- arg1 to arg3
sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, -- arg4 to arg11
spellId, spellName, spellSchool, -- arg12 to arg14
amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = ... -- arg15 to arg23
]]
if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
if (type == "SPELL_DAMAGE") then
local spellId, spellName, spellSchool, amount,
overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = select(12, ...)
if (spellName == "Mind Blast" and critical == 1) then -- "== 1" for clarity only. Not needed.
print("Mind Blast Just Critted!")
end
end
end
end);
It seemed the perfect example to get it done, but.. d'oh. Errors everywhere.