It may be working, but it's not correct. The first argument for COMBAT_LOG_EVENT is the timestamp, and since you have the sub-event first it means your arguments are all off by one.
This is because "self" is implied when you use a colon to define a function. You could change it to events:COMBAT_LOG_EVENT_UNFILTERED(event, ...) but the entire point of writing an event handler like this is so you can define your variables directly in the function arguments.
I would personally remove the event name from the arguments since it's already the name of the function itself and I can't think of any reason you would need it. Something like this..
Lua Code:
function events:COMBAT_LOG_EVENT_UNFILTERED(timestamp, event, _, srcGUID, srcName, srcFlags, srcRaidFlags, dstGUID, dstName, dstFlags, dstRaidFlags, ...)
print(event) -- for debugging
if (event == "UNIT_DIED") then
print("UNIT_DIED")
end
end
-----------------
--EVENT HANDLER--
-----------------
frame:SetScript("OnEvent", function(self, event, ...)
events[event](self, ...)
end)
for k, v in pairs(events) do
frame:RegisterEvent(k)
end
Also semi-colons are essentially just for looks, so unless you really like them the only time I would bother is to prevent ambiguity.
One more thing, NEVER do var = select(1, ...), it's literally the same thing as var = ... except with the overhead of a function call.