Download
(1Kb)
Download
Updated: 08-15-16 11:53 AM
Compatibility:
Legion (7.0.3)
Updated:08-15-16 11:53 AM
Created:08-27-12 04:04 PM
Downloads:9,318
Favorites:45
MD5:

infMopTalentMacros  Popular! (More than 5000 hits)

Version: 2.2
by: infin1te [More]

A very simple addon that helps you make working macros for the new tier based talents in 5.0.4 (MoP)
At least until they make #showtooltip able to handle the new system.


Technically you could do this kind of macro:

Code:
/cast ability1
/cast ability2
/cast ability3
But then you are stuck with the issue that you wont have the correct icon/tooltip.


You could solve that problem by doing something like this
Code:
/cast ability1
/cast ability2
/run SetMacroSpell("MacroName",GetSpellInfo("ability1") or "ability2")
However the problem with that is that you have to click the macro once for it to update the icon/tooltip correctly.


This addon solves those issues completely and lets you make proper macros.

You simply make an empty macro with any icon but with the name "tier_#", where # is the number of the talent tier you want the macro for. (1-6, top to bottom), it is not case sensitive.
It does not matter if it is in the general or player specific macro section, though of course if you want it available cross-character then I would recommend putting in the general section.
Make sure you get the name right though, it won't work otherwise.

And that is it, the addon will do the rest.

What it does is that it edits your macro to the appropriate ability every time you swap a talent for that tier.

Note that you will most likely need to swap a talent for that tier or swap you spec for the macro to initialize, though this only has to be done the very first time.
Also make sure you do not have more than one macro per tier as it can cause issues.

Cpu usage is essentially zero if anyone was wondering, as it only operates when you swap a talent.


iNFEH @ Twisting Nether EU

2.2
  • Update TOC for 7.0
  • Fix an issue with missing icons.

2.1
  • Update TOC for 6.1

2.0
  • Update TOC for 6.0

1.7
  • Reverted back to the non-lib version, but kept some in combat error protection since blizzard still hasn't fixed the problem with PLAYER_TALENT_UPDATE firing 'randomly' for some ppl, seems to be especially warlock related, I've never been able to replicate it myself but it's definitely there.
    http://wow.curseforge.com/addons/tellmewhen/tickets/949
  • As I'm not using this addon myself since 5.2~ don't expect anything major to be changed.
    I have also enabled so anyone that has some good changes can upload them here as optional files.

1.6
  • Update TOC for 5.4
  • Added some additional code for handling in-combat scenarios based upon comments.

1.5
  • Update TOC for 5.3

1.4
  • Update TOC for 5.2

1.3
  • Update TOC for 5.1

1.2
  • Cleaned the code a bit. y u heff to be so good nebula169!

1.1
  • Fixed a minor issue that occurred when swapping characters.
Optional Files (0)


Post A Reply Comment Options
Unread 02-04-15, 06:27 PM  
Ryjax
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
@infin1te

Would it be difficult to add 7 extra macro commands for focus?

For us arena guys, it'd be nice to have a "tier_1" macro and a "tier_1F" macro, where the only difference is it casts @focus if possible.

This addon is awesome, but I still have to do write the annoying macros this addon is built to bypass, for all my focus buttons.

I am thinking this may be more difficult than it sounds, because it is a universal macro (unless you have class specific code for each tier). Mostly because some talents are self buffs (burst of speed) and @focus would break that. But I am not a coder.
Last edited by Ryjax : 02-04-15 at 06:32 PM.
Report comment to moderator  
Reply With Quote
Unread 05-10-14, 11:53 AM  
nixchecker
A Kobold Labourer

Forum posts: 1
File comments: 2
Uploads: 0
Re: finally!

Originally Posted by the-wind-waker
one thing though, would it be possible to use it for macros in general?

for something like:
/cast [stance:1] tier_1; [stance:3] barkskin

that would be amazing! =)
I edited this addon to do exactly this!

Just copy+paste the code below into the lua file (overwrite everything)

It does the same as before, but in addition lets you specify character-specific macros that will be overwritten every time you change your talents. Within these macros you can now make use of spells "T_1" through "T_6" (which represent the chosen skills in each talent tier).

You can insert a list of macros for each charakter. Login to WoW, and add an empty macro with the chosen name. After that, insert a new line in the "macro" table in the lua-file with the same key-name.


In the code code below there are a few sample macros. In table "macros" for the charakter "Charaktername", there are two sample macros.
The second one is a macro named "Macroname2":
Code:
#showtooltip
/use [mod:shift]T_2;T_3
When you use this macro ingame, and press shift while clicking, you use the selected Tier2 talent. When not pressing shift, you will use the talent of Tier3 instead.


Have fun with this addition (maybe the author may want to add it to his already awesome addon )

Code:
----------------------------------------------
-- infMopTalentMacros
----------------------------------------------

