Hmm...
looks like it's just rewriting the macro each time the character logs in or changes talents. (If I'm wrong, ignore the rest of this )
Source:
Code:
local function OnEvent(self, event, ...)
if (event == "PLAYER_LOGIN") or (event == "PLAYER_TALENT_UPDATE") then
for i=1, 18 do
local name, _, tier, _, selected = GetTalentInfo(i)
if selected then
if tier == 1 then
EditMacro("TIER_1", nil, "INV_Misc_QuestionMark", "#showtooltip "..name.."\n/cast "..name)
elseif tier == 2 then
EditMacro("TIER_2", nil, "INV_Misc_QuestionMark", "#showtooltip "..name.."\n/cast "..name)
elseif tier == 3 then
EditMacro("TIER_3", nil, "INV_Misc_QuestionMark", "#showtooltip "..name.."\n/cast "..name)
elseif tier == 4 then
EditMacro("TIER_4", nil, "INV_Misc_QuestionMark", "#showtooltip "..name.."\n/cast "..name)
elseif tier == 5 then
EditMacro("TIER_5", nil, "INV_Misc_QuestionMark", "#showtooltip "..name.."\n/cast "..name)
elseif tier == 6 then
EditMacro("TIER_6", nil, "INV_Misc_QuestionMark", "#showtooltip "..name.."\n/cast "..name)
end
end
end
end
end
Although, I should be able to just create custom names for my macros and then modify the if statements to check from the custom macro names... also, the addon could be simplified to not include "..name.." after #showtooltip since it appears to just write /cast SpellNameWhatever
So say I wanted to have the macro in my previous post:
#showtooltip
/use [nomod] Incinerate
/use [mod:shift] tier_4
/use [mod:ctrl,@focus] tier_4
I'd just modify it for my warlock T45 (tier_3) so it doesn't screw up any other class (look at tier 3 "LOCK_3")...
Modified:
Code:
local function OnEvent(self, event, ...)
if (event == "PLAYER_LOGIN") or (event == "PLAYER_TALENT_UPDATE") then
for i=1, 18 do
local name, _, tier, _, selected = GetTalentInfo(i)
if selected then
if tier == 1 then
EditMacro("TIER_1", nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
elseif tier == 2 then
EditMacro("TIER_2", nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
elseif tier == 3 then
EditMacro("TIER_3", nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
EditMacro("LOCK_3", nil, "INV_Misc_QuestionMark", "#showtooltip\n/use [nomod] Incinerate\n/use [mod:shift] "..name.."\n/use [mod:ctrl,@focus] "..name)
elseif tier == 4 then
EditMacro("TIER_4", nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
elseif tier == 5 then
EditMacro("TIER_5", nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
elseif tier == 6 then
EditMacro("TIER_6", nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
end
end
end
end
end
I'm not sure what happens if it can't find a macro with that name...
If I don't have a "TIER_3" macro on my lock, will it break there or skip to the next line? Hopefully it just continues to the next line. Otherwise I'm quessing there's a simple check that can be done:
Code:
if GetMacro("TIER_3") ~= nil then
EditMacro("TIER_3", nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
end
if GetMacro("LOCK_3") ~= nil then
EditMacro("LOCK_3", nil, "INV_Misc_QuestionMark", "#showtooltip\n/use [nomod] Incinerate\n/use [mod:shift] "..name.."\n/use [mod:ctrl,@focus] "..name)
end