Mouseover / target macro

Helloes.

Been absent for a long time, I've lost the ability to do macros and I've lost every macro I had.

Anyways, trying DH out, I thought I'd get myself a mouseover macro for Imprison, but I also want the macro to work if I click a mob so I have it in target. Meaning I wanna be able to Imprison if targetted, but if I just wanna mouse over it, I'll still cc it.

#showtooltip Imprison
/cast [mod:shift,@focus][@mouseover,harm] Imprison

This is my mouseover macro but it doesn't work if I target something, in this case I HAVE to mouseover.
Here's how macros work:
After the /cast command u have a sequence of modifiers.
The system always consults it self with the 1st modifier, if the criterias set by it are matched, then the spell is executed.
If the criterias aren't matched, then it moves on to the 2nd modifier - if that one holds, then it executes the spell, and again, if it doesn't then it moves on and so on and so forward.
So in your case u have:
/cast [mod:shift, @focus]
If this is met, it executes the spell directed to your focus target, if not, it moves on to the 2nd modifier:
[@mouseover, harm]
If this is met then it executes the spell directed to your mouseover, also hostile target. If that mod isn't met then the system moves on... BUT, in your case u have no more modifiers within the macro which is why it doesn't work.
So what u do is u simply add a 3rd modifier which has no conditions inside [] meaning that the system will always execute the spell as long as none of the prior modifiers are met.
So in the end your macro would look like this:
/cast [mod:shift, @focus][@mouseover, harm][] Imprison
13 Likes
Wow Sterix, what a great explanation, not only did you help a lost fella, you also explained the whole thing clearly, and for that I thank you alot!
On my assassination rogue, I am trying to make a macro for coming out of stealth and dotting a few targets with Garrote.

I want the 1st conditional to be mouseover, but if I make a mistake and my mouse isn't over an enemy when I cast, it will just default to my current target.

I am using:

/cast [@mouseover, harm] [] garrote

It works as intended except for one problem: when my mouse is over an enemy that is out of range, it does nothing at all to anything.
That's one of the limitations of macros, they cannot check if your mouseover/target is in range.

You can't completely automate the process and still need some human brain power to execute combat correctly. WoW's macros are like this by design.