I do something like this in "remgank" :
Lua Code:
local _, instanceType = IsInInstance()
if REMGANK_ENABLE == false or instanceType == "arena" or instanceType == "pvp" or (instanceType == "none" and GetZonePVPInfo() == "combat") then
-- REMGANK_ENABLE == false Monitoring is disabled
-- arena is, obviously, an arena.
-- pvp is a battleground.
-- none with GetZonePVPInfo() == "combat" is an outdoor PvP zone like Wintergrasp.
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
else
-- If not in a pvp zone, register CLEU:
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
return
end
It seems to work for me ...