@mouseover with no existence check (any target conditional that doesn’t have a “no” in front of it like harm or dead) will lock up at that point because you’re essentially saying “cast on my mouseover unit whether it’s there or not” and it doesn’t make it to the next step.
I honestly think at this point you’d be better off with a small addon that simply changes the macro every time you change your PVP talents and sets it to the correct one.
Assuming you’ve named the macro DisarmOrDuel this code will work (minus the event registration part).
<register the event - not sure which one>
local function PVPTalentChangedHandler(preferPerCharacter)
local c = UnitClass('player')
local s = GetSpecialization()
if c == 'WARRIOR' and s == 1 then
local _, _, _, _, _, _, disarmKnown = GetSpellInfo('Disarm')
local _, _, _, _, _, _, duelKnown = GetSpellInfo('Duel')
if not (disarmKnown and duelKnown) and (disarmKnown or duelKnown) then
local t1 = ((duelKnown and 'Disarm') or 'Duel')
local t2 = ((disarmKnown and 'Disarm') or 'Duel')
local n, i, b, l = GetMacroInfo('DisarmOrDuel')
if n then
gsub(b, t1, t2)
EditMacro(n, b, i, l)
else
local gl, pc = GetNumMacros()
if (gl + pc) = (MAX_ACCOUNT_MACROS + MAX_CHARACTER_MACROS) then
print("No room in your macro library for another macro.")
else
local storePerCharacter
if preferPerCharacter then
if pc < MAX_CHARACTER_MACROS then
storePerCharacter= true
else
storePerCharacter= false
end
else
if gl < MAX_ACCOUNT_MACROS then
storePerCharacter= false
else
storePerCharacter= true
end
end
CreateMacro('DisarmOrDuel',
'INV_Misc_QuestionMark',
'#showtooltip\n'..
'/use Gateway Control Shard\n'..
'/cast [@mouseover, harm, nodead][harm, nodead]'..t2,
storePerCharacter)
end
end
else
print('You do not know either Disarm or Duel.')
end
else
-- skipping the update - not an Arms Warrior - no print
end
end
Formatting is a little wonky for actual code - I needed to chop up some lines to make it fit in the forum window a little better.
I haven’t tested this, but even if it’s got an error or two, it’s a good running start at the necessary code.
This will (assuming it works) verify that you are an arms warrior, that you know one or the other of the two spells, update the macro in place (under the name I chose - change that if you need to), or create the macro - it verifies that you have enough space to store a macro and places it in your preferred location (perCharacter or global) if there is room in that space and in the other location if not - with appropriate messages if something goes wrong.