There is the following events fired when you start/finish a petbattle
Code:
PET_BATTLE_OPENING_START
PET_BATTLE_FINAL_ROUND
info here:
http://wowprogramming.com/docs/events
For emotes you can use the DoEmote(TOKEN) function.
TOKEN is a string telling the API what emote to perform.
Code:
DoEmote("CHICKEN"); --this will do the chicken emote
All emote tokens are defined in \Interface\FrameXML\ChatFrame.lua They are defined in global variables called "EMOTE<number>_TOKEN"
They are sequential up until 170, then there is suddenly a gap. Either use a hardcoded list or a loop of some sort if you want to enumerate them all.
Code:
local maxID = 500; --A number well beyond the number of emotes available ingame at the moment
for i=1, maxID do
local tmpName = "EMOTE".._tostring(i).."_TOKEN";
local tmpToken = G[tmpName];
if (tmpToken ~= nil and type(tmpToken) == "string") then print(tmpToken); end
end--for i