Problem with Mouseover macro

Trying to set up a Moonfire mouseover macro. But every time I try it always tells me an invalid target. I am using this macro for Sunfire and its works, but when you change the spell to Moonfire I am no longer able to mouseover over target.

Please Help

#showtooltip Sunfire
/cleartarget [dead]
/targetenemy [noharm]
/cast [@mouseover,harm,nodead][@focustarget,harm,mod][harm,nodead]Sunfire
/script UIErrorsFrame:Clear()
/console Sound_EnableE
/startattack
/cast Barkskin

I could be wrong, but I think this macro is trying to cast bark skin on the enemy target.

I hate to be that guy but why are you trying to make such a complicated macro that includes barkskin and sunfire together. Also you need to be more specific about what exactly you are trying to achieve with the macro. And if whatever you are trying to do is working with sunfire, then it should work the exact same with moonfire.

What are you trying to accomplish here? It seems like you’re trying to overcomplicate a solution to a problem that doesn’t exist.

You shouldn’t be casting barkskin on cooldown. Use it when you know damage is coming, otherwise you will never have it when you need it.

Now using mouseover macros for moonfire/sunfire is not a bad idea at all, and a lot of people do that. However, the macro for that is hugely less complicated.