What is wrong with this macro?

#showtooltip
/use [nomod] Enchanted Fey Dragon
/use [mod:ctrl] Argi
/use [mod:alt] Grand Expedition Yak

I’m going for a simple macro with which I can summon my Fey Dragon by default, my Yak by pressing alt, and lastly, my Argi (battlepet) by pressing ctrl. The mounts part of this macro work fine, although I can’t seem to get my Argi to summon?

Any help would be appreciated. Thanks! :grin:

Dont think you can summon pets with /use or /cast, you have to use pet journal functions.

This should work but you wont be able to set its tooltip, if you really want the tooltip to display and dynamically change you’ll either have to move it to its own small addon or get an addon like macro extender.

/run local x,y=SecureCmdOptionParse,CastSpellByName if x"[mod:ctrl]" then C_PetJournal.SummonPetByGUID(select(2, C_PetJournal.FindPetIDByName("Argi"))) elseif x"[mod:alt]" then y("Grand Expedition Yak") else y("Enchanted Fey Dragon") end

#showtooltip [mod:alt]Grand Expedition Yak;[mod:ctrl]Argi;Enchanted Fey Dragon
/use [mod:alt]Grand Expedition Yak;[nomod]Enchanted Fey Dragon
/summonpet [mod:ctrl]Argi

Hijacker - this works on both generic pet names and custom pet names (I tested this on a core hound pup I named “Burny McBurnburn” and on an unnamed (by me) Boneshard pet and both worked).

Klingah - this link is your friend.

https://wow.gamepedia.com/Macro_commands

Virtually everything to do with anything tactical can and should be done through the macro api rather than through Lua code.

There are (rare) exceptions but these are fairly basic commands and there’s just no need for that code.

Forgive my being a complete newb, but… when I put that code into a macro, it warns me that I am running a script and that it may damage my account. What’s that about?

The first time on any account that you run Lua from a script you’ll get that warning.

It’s safe to ignore.

That said, the Lua script just isn’t necessary for what you’re asking for.

There are already perfectly good macro api commands that will do all of it including showing the proper icons and cooldowns.