Pet item link in macro

I am trying to create a macro for selling items in trade chat. So far with basic items I have this:

/run SendChatMessage(format("WTS %s", select(2, GetItemInfo(x))), "CHANNEL", nil, GetChannelName("Trade - City"));

where x is item id.

But how do I do this with battle pets? I want to link the specific pet I have with breed, level, rarity etc. How can I get that item link and use it in a macro?


EDIT:
This also applies to items with ilvl upgrades or sockets/stats like leech. Is there a function get the item string of your item (or caged pet) while mouseovering it or something?

I used macro like yours before and got curious how far we can take this so I googled some stuff.
I didnt found how to link mouseover items, but found how to link items from bags, so you can work with that.
/run SendChatMessage(“WTS “…(GetContainerItemLink(0, 1))…”!!!”,“CHANNEL”,nil,2)

That works if the item is in the bags. I usually have all the items up on AH at the same time while trying to sell them on trade chat for a little bit cheaper.

So in this case that unfortunately doesn’t help much :confused:

petlink = string.format("%s|Hbattlepet:%s:%s:%s:%s:%s:%s|h[%s]|h|r", ITEM_QUALITY_COLORS[quality].hex, speciesID, level, quality, health, power, speed, name)

with
name = C_PetBattles.GetName()
speciesID = C_PetBattles.GetPetSpeciesID()
level = C_PetBattles.GetLevel()
quality = C_PetBattles.GetBreedQuality()
health = C_PetBattles.GetMaxHealth(number, i)
power = C_PetBattles.GetPower(number, i)
speed = C_PetBattles.GetSpeed(number, i)

but i dont see how you could put that into a macro.

gamepediaDOTcom/World_of_Warcraft_API#Pet_Battle_Functions
(replace the DOT with a . as I am not allowed to post links…)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.