It seems WOTLK lua API is missing the API call to summon a random minipet.
I was trying to backport to WOTLK some retail add-ons that auto summons mini pet but none of the versions of the script to summon random pets seems to work.
That lua script was added in patch 3.3
During Pandaria in Retail that script was moved to the API collection C_PetJournal for the new pet journal added when mini bet became battlepets
Usually, Classic versions always used the modern APIs from retail with the ones for features not available on such Classic versions removed but neither the original nor MOP version of the script seems to work. I have the impression that maybe some dev removed the whole C_PetJournal collection in the process of removing the modern pet journal for the client but doing that they also removed part of the script that was originally in WOTLK.
That is the problem, there is no command available. Every version of the command, the one that works with the pet journal and the one that was made before the pet journal does not work in Classic, and that one was from the original Wrath, so it should be available in Classic Wrath, but it is missing.
I do not want a pet journal like in Retail. I want to be able to summon random pets like in the original Wrath, I do not care what of the two scripts they implement in Classic, or a new one, as long as it works.
Yeah, it was an addon. But addons work because Blizzard exposes in the game LUA APIs with functions available for an addon to make actions in the game, like use items or summon a pet. In this case, there was a LUA API available for add-ons to summon a random pet, without needing to check all the player pet collections and make a random calculation, the game already does it.
The pet journal is from Mist, yes. But this API was added during Wrath, it was an isolated API added in Wrath that was moved inside the API namespace of the Pet Journal in Mist. So, instead of removing it with the rest of the pet journal, they should had move out of it to become again an isolated API (Or create a new API namespace for Wrath Pet Collection, because Blizzard devs nowadays want everything inside namespaces)
You have misunderstood me. I am a developer. I want to make an addon. This topic is about the LUA API calls, not macro commands.
I already have in-game a macro like that for myself, but that has many inconveniences and limitations, that its why I want to make and publish an addon like PetLeash or PetWalker from retail.
Thanks, that help me a lot. I will use that in my addon. I tried to search for the API calls based on code examples from Retail and none of those addons I looked at used that API call, that was my mistake.