I have this macro that takes care of my pet, and i tryed to add some stuff to it to make it do a little more, here's the original:
/run local c=CastSpellByName if UnitExists("pet") then if UnitHealth("pet")==0 then c("Revive Pet") elseif GetPetHappiness()~=nil and GetPetHappiness()~=3 then c("Feed Pet") PickupContainerItem(3, 14) else c("Dismiss Pet") end else c("Call Pet") end
Basically, it revives my pet if dead, feed if hungry and dismiss if fed and alive.
/run local c=CastSpellByName if UnitExists("pet") then UnitAffectingCombat("player")=1 c("Mend Pet") elsethen if UnitHealth("pet")==0 then c("Revive Pet") elseif GetPetHappiness()~=nil and GetPetHappiness()~=3 then c("Feed Pet") PickupContainerItem(3, 14) else c("Dismiss Pet") end else c("Call Pet") end
Here's what i came up with to if in combat, cast mend pet, but it doesn't work and i'm not very experienced with this, so i don't know how to fix, or if it's supposed to work...