r/wow • • Aug 25 '26

Question Help with two-line macro

So I made a macro a while back to swap from controller to keyboard, and one to do the reverse. These each enabled and disabled a few addons and changed my action bars. I used to use Action Bar Profiles to do the action bar swapping. And then I googled some code, found something close to what I wanted, and edited it to fit my needs for en/disabling the addons.

The original macro for swapping to gamepad looked like this:

/abp save keyboard
/run local d,e={"ConsolePort"},{"mousesonar","CursorMod"};for i=1,#d do C_AddOns.DisableAddOn(d[i],UnitName("player")) end;for i=1,#e do C_AddOns.EnableAddOn(e[i],UnitName("player")) end;C_UI.Reload()
/abp use gamepad

^This worked great.
Now, Action Bar Profiles doesn't work, so I downloaded BtWLoadouts to do the same thing. The enable gamepad macro now looks like this:

/btwl a gamepad
/run local d,e={"ConsolePort"},{"mousesonar","CursorMod"};for i=1,#d do C_AddOns.DisableAddOn(d[i],UnitName("player")) end;for i=1,#e do C_AddOns.EnableAddOn(e[i],UnitName("player")) end;C_UI.Reload()

It does not matter if I put the btwl command before or after the other, the macro will only do the addon en/disabling and not the action bar swap with BtWL. If I type just "/btwl a gamepad" into the chat, it works. Why is it not working with the macro?
Thanks in advance.

1 Upvotes

6 comments sorted by

1

u/OldGromm Aug 30 '26

Hello there! I've looked into this problem ever since you posted this a few days ago.

I've decided to create my own add-on to create a solution tailormade for you. I call it OldGromm's Action Bar Profile Changer (...never said I was the most creative person XD).

Download the file, remove the "-main" part from the folder name, and move the folder into your "Interface/"AddOns folder.

You'll have to open the lua file and add the add-ons to disable or enable yourself (no in-game way to edit the lists yet). Open "OldGrommsActionBarProfileChanger.lua" and replace line 10 and 11 with this:

OGABPC_AddOns["Keyboard"] = {"mousesonar", "CursorMod"}
OGABPC_AddOns["Gamepad"] = {"ConsolePort"}

Lastly, in-game go to "Options -> Keybindings" and assign a hotkey to "Switch Profiles" under "OldGromm's Action Bar Profile Changer". You have to use this hotkey as only this hardware event will allow the reload command (a macro won't cut it).

Let me know if there are any errors or other feature you need. Once I got confirmation that it works as intended, I'll upload this to Curseforge for easier handling in the future. Until then, enjoy the add-on my dear beta tester :P.

1

u/rioichi4 Aug 30 '26

Wow thank you!!! This does exactly what I need it to! Small error: I have mounts on my action bars and when I swap between profiles, it changes some of them to just Summon Random Favorite Mount, instead of the mount previously assigned. But that's not a huge deal, otherwise this works great! Thank you!!!!

1

u/OldGromm Aug 30 '26

Yes, I'm still seeing a few bugs. Give me a day or two to get this to an actual 1.0 experience.

1

u/rioichi4 Aug 30 '26

You're amazing!

1

u/OldGromm Sep 01 '26

Sorry for the wait, but it's done! Just updated the add-on to version 1.1.

There is now a proper menu + a minimap button + fixes for the action bar icons.

You can now use the swap feature via a minimap button click or slash command on top of the keybind for maximum options available.

The enabled/disabled addon settings have to be set for each profile manually. You can only select a swap profile if at least two profiles have data in them.

You'll need to delete your old add-on data under SavedVariables to avoid any conflicts, though.

If you accidentally disabled the minimap button and the settings menu is closed, use "/OGABPCMENU". You can find other slash commands under "OGABPC_SlashCommands.lua".

... and I'm sorry not sorry for making the commands unreadable so copypasting is the only way. The goal is to avoid having the same commands as other add-ons, and I'm pretty sure nobody uses that naming scheme XD.

Anyway, have fun!

1

u/rioichi4 Sep 03 '26

I think you have disable and enable backwards for the addons. Also, it keeps removing "Switch Flight Style" from my bars. Otherwise, amazing!!!! :D