how to make a macro like vanilla?
/script if UnitExists("target") then if a==0 then PetAttack(target) CastPetAction(4) a=1 else if UnitExists("pettarget") and UnitIsUnit("target", "pettarget") then PetFollow() a=0 else PetAttack(target) CastPetAction(4) end;end; else PetFollow("") a=0 end;