A user-friendly vanity pet macro.

UI and Macro
I've put together a macro that should keep a particular vanity pet summoned. My goal was to have the Frostwolf Pup pet always out on my Shaman for that transmog swag, and this is what I came up with. I call it user-friendly because it doesn't rely on the user looking up pet ID's or GUID's but rather only needs the name of the pet entered into the macro. The name entered is as it appears in the Pet Journal which means you can enter in your renamed battle pets.

Enough with the introductions, here's the macro:

/run local _,petGUID=C_PetJournal.FindPetIDByName("Frostwolf Pup") summonedPetGUID=C_PetJournal.GetSummonedPetGUID() if petGUID~=nil and summonedPetGUID~=petGUID then C_PetJournal.SummonPetByGUID(petGUID) end


Simply replace "Frostwolf Pup" with "YOUR DESIRED PET'S NAME"

A little more advanced stuff:

As it is, the macro comes out to 209 characters which doesn't really let you combine macros easily. Summoning a pet is also on the GCD which means you can't summon your pet and cast a spell on the same button. In order to get the macro on a commonly used button to ensure I have my vanity pet out as often as I can and to have the macro not conflict with spell casts, I put it on my mount button.

This required me changing and naming the original pet summoning macro so that it can be called in my mount macro.

The changed pet macro simply removes the "/run " from the beginning and, for my personal use, is renamed 'pup,' making it look like this:

local _,petGUID=C_PetJournal.FindPetIDByName("Frostwolf Pup") summonedPetGUID=C_PetJournal.GetSummonedPetGUID() if petGUID~=nil and summonedPetGUID~=petGUID then C_PetJournal.SummonPetByGUID(petGUID) end


Then I added the line

/run RunScript(GetMacroBody("pup"))


to my mount macro. Because summoning a mount doesn't trigger the GCD, it's fine to use that button press to make sure my desired pet is out and at my side.

In case anyone wanted to see how I included the RunScript line into my mount macro, here's how that looks:

#showtooltip [flyable]Red Flying Cloud;Armored Frostwolf
/run RunScript(GetMacroBody("pup"))
/use [flyable,nobtn:2]Red Flying Cloud;Armored Frostwolf


So far the only issue is summoning the pet while in combat. It's possible to summon pets directly through the pet journal or by dragging the button to the action bars and clicking it while in combat, but I can't get the script to summon the pet while in combat. Otherwise, I haven't run into any errors. I'd appreciate any feedback you may have and I hope you enjoy the macro.
You can shorten the summon bit by about 60 characters:
/run local j,p,_=C_PetJournal _,p=j.FindPetIDByName("Frostwolf Pup") if p and j.GetSummonedPetGUID()~=p then j.SummonPetByGUID(p) end

which can fit in the mount macro:
#showtooltip
/run local j,p,_=C_PetJournal _,p=j.FindPetIDByName("Frostwolf Pup") if p and j.GetSummonedPetGUID()~=p then j.SummonPetByGUID(p) end
/use [flyable,nobtn:2]Red Flying Cloud;Armored Frostwolf

Join the Conversation

Return to Forum