Shulag
03-22-2005, 10:17 AM
I have this little macro (that I copied off a forum somewhere) for healing my pet:
/script CSBN,UA=CastSpellByName,UseAction
/script if not HasPetUI() then CSBN("Call Pet") elseif UnitIsDead("pet") then CSBN("Revive Pet") elseif UnitHealth("pet")<UnitHealthMax("pet") then UA(119) end This will call my pet if it has been dismissed, revive it if it is dead, or heal it if it's wounded.
If my pet dies and I am still alive, the Pet Task Bar stays open, but inactive, and the UnitIsDead("pet") call returns a positive, and Revive Pet is cast. However, if we both die in battle, when I resurrect, the Pet Task Bar is inactive, and the UnitIsDead("pet") call returns a negative, so the macro just does an unsuccesful Call Pet.
Does anybody know whether there is another way of testing whether your pet is dead?
[EDIT] Hmmm. I see there is a ShowPetActionBar function. I shall give this a try and see what happens...
Also, while I am asking, is there a way of telling whether my rabbit pet is active?
/script CSBN,UA=CastSpellByName,UseAction
/script if not HasPetUI() then CSBN("Call Pet") elseif UnitIsDead("pet") then CSBN("Revive Pet") elseif UnitHealth("pet")<UnitHealthMax("pet") then UA(119) end This will call my pet if it has been dismissed, revive it if it is dead, or heal it if it's wounded.
If my pet dies and I am still alive, the Pet Task Bar stays open, but inactive, and the UnitIsDead("pet") call returns a positive, and Revive Pet is cast. However, if we both die in battle, when I resurrect, the Pet Task Bar is inactive, and the UnitIsDead("pet") call returns a negative, so the macro just does an unsuccesful Call Pet.
Does anybody know whether there is another way of testing whether your pet is dead?
[EDIT] Hmmm. I see there is a ShowPetActionBar function. I shall give this a try and see what happens...
Also, while I am asking, is there a way of telling whether my rabbit pet is active?