Targeting macro

Hey all, I’ve been scratching my head over how to write a macro that does the following:

  • Selects the mouseover target if there is one, and I don’t have a current target
  • Selects the nearest target if I have no target or mouseover (like tab targeting)
  • Casts an ability (I’ll use the example Death Grip here) on a mouseover if available, otherwise my target

Casting the ability on who I want is working with this:
/cast [@mouseover,harm,nodead] Death Grip; Death Grip

The problem is the targeting bit. I tried this:

/target [@mouseover,harm,nodead] mouseover
/targetenemy [notarget]

As expected, this does everything correctly except it targets my mouseover when I already have a target, instead of just death gripping the mouseover and keeping my current target.

When I add an argument “notarget” like so:

/target [notarget,@mouseover,harm,nodead] mouseover
/targetenemy [notarget]

Targeting the mouseover always fails, even when I have no current target. The next line takes precedence and I select the nearest target (like tab targeting) even if I have the mouse over something else.

Any ideas?

I do this with macro chaining.

Macro Name: _TGT1 (read _ as space - it helps - trust me)
Macro Placement: ButtonFrameName1
Macro Text:

/dismount
/cleartarget [noharm][dead][mod]
/targetenemy [noexists][noharm][dead][mod]
/click ButtonFrameName2

Macro Name: _TGT2 (Hunter Only)
Macro Placement: ButtonFrameName2
Macro Text:

/petautocaston [nogroup:raid][@focus,exists,nohelp][@focus,noexists][@focus,dead]Growl
/petautocastoff [group,@focus,help,nodead][group:raid]Growl
/cast [nogroup:raid,group,@focus,help,nodead][@pet,exists,nodead]Misdirection
/click ButtonFrameName3

Macro Name: _TGT3 (Hunter Only)
Macro Placement: ButtonFrameName3
Macro Text:

/petattack
/petassist
/cast Bite
/cast Claw
/cast Smack

Macro Name: Targeted Ability
Macro Placement: Discretionary
Macro Text:

#showtooltip
/click ButtonFrameName1
/cast [@mouseover,harm,nodead][harm,nodead][]Targeted Ability

This has the effect of continuing to attack whatever you’re already attacking unless that thing dies, becomes unharmable in some game-mechanics way, or you indicate that you want to switch to the NEW nearest target in your forward cone by holding down any modifier key.

Either because you’re changing targets or because you don’t have one, the nearest target in your forward cone will be selected as your target and you (and your pet(s) if you’re a hunter) will attack switch to that new target seamlessly.

That can be overridden on a temporary basis by mousing over an live enemy unit in which case the attack will be directed to your mouseover unit for as long you it remains your mouseover unit and then it will return to your target unit when you move off of it.

Each of your targeted abilities should be set up this way. Doesn’t matter if it’s just an interrupt or a polymorph that you THINK you’ll only use on mouseover. Set it up this way and if your actual target unit needs to be interrupted or sheeped, it’ll be ready. If you need a different unit to be interrupted or sheeped, mouseing over it will work just fine (see below).

I’ve been using this or something very like it for years and it works very well.

It can be tweaked - you can set your CVARS to prefer enemy PLAYERS for complex battlegrounds (think - EPIC BGs) or you can insert a macro in the chain for priority raid targets that sometimes need to be focused down when they pop up, but the basic structure is sound and proven.

1 Like
#showtooltip
/startattack
/cast [@mouseover,harm,nodead] [] Death Grip

This is the line I add to my macros which will target my enemy mouseover if I don’t already have an enemy target. If you want it to work on both enemy and friendly targets, change each “harm” to “exists”.

/tar [harm,nodead][@mouseover,harm,nodead]

2 Likes

This does exactly what I was looking for, thanks!