Code:
##FIRE##
#showtooltip Fireball
#VARIABLES
/run c=CastSpellByName cd=GetSpellCooldown b=UnitBuff d=UnitDebuff mana=UnitPower("player")/UnitPowerMax("player") p="player" t="target" u=IsUsableSpell r=IsSpellInRange s=GetUnitSpeed("player") hp=UnitHealth hpm=UnitHealthMax ma="Molten Armor" cau="Cauterize" block="Ice Block" lb="Living Bomb" comb="Combustion" pyro="Pyroblast" hot="Hot Streak" crit="Critical Mass" fo="Flame Orb" mi="Mirror Image" fire="Fireball" int="Arcane Brilliance" mm="Mirror Image"
#START ATTACKING
/run if UnitHealth(t)==0 and UnitIsEnemy(p,t) then ClearTarget() end;
/startattack
#ARCANE BRILLIANCE
/run if not b(p,int) then c(int) end;
#MOLTEN ARMOR
/run if not b(p,ma) then c(ma) end;
#MIRROR IMAGE
/run if UnitAffectingCombat(p)==1 and cd(mm)==0 then c(mm) end;
#CAUTERIZE
/run if b(p,cau) and cd(block)==0 then c(block) end;
#REMOVE ICEBLOCK
/run if d(p,cau) and b(p,block) then CancelUnitBuff(p,block) end;
#INTERRUPT
/run if select(9,UnitCastingInfo('target'))==false and cd("Counterspell")==0 and r("Counterspell")==1 then c("Counterspell") end;
/run if select(8,UnitChannelInfo('target'))==false and cd("Counterspell")==0 and r("Counterspell")==1 then c("Counterspell") end;
#MANA GEM
/run if UnitAffectingCombat(p)==1 and mana<0.8 then RunMacroText("/use Mana Gem") end;
#COMBUSTION
/run if d(t,lb) and d(t,"Pyroblast!") and d(t,"Ignite") and cd(comb)==0 and hpm(t)>1000000 then c(comb) end;
#IMPACT
/run if d(t,lb) and d(t,"Pyroblast!") and d(t,"Ignite") and b(p,"Impact") and r("Fire Blast",t) and cd("Fire Blast")==0 then c("Fire Blast") end
#MANA SHIELD
/run if cd("Mana Shield")==0 and not b(p,"Mana Shield") and select(2,GetInstanceInfo())=="pvp" then c("Mana Shield") end
#ROTATION
/run if r(lb,t)==1 and u(lb) and not d(t,lb,"",p) and r(lb,t)==1 then c(lb) elseif u(fo) and cd(fo)==0 and r("Fireball",t)==1 then c(fo) elseif b(p,hot) and r(pyro,t)==1 then c(pyro) elseif (s>0 or mana<0.05) and r("Scorch",t)==1 and cd("Scorch")==0 then c("Scorch") elseif (b(p,"Heroism") or b(p,"Time Warp") or b(p,"Dire Magic") or b(p,"Lightweave") or b(p,"Battle Magic") or b(p,"Volcanic Power") or b(p,"Power Torrent") or d(t,"Pyroblast!")) and cd(comb)==0 and u(comb)) or mana>0.05 and cd(fire)==0 and r(fire,t)==1 then c(fire) end;
#CRITICAL MASS
/run if b(p,hot) and r(pyro,t)==1 and cd(pyro)==0 then c(pyro) elseif not d(t,crit) and not d(t,"Shadow and Flame") and r("Scorch",t)==1 and cd("Scorch")==0 then c("Scorch") end;
/script CombatLogClearEntries();
/run UIErrorsFrame:Clear();
/run StaticPopup_Hide("MACRO_ACTION_FORBIDDEN");
Whatever you don't want, just comment # the line out. Right now it'll cast Mana Gem is below 80% mana, cast Arcane Brilliance, Molten Armor, Impact if target has LB/Ignite and Pyroblast debuff, Iceblock if Cauterized, and Interrupt is target is casting.