Macro question

Hi, pretty new and trying to play with macros a bit. I was curious if a couple things were possible. Can i make one that casts a heal when targeting a friendly and an offensive spell when targeting a hostile or yellow mob?

Can I make one that makes an aoe spell cast wherever my cursor is when i press it?

Ty, not totally sure what you can do with these.

For the second question, assuming the spell is one that brings up the green targetting reticle, the answer is yes.

#showtooltip
/cast [@cursor]Blizzard

This will cast Blizzard where your cursor is, bypassing the targetting reticle. You can also use [@player] instead to cast it at your feet. (Sadly, you can’t use [@target] or other units to cast it around your current target.)

The answer for the first question is yes! Macros can pick spells by if your target (or any unit your macro is using) are an enemy or friend.

Here’s a basic template for help/harm target macro:

#showtooltip
/cast [harm]DAMAGE SPELL;HELPFUL SPELL

So, to break down the above macro:

#showtooltip

This line will allow the game to show the tooltip for the spell it’s going to cast when you mouse over the button. (And it will update dynamically, so it will show the tooltip for DAMAGE SPELL if your target is an enemy and HELPFUL SPELL otherwise. If you choose the “?” auto select icon, it will also use the spells icon (and change it dynamically based on conditions.)

/cast [harm]DAMAGE SPELL;HELPFUL SPELL

Macro conditionals are read left to right as if/then/else statements. It will perform the first thing that is “true.” If a unit isn’t specified, then it checks against your target. So, [harm] means the same thing as [harm,@target].

So, the game will start working through the conditionals in order.

  • If your target is an enemy
    • Cast DAMAGE SPELL on that enemy
  • Else
    • Cast HELPFUL SPELL (with no conditionals, it will use the default conditions, as if you clicked the spell from the spell book. An empty conditional [] can also be used here, but isn’t necessary if it’s the only conditional to cast a spell as in this case.)

Many people will use mouseover macros for healing spells. That allows you to cast a healing spell on someone just by hitting the macro key while hovering over their unit frame (or the player themselves out in the world) without having to target them.

So, a variation of the above macro adding a mouseover conditional:

#showtooltip
/cast [@mouseover,help,nodead][help,nodead]HELPFUL SPELL;DAMAGE SPELL
  • If your mouse is over a friendly living unit,
    • Then cast HELPFUL SPELL on your mouseover
  • Else if your target is friendly and alive
    • Then cast HELPFUL SPELL on your target
  • Else
    • Cast DAMAGE SPELL using default conditions.

If you wanted a different priority for stuff:

#showtooltip
/cast [@mouseover,help,nodead]HELPFUL SPELL;[harm,nodead]DAMAGE SPELL;[help,nodead][]HELPFUL SPELL
  • If your mouse is over a friendly living unit
    • Then cast HELPFUL SPELL on your mouseover
  • Else if your target is an enemy and alive
    • Then cast DAMAGE spell on your target
  • Else if your target is friendly and alive
    • Then cast HELPFUL SPELL on your target
  • Else
    • Cast HELPFUL SPELL using default conditions.
1 Like

Thank you! This is insanely helpful, i wish i had more than a like to give you :slight_smile: