From b582d6b6022e449182138cb684e7e5c5b036b00d Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Mon, 19 Oct 2020 16:18:49 +0200 Subject: [PATCH] Add ByeByeBuffs addon. --- ByeByeBuffs/ByeByeBuffs.lua | 59 +++++++++++++++++++++++++++++++++++++ ByeByeBuffs/ByeByeBuffs.toc | 10 +++++++ ByeByeBuffs/README.md | 3 ++ 3 files changed, 72 insertions(+) create mode 100644 ByeByeBuffs/ByeByeBuffs.lua create mode 100644 ByeByeBuffs/ByeByeBuffs.toc create mode 100644 ByeByeBuffs/README.md diff --git a/ByeByeBuffs/ByeByeBuffs.lua b/ByeByeBuffs/ByeByeBuffs.lua new file mode 100644 index 0000000..77bafe4 --- /dev/null +++ b/ByeByeBuffs/ByeByeBuffs.lua @@ -0,0 +1,59 @@ +ByeByeBuffs = {} +ByeByeBuffs.title = GetAddOnMetadata("ByeByeBuffs", "Title") +ByeByeBuffs.version = GetAddOnMetadata("ByeByeBuffs", "Version") +ByeByeBuffs.author = GetAddOnMetadata("ByeByeBuffs", "Author") +print(("Loaded %s v%s by %s."):format(ByeByeBuffs.title, ByeByeBuffs.version, ByeByeBuffs.author)) + +local blacklistedAuras = { + "Honorless Target", + "Cozy Fire", + "Find Minerals", + "Find Herbs", + "Unending Breath", + "Water Breathing", + "Water Walking", + "Detect Lesser Invisibility", + "Detect Invisibility", + "Detect Greater Invisibility", + "Arcane Intellect", + "Arcane Brilliance", + "Blessing of Wisdom", + "Blessing of Sanctuary", + "Greater Blessing of Wisdom", + "Greater Blessing of Sanctuary", + "Divine Spirit", + "Prayer of Spirit", + "Renew", + "Regrowth", + "Rejuvenation", + "Greater Heal", + "Inspiration", + "Innervate", + "Lightwell Renew", + "Thorns", + "Bloodthirst", + "Armor of Faith", + "Power Infusion", + "Healing Way", + "Ancestral Fortitude", + "Headmaster's Charge", +} +local cancelBlacklistedAurasMacro = "/cancelaura " .. table.concat(blacklistedAuras, "\n/cancelaura ") + +local button = CreateFrame("Button", "BBB", UIParent, "SecureActionButtonTemplate") +button:SetAttribute("type", "macro") +button:SetAttribute("macrotext", "/stopmacro") + +local frame = CreateFrame("FRAME") +frame:RegisterEvent("PLAYER_REGEN_ENABLED") +frame:RegisterEvent("PLAYER_ENTERING_WORLD") +frame:SetScript("OnEvent", function(self, event, ...) + local isWorldBuffed = IsInRaid() and UnitAura("player", 18, "HELPFUL") -- simply checks for more than 18 buffs + if isWorldBuffed then + print(("%s: World-buffed."):format(ByeByeBuffs.title)) + return button:SetAttribute("macrotext", cancelBlacklistedAurasMacro) + end + print(("%s: not World-buffed."):format(ByeByeBuffs.title)) + return button:SetAttribute("macrotext", "/stopmacro") + +end) diff --git a/ByeByeBuffs/ByeByeBuffs.toc b/ByeByeBuffs/ByeByeBuffs.toc new file mode 100644 index 0000000..b331ded --- /dev/null +++ b/ByeByeBuffs/ByeByeBuffs.toc @@ -0,0 +1,10 @@ +## Interface: 11305 + +## Title: ByeByeBuffs +## Notes: AddOn for Fury Warriors to automatically cancel unwanted buffs, to help stay below the buff cap. +## Author: Caspervk +## Version: 0.0.1 + +## X-License: GNU General Public License v3 or later (GPLv3+) + +ByeByeBuffs.lua diff --git a/ByeByeBuffs/README.md b/ByeByeBuffs/README.md new file mode 100644 index 0000000..d56d43a --- /dev/null +++ b/ByeByeBuffs/README.md @@ -0,0 +1,3 @@ +# ByeByeBuffs +World of Warcraft Classic AddOn for Fury Warriors to automatically cancel unwanted buffs, to help stay below the buff cap. +Use `/click BBB` in (all) macros for near-instantaneous, in-combat, aura removal.