From 26f113a4ee5b6e9589b9e4768ee71baa728f399b Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sat, 13 Aug 2016 23:17:49 -0700 Subject: [PATCH] Fix the macro button There's a lot more global macros now, so we weren't finding a previously-created macro. Also, most of the spells we used no longer exist, so get rid of all of the dead spells. I don't have any spells to replace them with at the moment. Because most of the spells are dead, also define macro rules for cases where we only have an in-combat spell and not an out-of-combat one. --- MacroGenerator.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/MacroGenerator.lua b/MacroGenerator.lua index e3f4795..50970ce 100644 --- a/MacroGenerator.lua +++ b/MacroGenerator.lua @@ -1,6 +1,5 @@ local myname, Cork = ... -local MAX_ACCOUNT_MACROS, MAX_CHARACTER_MACROS = 36, 18 local function GetMacroID() for i=(MAX_ACCOUNT_MACROS+1),(MAX_ACCOUNT_MACROS+MAX_CHARACTER_MACROS) do if GetMacroInfo(i) == "Cork" then return i end end @@ -16,16 +15,16 @@ function Cork.GenerateMacro() local icon = "INV_MISC_QUESTIONMARK" local c = Cork.MYCLASS if c == "DEATHKNIGHT" then ooc = 3714 - elseif c == "HUNTER" then ooc = 13165 - elseif c == "SHAMAN" then ooc = 324 - elseif c == "WARLOCK" then ooc = 6201 - elseif c == "WARRIOR" then ooc = 6673 - elseif c == "MONK" then ooc = 115921 + elseif c == "HUNTER" then -- ooc = 13165 -- dead spell + elseif c == "SHAMAN" then -- ooc = 324 -- dead spell + elseif c == "WARLOCK" then -- ooc = 6201 + elseif c == "WARRIOR" then -- ooc = 6673 -- dead spell + elseif c == "MONK" then -- ooc = 115921 -- dead spell elseif c == "ROGUE" then ooc = 2823 - elseif c == "DRUID" then ic, ooc = 22812, 1126 - elseif c == "MAGE" then ic, ooc = 30482, 1459 - elseif c == "PALADIN" then ic, ooc = 20165, 19740 - elseif c == "PRIEST" then ic, ooc = 588, 21562 + elseif c == "DRUID" then ic, ooc = 22812, nil -- 1126 -- dead spell + elseif c == "MAGE" then ic, ooc = 30482, nil -- 1459 -- dead spell + elseif c == "PALADIN" then -- ic, ooc = 20165, 19740 -- dead spells + elseif c == "PRIEST" then -- ic, ooc = 588, 21562 -- dead spells end if ic and ooc then ic, ooc = GetSpellInfo(ic), GetSpellInfo(ooc) @@ -39,6 +38,9 @@ function Cork.GenerateMacro() else body = "#showtooltip "..ooc.."\n/click CorkFrame" end + elseif ic then + ic = GetSpellInfo(ic) + body = "#showtooltip [combat] "..ic.."\n/cast [combat] "..ic.."\n/stopmacro [combat]\n/click CorkFrame" else body = "/click CorkFrame" end