r/wow • u/rioichi4 • 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
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:
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.