I wrote an addon that hides or shows specific Bartender buttons in relation to specific auras (anyone wondering: I basically use it as part of a WeakAuras aura setup).
Anyway, it works perfectly outside of combat, and it stops working in combat.
Code:
local frame = CreateFrame("frame")
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
local function AuraEvent(self, event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)
local spellID, spellName, spellSchool = ...;
-- These are the Aura functions that hide and show the Bartender buttons.
if (message == "SPELL_AURA_APPLIED" or message == "SPELL_AURA_REFRESH") and sourceName == "Jyyn" then
if spellID == 100977 then
BT4Button75:Show()
elseif spellID == 16870 then
BT4Button74:Show()
elseif spellID == 126588 then
BT4Button73:Show()
elseif spellID == 117679 then
BT4Button76:Show()
elseif spellID == 124974 then
BT4Button77:Show()
end
elseif (message == "SPELL_AURA_REMOVED") and sourceName == "Jyyn" then
if spellID == 100977 then
BT4Button75:Hide()
elseif spellID == 16870 then
BT4Button74:Hide()
elseif spellID == 126588 then
BT4Button73:Hide()
elseif spellID == 117679 then
BT4Button76:Hide()
elseif spellID == 124974 then
BT4Button77:Hide()
end
end
end
end
frame:SetScript("OnEvent", AuraEvent)
Halp!