Castsequence macro (mouseover)

Hello,

I’m trying to build a castsequence macro that resets whenever I mouseover a different target. Additionally, (if this is possible) if I don’t have my cursor on a target, it’ll cast on what I’m currently targeting. Trying to get this to work with Moonfire, Sunfire.

Not possible.
https://wow.gamepedia.com/MACRO_castsequence

As Elvenbane said, not possible.
A Castsequence can be reset by Time, when you change the Target, Exit the Combat or Push a Modifier.

That said, if what you want is a Castsequence that flips between Moonfire and Sunfire, that resets after a certain amount of Time and when you switch the Target/Exit Combat it would look like this here:

/castsequence [@mouseover, harm, nodead] [] reset=10/target/combat Sunfire, Moonfire

I didn’t check does this here work, as i am not at my PC and in game right now …

There’s really no need for a macro like this anyway. Sunfire hits a group of mobs and Moonfire hits 1 or 2. Just make mouseover macros with a mod for Sunfire as u use it less frequently.