Mouseover question

Hello,

I am trying to setup a macro that does the following

If I have a mouseover target that is friendly: cast Holy Shock on that friendly target, if mouseover is hostile, cast Holy Shock on hostile.
If mouseover on myself, cast Holy Shock on myself
If i have a target and no mouseover target, cast holy shock on target
if no target and no mouse over, cast on myself

but I just can’t seem to figure out how to get it to do it with those instructions.

I have this

#showtooltip
/cast [@mouseover,harm,nodead]Holy Shock
/cast [@mouseover,help,nodead][@player]Holy Shock
/cast [@target,exists]Holy Shock

Basically I want it to cast on whatever I have mouse’d over (including myself) first, if i have no mouse over it casts on my target, and if no target, casts on myself

if possible i would like to have no modifiers in the macro

I guess the main hang-up is it’s not healing me if i have myself moused over but i have a target. Is it even possible for it to prioritize yourself if you have yourself moused over with a target?

Okay, one issue I see is that without modifiers you shouldn’t ever get past the @player part because YOU will always be there.

What I do with this sort of thing is put a modifier ONLY on the @player part and then something like this:

#showtooltip
/cast [@player,mod][@mouseover,exists,nodead][exists,nodead]Holy Shock

If I’ve done that right, with no modifier you’ll cast on any living mouseover or your target (doesn’t really matter about help/harm as you want a cast regardless - it just does different things on help vs harm).

If you do have ANY modifier key held down, it’ll cast on your.

I think that may be as good as it gets for this, but someone may prove me wrong.

So basically, your player in the 3d world is not a valid mouseover target and/or is ignored for mouseover commands? I feel like this might be by design and it may be impossible. I may just have to get used to hovering over my own portrait to selfcast if I have a target, because that works, but if i mouseover myself in the 3D world, it does not seem to see myself as a valid mouseover target.

“player” is a unit, “mouseover” is a unit. Just like “target” and “pet” and “focus” and “nameplateN” and “raidN” and “partyN” and “arenaN” are all units.

You can’t put two units on one macro conditional bracket and putting them in TWO brackets adjacent doesn’t apply the first set of conditionals to the second.

The basic logic structure for macro conditionals is this:

/cast [A,B,@AUnit][C,D,@ADifferentUnit][@player][]Something

That means this:

if A and B then
    do Something to AUnit
elseif C and D then
    do Something to ADifferentUnit
elseif "player" exists and is not dead (implied by you being able to take action at all)
    do Something to player
else (an impossible condition here it'll never happen)
    do Something as if you were clicking it from the spellbook

The @player in your macro is an unconditional targeting of Holy Shock

/cast [@mouseover,exists,nodead][@target,exists,nodead][@player] Holy Shock

Wouldn’t that do it? It looks like you want to always cast on your mouseover (regardless if it is an enemy, friend or yourself) so why divide that into three different cases?

Edit: need to include exists, because nodead doesn’t imply exists.

If that’s what he wants. He had @player at a higher priority in his original macro though.

When I try this, it still casts on target even if i am moused over my character in the 3D world. If i mouse over my self-protrait or self raid frame then it will cast on myself, but not if i just mouse over my character itself, which is why I am begining to think your character is not a valid mouseover target for spell casts, or at least not in this way.

Oh! Good point. Your own self in the middle of the screen does not react to @mouseover.

Honestly, I never even noticed!

/console NameplatePersonalClickThrough 0
/console NameplatePersonalShowAlways 1
/reload

With that, you will always have something responsive to mouseover on retail.

Another option would be to create a SecureUnitButton right in the middle of the screen, roughly the size of your character, and assign its “unit” attribute to “player”. I would give it a background frameStrata.

2 Likes

This actually seems to be working with what I have been testing so far, thanks!

I wonder why this is not standard from Blizzard to be able to mouse over your character in the 3D world and treat it like a mouseover target

Another option would be to create a SecureUnitButton right in the middle of the screen, roughly the size of your character, and assign its “unit” attribute to “player”. I would give it a background frameStrata.

I feel the zoom level would kind of mess this up since if you’re zoomed out at max and someone is right on you wouldn’t that box sort of block out your ability to mouseover a target that is right in front of you since it would extend out bigger then your character? Might have to lock your zoom level and get used to the box size (if I were to do this anyway, if that’s how it worked)

I use ElvUI and move my unit frame to the bottom center of the screen for just this reason.

It’s not a “button” but it is a secure frame and you can cast on it.

Also one other thing, is there any way to allow using MB3 and MB4 on party/raid frames? I have 2 hotbar buttons bound to those mouse buttons but they will just not fire off if I am hovering over a party/raid frame

Click casting doesn’t work on Unit Frames unless you have Clique or a similar mod installed.

Edited to add: Casting using a button when you’re hovering over a Unit Frame is different from click casting. That should work. if you’ve bound mouse button 4 to a button or a macro my understanding is that it should work on Unit Frames, but I don’t use that technique or understand it terribly well, so take that with a grain of alt.

I swear people never read the pins…

This is all you need.

#showtooltip
/cast [mod:alt,@player] [@mouseover,exists,nodead] [] Holy Shock

[added]
Correct, you cannot mouseover your 3D self (or click it), otherwise you’d never be able target anything at your feet, you’d always be in the way.

Mouse buttons cannot interact with unitframes without using an addon like Clique, they eat all non-default mouse interactions.

This is all you need.

That macro will not work with what I was trying to accomplish.

[added]
Correct, you cannot mouseover your 3D self (or click it)

Dahk was actually kind enough to dig up some console commands that has allowed me to accomplish what I have been trying to do, which is have my 3D world model be mouseover-able and so far is it working for what I have tried.

otherwise you’d never be able target anything at your feet, you’d always be in the way.

It’s all about the camera angles - though that is a good point for why it may not be standard, although I feel like they could add an option. My muscle memory always has be pan my camera so my target is off to the side, so what Dahk has provided via console command was what I needed.

Mouse buttons cannot interact with unitframes without using an addon like Clique, they eat all non-default mouse interactions.

I will definitely have to give that addon a try as I use mb3 and mb4 for so many things and it would be nice to be able to allow them to be used on frames as well.

Technically not what it’s doing but I’m glad it’s working for you :slight_smile: