View Single Post
06-16-15, 10:06 AM   #8
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
I do something like this in "remgank" :

Lua Code:
  1. local _, instanceType = IsInInstance()
  2.         if REMGANK_ENABLE == false or instanceType == "arena" or instanceType == "pvp" or (instanceType == "none" and GetZonePVPInfo() == "combat") then
  3.             -- REMGANK_ENABLE == false Monitoring is disabled
  4.             -- arena is, obviously, an arena.
  5.             -- pvp is a battleground.
  6.             -- none with GetZonePVPInfo() == "combat" is an outdoor PvP zone like Wintergrasp.
  7.             self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  8.         else
  9.             -- If not in a pvp zone, register CLEU:
  10.             self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  11.         end
  12.         return
  13.     end

It seems to work for me ...
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote