Just an idea:
Code:
local f = ? -- FrameReference not sure of the name
f:RegisterEvent("PLAYER_ENTERING_WORLD") -- register the event to run after each loading screen
f:HookScript("OnEvent", function(f, event) -- we only add this to the current function, instead of replacing it entirely (then we match the event to be what we expect, before we run our code)
if event == "PLAYER_ENTERING_WORLD" then
local instanceType = select(2, IsInInstance())
if instanceType == "pvp" or instanceType == "arena" then
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
else
f:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
end
end)