Macro / command to make a macro?

I thought in the early days of WoW that I had a macro that I could use to create another macro, but now I can’t figure out how to do that.

In particular, I want a button on my bar called “Create Assist Macro”, which when I target a person (say, “MrTargetCaller”) and I click the button, creates a new macro called “Assist TC” which just does “/assist MrTargetCaller”, which I can then put on my bar which has an already bound key (mouse 5 in my case).

Why? Because I don’t want to hand-edit my assist macro every time I’m in a new BG, or in a PUG 3s arena.

Anyone know how to accomplish this?

CreateMacro(“name”, iconFileID [, “body”, perCharacter])

But imho it’d be less effort to edit a persistent “Assist” macro rather than create a new one you have to drag to your bars.

This macro:

/run local n=UnitName("target") or "pet" if not InCombatLockdown() then EditMacro(GetMacroIndexByName("Assist"),nil,nil,"/assist "..n) print("Assist set to "..n) end

will edit a macro named “Assist” to /assist whatever you had targeted when the macro was hit.

This is what I use:

/run if UnitName(“target”) then t="/assist “…UnitName(“target”) else t=” " end EditMacro(GetMacroIndexByName(“SmartAssist”), “SmartAssist”, nil, t, 1, 1)

My assist macro is called SmartAssist

I also have a SmartTarget one that I use for certain situations like if I’m healing or want a macro to target a boss. Same concept:

/run EditMacro(GetMacroIndexByName(“SmartTarget”), “SmartTarget”,nil, "/target "…UnitName(“target”), 1, 1)

Just noticed the difference between the two and remembered that I made the assist one that way so that it will clear the macro if I don’t have a target. Otherwise, it would stay that way if I didn’t have a target.

When I’m in a group, I just make the Tank my focus. Then use this macro:
/assist [target=focus, exists][target=pet]

It will also assist my pet, if I don’t have a focus.

/assist [@target,nodead,help][@pet,nodead] might help a bit.

1 Like