Thread Tools Display Modes
02-13-15, 07:02 AM   #1
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
Semi-automatically change talents

I'm working on an add-on that will remind people to change their talents before specific boss fights (by their personal choice, of course). Is there a way to automate any part of the talent switching process?
(The holy grail here would be creating a button that says Click Here To Learn These 4 Talents, but I've been unable to find a way to do that)
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote
02-13-15, 07:35 AM   #2
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Ro posted a talent-swapping macro here, but apparently it's not always reliable when trying to switch multiple talent tiers at once.

You could use a secure action button with type = macro and dynamically build up a macro for each tier you need to swap.
  Reply With Quote
02-13-15, 09:02 AM   #3
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
Hmmm... that thread implies that it's possible to switch one talent with an add-on, but doesn't say how. Does it mean the way to do this via add-on is, as you said, to make a secure button which creates and calls that sort of talent swapping macro?

Also I'm starting to think it might be best to not fully automate it anyway, but to list the talents that you presumably want to learn and put a button next to each.
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote
02-13-15, 09:08 AM   #4
Dorwido
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 54
should be possible:
http://wow.gamepedia.com/World_of_Wa...lent_Functions

have a look at the last 3 there.
__________________
Auction Analytics
http://www.wowauction.org/
  Reply With Quote
02-13-15, 11:34 AM   #5
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
Originally Posted by Dorwido View Post
should be possible:
http://wow.gamepedia.com/World_of_Wa...lent_Functions

have a look at the last 3 there.
None of these functions are usable from add-ons, or even from macros :/

[Edit]
And while I'm at it, how can I open the talents frame programmatically?
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!

Last edited by Malsomnus : 02-13-15 at 11:44 AM.
  Reply With Quote
02-13-15, 01:13 PM   #6
elcius
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 75
You can call LearnTalents, you don't even need a hardware event for it.
All the issues are from RemoveTalent, which is not only locked to hardware events, but can only be called from blizzard code.
The only calls to the function and made in the StaticPopup handlers in Blizzard_TalentUI.lua, trigged in PlayerTalentFrameTalent_OnClick, only called by the OnClick handler for PlayerTalentButtonTemplate in Blizzard_TalentUI.xml.
The talent UI needs to be loaded though a hardware event to avoid taint, the easiest way to do that is to toggle the frame though a double /click TalentMicroButton.

Eventually you'll end up with something like this:
Code:
/stopmacro [combat]
/click TalentMicroButton
/click TalentMicroButton
/click PlayerTalentFrameTalentsTalentRowXTalentY -- talent you want to learn (row/col)
/click StaticPopup1Button1 -- should probaly had some checking for which popup is actually the talent one.
/click PlayerTalentFrameTalentsTalentRowXTalentY -- repeat as needed....
/click StaticPopup1Button1
...
/run LearnTalents(a,b,c,d,e,...) -- will need to be a slightly delayed call to give the server time to process the unlearns

Last edited by elcius : 02-13-15 at 01:16 PM.
  Reply With Quote
02-13-15, 02:35 PM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by elcius View Post
Eventually you'll end up with something like this:
Code:
/stopmacro [combat]
/click TalentMicroButton
/click TalentMicroButton
/click PlayerTalentFrameTalentsTalentRowXTalentY -- talent you want to learn (row/col)
/click StaticPopup1Button1 -- should probaly had some checking for which popup is actually the talent one.
/click PlayerTalentFrameTalentsTalentRowXTalentY -- repeat as needed....
/click StaticPopup1Button1
...
/run LearnTalents(a,b,c,d,e,...) -- will need to be a slightly delayed call to give the server time to process the unlearns
I explained in the other thread that the game generally won't let you unlearn multiple talents at once, you will get "another action is in progress" error if you try to make one large macro like that.

Occasionally it does let you swap more than one at a time, the problem is that since it's completely inconsistent you can't rely on it correctly changing out your talents.
  Reply With Quote
02-13-15, 01:14 PM   #8
Dorwido
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 54
Thought cause it is flagged as noncombat and not as protected it works, but while removetalent is protected learntalents is not, just tested that.
__________________
Auction Analytics
http://www.wowauction.org/
  Reply With Quote
02-13-15, 02:44 PM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
You could probably dispatch the LearnTalents() call to a C_Timer.After() function.
Code:
/run C_Timer.After(1,function() LearnTalents(a,b,c,d,e,...) end)
The first argument to C_Timer.After() is how many seconds to delay running the function defined as the second argument.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Semi-automatically change talents

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off