Is there a script to delete Battle Pets?

UI and Macro
Post Limit:
Anyone who has the achievement for Mr. Bigglesworth has this problem, where he constantly dupes himself until he is 3/3 slots.

Is there a script that allows us to remove specific battle pets? Since you lose the function to delete them when they're 1/3 slots, it doesn't seem like it'd have repercussions. Would just save the annoyances being able to press a button and nuking them every time someone logs in instead of manually removing each one.
Untested but try:

/run C_PetJournal.ReleasePetByID(select(2,C_PetJournal.FindPetIDByName("Mr. Bigglesworth")))
Haha! It works! Thank you very much, sir gnome.
Very sorry to necro an old thread, but I'm trying this on the PTR and it isn't cooperating. Any ideas, please and thank you? I'd love to clear out my journal for some better random pets.
Well what does this output with the appropriate pet name?/dump select(2,C_PetJournal.FindPetIDByName("Mr. Bigglesworth"))
Using Wind Rider Cub in practice because I want to keep Biggs, but this is what I get:

Dump:value=select(2,C_PetJournal.FindPetIDByName("Wind Rider Cub")) [1]="0x000000000040071D"

So I am assuming that the pet ID is 40071 or some permutation of the non-zero values; let me try mangling the original script to see what happens.

Edit: No good so far, but then again, I do not program. :P

Edit 2: Interesting development. The script above only works on those pets that have the release option in their right-click menu in the pet journal. Gaaah. I need to get rid of those otherwise-undeletables that just junk everything up. :(
The pet's GUID is the full number that was output, including the 0x part (which signifies it as being hexadecimal instead of decimal). Since Lua's number type can't represent the full range of values in a GUID, WoW uses strings (text) instead.

Any time you want to enter a GUID, you need to put quotation marks around it to make it a string; otherwise Lua will treat it as a number (which probably won't work).

I didn't realise that there were undeleteable pets, I'm not sure what you can do about them.

Join the Conversation