Casts Pyro if you’re not in combat (as an opener), Fireball otherwise
/cast [nocombat] Pyroblast; Fireball
a slight improvement on the above macro, for button mashers
/castsequence [nocombat] reset=combat Pyroblast, Fireball; Fireball
Functions exactly the same way, except that if you are button mashing it won’t attempt to cast pyroblast again in that small space before you enter combat after casting.
Another one, defaulting to Pyroblast out of combat, and fireball in combat, but letting you hold alt to switch:
/cast [nocombat,modifier:alt] Fireball; [nocombat][combat,modifier:alt] Pyroblast; Fireball