Macro Command - Change Specialization. Did the command change?

Hi.

So, I have this macro that I use to switch between specs. It’s convenient. I can press a button instead of opening up the window and–well, right. You guys know what convenience is.

You guys party.

Anyway, I’ve been using it for years. But earlier today, when I tried? Nothing happened. Does anyone know if the command has changed? This is what I have.

/run SetSpecialization(GetSpecialization()==2 and 3 or 2)

This is for my monk, who only does DPS or Healing. Mistweaver is 2, Windwalker is 3.

This was fine for years. But now, when I click the button? I am greeted with the most disrespectful, defiant silence I have ever not heard.

I would appreciate if someone could let me know if something has changed, and especially if they could provide me with a working one?

Thank you.

Seems like you have to add “C_SpecializationInfo.” to SetSpecialization now. Try:

/run C_SpecializationInfo.SetSpecialization(GetSpecialization()==2 and 3 or 2)

4 Likes

You no-good so-and-so, that worked! Thanks!

I’m assuming that’s a new change with the patch. I appreciate the people (like you) who actually know how to look at this coding sorcery and figure things like this out.

As per policy, I did have to call you a so-and-so, as I am an elf. There’s just a proper way of doing things, good Forsaken chum.

Seriously, thanks. I have a bunch of alts, and I had taken for granted how much of a QoL issue it was for me to be able to change specs without having to open up the talents tab, then clicking over to specializations, then choosing it.

Thank you again!

Would you also happen to know a simpler slash command just to change to one spec? My G15 decided to lose my keyboard profile and I’m having to rebuild all my macro keys.

Like, button A is for spec 1, button B for spec 2, button C for spec 3.

I know on my druid, I have Balance set up like this:

/run C_SpecializationInfo.SetSpecialization(1)

1 is Balance, 2 is Feral, etc.

Makes it easier for me when I have all those specs.

2 Likes

Thank you! Pretty sure I had something less complicated to type into the keyboard interface, but those appear to work just as expected.

1 Like

This works for me as well. Thanks for sharing!

Do you happen to know if conditionals work for this type of code? For example, if you’re currently in your Balance spec and want to run this only to switch to, say, your restoration spec, could you add a conditional to ensure you don’t attempt to switch specs when (1) is your current spec?

This is what I’ve tried on my paladin, in an attempt to switch to Holy spec, but only when I’m in Retribution spec:

/run [spec:3] C_SpecializationInfo.SetSpecialization(1)

Unfortunately, the script does not run when I added the ‘[spec:3]’ conditional. I’m just wondering if you or anyone else knows of a similar conditional that can be used with this ‘/run’ command?

This is an excellent time for me to point out that I am not nearly in possession of the expertise as the other, far more ‘techy adroit’ people on this forum.

However, this is what I have on my druid, that lets me switch between bitey and branchy (feral and restoration, if you must):

/run C_SpecializationInfo.SetSpecialization(GetSpecialization()==2 and 4 or 2)

That only switches between fangs and flowers.

I imagine what would work for you is this:

/run C_SpecializationInfo.SetSpecialization(GetSpecialization()==1 and 3 or 1)

But it might work better if you switch that ‘3’ to a ‘2’, and thus become protection. We need more tanks, I’ve decided. Unless I myself am tanking, in which case, you are free to do what you like.

The Lady Vanaelia is gracious.

1 Like
/run if SecureCmdOptionParse("[spec:3]") then C_SpecializationInfo.SetSpecialization(1) end

https://warcraft.wiki.gg/wiki/API_SecureCmdOptionParse

or you can do it the way Vanaelia described

/run if GetSpecialization() == 3 then C_SpecializationInfo.SetSpecialization(1) end

I assume GetSpecialization() will be move to the C_SpecializationInfo namespace at some point.

2 Likes

Perfect. Thank you so much!

But it might work better if you switch that ‘3’ to a ‘2’, and thus become protection. We need more tanks, I’ve decided. Unless I myself am tanking, in which case, you are free to do what you like.

haha…well I do play as protection as well, so I’ll just have to make a couple macros for this I suppose. :smiley:

This works as well. Thank you!!