Help with a simple dot sequence macro

Hello, guys.

I have been trying to “clear” my spells bar, and for such, I would like to make a simple dot sequencer macro.

It would go kinda like this, in order of priority:

(Send pet) Haunt > Unstable Affliction > Agony > Corruption. It would reset in case haunt and or unstable affliction comes off cooldown and if I switched targets. Is this feasible?

The other spells would be on easy reach, and I know my rotation. Could anyone give me a hand with this? Thanks!