The event to check is UNIT_AURA, though you would have an easier time using COMBAT_LOG_EVENT_UNFILTERED. Though it might take longer to get used to
SPELL_AURA_APPLIED and
SPELL_AURA_REMOVED are the types of event your looking to parse from the log.
Anyway to help clear up the wiki page here goes,
First you have a base set of 8 args on ANY COMBAT_LOG_EVENT_UNFILTERED.
Now your looking at specifically at this point arg2 the event type (this is a sub event local to the combat log, NOT the COMBAT_LOG_EVENT_UNFILTERED event), specifically you want to match SPELL_AURA_APPLIED and SPELL_AURA_REMOVED. well come back to these as we need to do a little more work before we move onto the arguments these add.
Right now i'm assuming your tracking a spell on yourself. As such you want to check arg7 == your characters name.
Right now back to SPELL_AURA_APPLIED and SPELL_AURA_REMOVED. These both add an extra 4 arguments (args 9-12). Args 11 and 12 are spellschool and if its a buff/debuff so you can ignore them, 9 and 10 however allow you to check via spellid or spellname.
So quick sum up (borrowed and edited the from the wowwiki page to suit you more.)
Code:
Function Foo_OnLoad()
this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
end
Function Foo_OnEvent(self, event, ...)
local timestamp, type, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...)
-- you can use local type = select(2, ...)
-- and local destName = select(7, ...)
if ( destName == UnitName("player") ) then
if (type == "SPELL_AURA_APPLIED") then
local spellid, spellname = select(9,...)
-- do stuff for spell being applied here
elseif (type == "SPELL_AURA_REMOVED") then
local spellid, spellname = select(9,...)
-- do stuff for spell being removed here
end
end
end
now that should (i think work) or at least set you off on the right tracks