infMopTalentMacros = LibStub("AceAddon-3.0"):NewAddon("infMopTalentMacros", "AceEvent-3.0")

local macros = {
  ["Charaktername"] = {
    ["Macroname1"] = [[#showtooltip
/use T_1]];
    ["Macroname2"] = [[#showtooltip
/use [mod:shift]T_2;T_3]];
  };
  ["Ingenium"] = {
    ["RB04"] = [[#showtooltip
/use [stance:1,nomod]Savage Defense;[stance:1,mod:shift]T_6;[stance:3]Tiger's Fury;[stance:5]Wild Mushroom: Detonate;[nostance]Wild Mushroom]];
    ["hotw_inge"] = [[#showtooltip
/use T_6]];
    ["DO5S"] = [[#showtooltip
/use [stance:1]T_5;[stance:3]Thrash;T_3]];
  };
};
local macrosDependencies = {};
local macrosPrepared = {};
local playerName = nil

function infMopTalentMacros:OnEnable()
  playerName = UnitName("player")
  if not macros[playerName] then
    return
  end
  
  for k, v in pairs(macros[playerName]) do
    for i = 1, 6 do
      if v:find("T_"..i) then
        if not macrosDependencies["T_"..i] then
          macrosDependencies["T_"..i] = {};
        end
        table.insert(macrosDependencies["T_"..i], k)
      end
    end
  end

  self:RegisterEvent("PLAYER_TALENT_UPDATE")

  self:MacroUpdate()
end

function infMopTalentMacros:PLAYER_TALENT_UPDATE()
	self:MacroUpdate()
end

function infMopTalentMacros:PLAYER_REGEN_ENABLED()
	self:UnregisterEvent("PLAYER_REGEN_ENABLED")
	self:MacroUpdate()
end

function infMopTalentMacros:MacroUpdate()
	if InCombatLockdown() then
		self:RegisterEvent("PLAYER_REGEN_ENABLED")
		return
	end

  for i=1, MAX_NUM_TALENTS do
		local name, _, tier, _, selected = GetTalentInfo(i)
		if selected then
			EditMacro("TIER_"..tier, nil, "INV_Misc_QuestionMark", "#showtooltip\n/cast "..name)
		end
	end
  
  for k, v in pairs(macros[playerName]) do
    macrosPrepared[k] = v
  end
  for i=1, MAX_NUM_TALENTS do
    local name, _, tier, _, selected = GetTalentInfo(i)
    if selected then
      if macrosDependencies["T_"..tier] then
        for i2, v in ipairs(macrosDependencies["T_"..tier]) do
          macrosPrepared[v] = macrosPrepared[v]:gsub("T_"..tier, name)
        end
      end
    end
  end
  for k, v in pairs(macrosPrepared) do
    EditMacro(k, nil, "INV_Misc_QuestionMark", v)
  end
end
Report comment to moderator  
Reply With Quote
Unread 05-02-14, 08:01 PM  
macklol
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
I actually made an "addon" like this that works exactly the same, but since I am bit of a scrub in lua language it has more code in it. Though I have some RegisterEvents to update the macros which work perfectly without having to relearn talent. I guess the one that does that is UPDATE_MACROS that triggers when you create the macro. Pretty sure you can remove PLAYER_REGEN_ENABLED if you use UPDATE_MACROS instead. I did get a bug report from a guildmate that wasnt level 90 and couldn't learn higher than 45 talents. I don't have any characters under 90 so couldn't check it myself, but it was only when he logged in so didn't really care to check it out.

I use these RegisterEvents to update the tooltips:

frame:RegisterEvent("PLAYER_LOGIN");
frame:RegisterEvent("PLAYER_TALENT_UPDATE");
frame:RegisterEvent("UPDATE_MACROS");

The difference between yours and my "addon" is that yours overwrite the macro if you change a talent. I'm not sure I like this, but it is a nice touch. As warlock for example, you'd want stopcasting in a macro with Dark Bargain/Sac Pact or Shadowfury/Mortal Coil.

One problem I had, that you also seemed to have is that it does not work for Solace and Insanity for priests in 45 talents. It shows the talent instead of the actual spell you get (the talent is a passive that grants you a spell), Power Word: Solace. It's not a big deal, because it replaces Holy Fire and you probably had that binded somewhere else.

Edit: And yes, what Phanx wrote below.
Last edited by macklol : 05-02-14 at 08:05 PM.
Report comment to moderator  
Reply With Quote
Unread 02-16-14, 05:57 PM  
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 5617
File comments: 2321
Uploads: 54
42kb worth of libraries for an addon that's less than 1kb?!

You can dump the libraries and achieve exactly the same result by replacing your NewAddon line with this:
Code:
local infMopTalentMacros = CreateFrame("Frame", "infMopTalentMacros")
infMopTalentMacros:SetScript("OnEvent", function(self, event, ...) return self[event](self, event, ...) end)
infMopTalentMacros:RegisterEvent("PLAYER_LOGIN")
...and then renaming your OnEnable function to PLAYER_LOGIN, like so:
Code:
function infMopTalentMacros:PLAYER_LOGIN()
	self:RegisterEvent("PLAYER_TALENT_UPDATE")
	self:MacroUpdate()
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
Report comment to moderator  
Reply With Quote
Unread 11-22-13, 02:45 AM  
Pobre
A Murloc Raider
 
Pobre's Avatar
AddOn Author - Click to view AddOns

Forum posts: 5
File comments: 9
Uploads: 2
So simple that I'm inclined to try! Downloading.
Report comment to moderator  
Reply With Quote
Unread 10-23-13, 10:32 AM  
sidelsky18
A Murloc Raider

Forum posts: 4
File comments: 2
Uploads: 0
Originally Posted by infin1te
Originally Posted by sidelsky18
As of the past few days I'm getting spammed with "TalentMacros: Macros will be updated when you leave combat." while I'm in combat.
That's not this addon causing that, sounds like you might have the 'TalentMacros' addon installed?
http://www.wowace.com/addons/talentmacros/

Whoops! My bad!
Report comment to moderator  
Reply With Quote
Unread 10-20-13, 04:12 PM  
infin1te
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 19
Uploads: 6
Originally Posted by sidelsky18
As of the past few days I'm getting spammed with "TalentMacros: Macros will be updated when you leave combat." while I'm in combat.
That's not this addon causing that, sounds like you might have the 'TalentMacros' addon installed?
http://www.wowace.com/addons/talentmacros/
Report comment to moderator  
Reply With Quote
Unread 10-20-13, 03:52 PM  
sidelsky18
A Murloc Raider

Forum posts: 4
File comments: 2
Uploads: 0
Originally Posted by infin1te
I did actually consider adding a check for if-in-combat originally, however as you can't actually learn nor unlearn talents in combat I never bothered.
Which on the other hand makes me quite curious as to how you managed to produce that error.
I've been using this addon since I made it and I've never encountered an in-combat error.

Anyway if it's causing people problems I can fix it, and cheers for the suggestion circatm2001

As of the past few days I'm getting spammed with "TalentMacros: Macros will be updated when you leave combat." while I'm in combat.
Report comment to moderator  
Reply With Quote
Unread 10-19-13, 10:01 AM  
khurzog
A Frostmaul Preserver
 
khurzog's Avatar

Forum posts: 266
File comments: 194
Uploads: 0
this addon has been very helpful! i would like to make a simple request...

/stopcasting support

thanks
Report comment to moderator  
Reply With Quote
Unread 10-02-13, 03:21 AM  
hexiaa
A Defias Bandit
 
hexiaa's Avatar

Forum posts: 2
File comments: 42
Uploads: 0
Works great
Report comment to moderator  
Reply With Quote
Unread 09-28-13, 01:40 PM  
meljen
A Fallenroot Satyr

Forum posts: 28
File comments: 309
Uploads: 0
Thank you so much for this. I hope it works, I have been busting my brain trying to have Binding Shot and Intimidation (hunter talents) set to the same keybind without having to drag the button on and off my bar every time I switch out.

Again thank you! I hope you keep this updated!
Report comment to moderator  
Reply With Quote
Unread 09-18-13, 12:06 PM  
EKE
An Aku'mai Servant
 
EKE's Avatar
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 548
Uploads: 13
oh no there is a lib now O.O

trying to diy nolib version
Report comment to moderator  
Reply With Quote
Unread 09-10-13, 05:09 AM  
infin1te
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 19
Uploads: 6
Originally Posted by Machinelf
Cheers!, appreciate it.
Report comment to moderator  
Reply With Quote
Unread 08-28-13, 04:18 AM  
Machinelf
A Murloc Raider

Forum posts: 4
File comments: 23
Uploads: 0
Report comment to moderator  
Reply With Quote
Unread 07-20-13, 08:20 PM  
circatm2001
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
Originally Posted by infin1te
I did actually consider adding a check for if-in-combat originally, however as you can't actually learn nor unlearn talents in combat I never bothered.
Which on the other hand makes me quite curious as to how you managed to produce that error.
I've been using this addon since I made it and I've never encountered an in-combat error.

Anyway if it's causing people problems I can fix it, and cheers for the suggestion circatm2001
Np . I don't know what's causing the talent update event to fire during combat, but it's triggering hundreds of times in short periods of time. Multiple people were experiencing this issue, it must be something on blizzard's end. Have you not noticed this error infin1te? I haven't had a single problem since I modified the code and added the combat check.
Last edited by circatm2001 : 07-20-13 at 10:49 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: