Gearset Equip Toggle?

Bugger.

It’s too long.

I didn’t count the /stopmacro line when I was looking at the length.

I’ll see if I can fix it.

/stopmacro [combat]
/run local T,E,N={1,3,7}N=T[1]for i=0,9 do E=C_EquipmentSet.GetEquipmentSetInfo(i)if E and tContains(T,(strsub(E.name,4)))and E.isEquipped then N=(i==#T and T[1]or T[i])print("Set", N)break end end C_EquipmentSet.UseEquipmentSet(N)

Barely got it in and you only have 3 additional characters to play with (so that list of set number suffixes can only be 3 more characters long total including spaces and commas).

Still, that’s a lot of functionality for a single macro.

I could break it up into multiple macros if you don’t mind macro chaining. It’d still be only one click, but it’d take up two spots on your bars.

I DO appreciate your trying to help me out… I already have 2 buttons, one to swap between Fishing and my best set, the other to just use for the Gift of Loa set. Ah, I see, the character limit for macros, can I assume that the word “Set” is basically ignored in the code? I theoretically could use Wrld, Raid, Fish using the extra 3 alphas, correct?

I believe swapping gear in combat is never allowed anyway, so maybe the stopmacro not so necessary? Just curious.

Hmmm, tried your new code, more extensive error message:

Message: [string “local T,E,N={1,3,7}N=T[1]for i=0,9 do E=C_E…”]:1: bad argument #1 to ‘strsub’ (string expected, got nil)
Time: Sun Mar 3 12:43:12 2019
Count: 1
Stack: [string “local T,E,N={1,3,7}N=T[1]for i=0,9 do E=C_E…”]:1: bad argument #1 to ‘strsub’ (string expected, got nil)
Interface\FrameXML\ChatFrame.lua:2155: in function ?' Interface\FrameXML\ChatFrame.lua:4757: in functionChatEdit_ParseText’
Interface\FrameXML\ChatFrame.lua:4418: in function ChatEdit_SendText' Interface\FrameXML\ChatFrame.lua:2895: in function <Interface\FrameXML\ChatFrame.lua:2888> [C]: in functionUseAction’
Interface\FrameXML\SecureTemplates.lua:345: in function handler' Interface\FrameXML\SecureTemplates.lua:623: in functionSecureActionButton_OnClick’
[string “:OnClick"]:4: in function <[string ":OnClick”]:1>

Locals: msg = “local T,E,N={1,3,7}N=T[1]for i=0,9 do E=C_EquipmentSet.GetEquipmentSetInfo(i)if E and tContains(T,(strsub(E.name,4)))and E.isEquipped then N=(i==#T and T[1]or T[i])print(“Set”, N)break end end C_EquipmentSet.UseEquipmentSet(N)”

Looking now.

Yes. you could differentiate between different sets by using SET FSH M+ TM whatever you wanted.

The code, however, relies on the SAME prefix on all equipmentset names in that macro.

I’ll be back with a fix in a moment.

Bugger. Ran into my own tail on something (again).

I wrote an overlay function that is ALMOST exactly like the Blizzard one but returns named fields.

I use it so often, I forget sometimes that it’s not normal.

This should work.

/stopmacro [combat]
/run local T,E,N={1,3,7}N=T[1]for i=0,9 do E={C_EquipmentSet.GetEquipmentSetInfo(i)}if E and tContains(T,(strsub(E[1],4)))and E[4] then N=(i==#T and T[1]or T[i])print("Set", N)break end end C_EquipmentSet.UseEquipmentSet(N)

This is a little out of the box, but I have a solution that might work better:

Macro 1 (The one you actually click to do the switch)

/stopmacro [combat]
/run if MyGS then wipe(MyGS) else MyGS={} end MyGS.G={} for i=0,9 do local N,_,_,E=C_EquipmentSet.GetEquipmentSetInfo(i) if N then MyGS.G[N]=i if E then MyGS.C=N end end end
/click MyButtonFrameName2
/click MyButtonFrameName3

This one establishes (or cleans out) a global table and populates a sub-table with parts of your currently-defined equipment sets for later use.

You’ll have to discover the names of two non-transient buttons (they can’t be on the action swapping bars) to use for MyButtonFrameName2 and MyButtonFrame3 and insert the frame names there, no quotes, no brackets, no nothing. They’re variable names.

Macro 2 (This one you can swap out with other versions to allow for use of this system between toons or to allow you to swap out different sets of equipment sets). Place this on MyButtonFrameName2.

This one is little more than a list of the gear sets you want to select from and an inverter so I can get from set name to set ID quickly and easily later.

/run MyGS.S={"GearSet","Another Gear Set","Still Another Gear Set","Yet Another Gear Set"} MyGS.V={} for k,v in ipairs(MyGS.S) do MyGS.V[v]=k end

Macro 3 (This one performs the actual swapping). Place this on MyButtonFrameName3.

/run local T=MyGS if not T.C or not tContains(T.S,T.C) or T.C==T.S[#T.S] then T.X=1 else T.X=T.V[T.C]+1 end C_EquipmentSet.UseEquipmentSet(T.X) print("Equipping",T.S[T.X])

I’ve not tested this. I have run most of the code elements outside of this construct and I use macro chaining like this all the time.

As to why on the stopmacro, you’re dealing with a Blizzard frame in ways that might cause taint if you touch it in code in a forbidden situation. Safer to avoid clicking it so you don’t find yourself having to reload in the middle of something to clear the taint.

Going offline for a bit. I’ll be back on tomorrow latest, maybe later tonight.

Well, tried the latest one:

Message: [string “local T,E,N={1,3,7}N=T[1]for i=0,9 do E={C_…”]:1: bad argument #1 to ‘strsub’ (string expected, got nil)
Time: Mon Mar 4 18:19:56 2019
Count: 1
Stack: [string “local T,E,N={1,3,7}N=T[1]for i=0,9 do E={C_…”]:1: bad argument #1 to ‘strsub’ (string expected, got nil)
Interface\FrameXML\ChatFrame.lua:2155: in function ?' Interface\FrameXML\ChatFrame.lua:4757: in functionChatEdit_ParseText’
Interface\FrameXML\ChatFrame.lua:4418: in function ChatEdit_SendText' Interface\FrameXML\ChatFrame.lua:2895: in function <Interface\FrameXML\ChatFrame.lua:2888> [C]: in functionUseAction’
Interface\FrameXML\SecureTemplates.lua:345: in function handler' Interface\FrameXML\SecureTemplates.lua:623: in functionSecureActionButton_OnClick’
[string “:OnClick"]:4: in function <[string ":OnClick”]:1>

Locals: msg = “local T,E,N={1,3,7}N=T[1]for i=0,9 do E={C_EquipmentSet.GetEquipmentSetInfo(i)}if E and tContains(T,(strsub(E[1],4)))and E[4] then N=(i==#T and T[1]or T[i])print(“Set”, N)break end end C_EquipmentSet.UseEquipmentSet(N)”


Reread the thread… somehow missed that you said for ME to add something to the code… I have no idea how to do what you are asking of me. I just used the code block after renaming the 3 sets Set1, Set3, Set7.

Sorry so long in respondind. Busy day.

Let’s sort a few things out.

  1. are you using a bar mod?

  2. If so, which one.

  3. if not, which bar would have two free buttons on it (can’t be one of the paging bars).

List the names of the equipment sets you want in one of your rotations (exact names, spelling and capitalization please).

I’ll take it from there.

Once you have one, the others will be easier.

No I am not using a bar add-on. My understanding is no bar add-ons give you MORE buttons than Blizz gives you.

Once one has all bars displayed, there seems to be one more that is part of a 2 bar rotation with my main bar (lower left). I have a bunch of pets on there but very rarely use it, so one could say I can have some free button spaces there… BUT it’s not something I want to switch to.

My sets are named Raid, World, Fishing. World is my best set of gear outside where the Gift of the Loa set bonus works (Zuldazar)

Actually EVERY bar mod gives you more addressable buttons than the vanilla UI.

For some completely unfathomable reason, Blizzard chose to create 120 Action Slots but only 60 of them are directly addressable in the vanilla UI.

You don’t have to have the buttons visible on screen to have something bound to them EXCEPT for that idiotic action paging system. THOSE swap out the action SLOTS in existing BUTTONS so you can’t address the actions in the slots that are swapped out.

Pick one of the NON Paging bars and identify two of the buttons. Use /fstack and roll over them. Make a note of what they are.

Substitute one of them for where I have MyButtonFrameName2 and the other for where I have MyButtonFrameName3.

I’ll post the revised macro set in a few minutes.

/run MyGS.S={"World","Fishing","Raid"} MyGS.V={} for k,v in ipairs(MyGS.S) do MyGS.V[v]=k end

That should do it.

You can replace the middle macro with any other one that has valid set names in it and then use this same construct (the three macros) on any toon.

Don’t forget to replace the button frame name placeholders with the real button names.

And again, I haven’t actually tested this yet. I’ve been busy with life.

If help is still needed, I have a couple macros on my bars that switch between:
-Regular gear and speed set,
-Regular gear and fishing set.
If that’s like what you’re referring to, I can share if desired. :smiley:

I didn’t even mention fishing in my google search but this is exactly what I was looking for.

Thank you.

My version of this problem was wanting to swap to PVP gear out of PVE gear. I have several sets for each spec. The way I got it done was rather unintuitive, but works. First make equipsets for your PVE builds name that whatever you want but be sure they have a Tabard included and worn. Then make an equipset for PVP gear without a Tabard worn. Finally, make a macro that has this text (note replace the rogue specs named sets with what you call your spec sets.

Macro:
#showtooltip
/equipset [spec:1,worn:tabard]PVP;[spec:1]Assassination;[spec:2,worn:tabard]PVP;[spec:2]Outlaw;[spec:3,worn:tabard]PVP;[spec:3]Subtlety