Help with macro please

Hey guys im trying to set up some macros for my resto sham, what im trying to do if im targeting an ally my spell will hit their target but if im targeting and enemy my spell will target them.

Im trying to set this up with flame shock, lightning bolt and lava burst

Pins are your friend :wink: