I modified your code for.. leveling some pets too.
Abilitity "Settings" (append):
Code:
LevelingMax = 3
LevelingMin = 1
function petBattle_switchPet()
C_PetJournal.SetFlagFilter(LE_PET_JOURNAL_FLAG_COLLECTED, true)
C_PetJournal.SetFlagFilter(LE_PET_JOURNAL_FLAG_FAVORITES, true)
C_PetJournal.SetFlagFilter(LE_PET_JOURNAL_FLAG_NOT_COLLECTED, false)
C_PetJournal.ClearSearchFilter()
local iCount = C_PetJournal.GetNumPets()
for i = 1, iCount do
petID, _, bOwned, _, iLevel, bIsFavorite, isRevoked, sName, _, _, companionID, _, _, _, bCanBattle = C_PetJournal.GetPetInfoByIndex(i)
if bOwned == true and bIsFavorite == true and bCanBattle == true then
if iLevel >= LevelingMin and iLevel < LevelingMax then
if C_PetJournal.PetIsSlotted(petID) == true then
return true
end
petBattle_log("Leveling Pet: " .. sName)
local info = C_PetBattles.GetPVPMatchmakingInfo();
if info == 'queued' then
C_PetBattles.StopPVPMatchmaking()
end
C_PetJournal.SetPetLoadOutInfo(1, petID)
if C_PetJournal.PetIsSlotted(petID) then
return true
else
return false
end
end
end
end
end
function petBattle_log(str)
if last_pet_bl == str then return end
last_pet_bl = str
print(str)
end
Ability "Queue" (replace):
Code:
qstat = C_PetBattles.GetPVPMatchmakingInfo()
canAcc = C_PetBattles.GetPVPMatchmakingInfo()
bStat = C_PetBattles.IsInBattle()
zone = GetCurrentMapZone()
if Booster == false then
if petBattle_switchPet() == false then
return true
end
end
if qstat == nil and zone == GetCurrentMapZone() and canAcc ~= "proposal" and bStat == false then C_PetBattles.StartPVPMatchmaking() end
What the do? It replace your first pet in team to another "Favorite" pet.
LevelingMax = 3 -- max level for pet
LevelingMin = 1 -- min level for pet