First: great Add-on, loving it!
The one thing i noticed is, that when you auto fill the leveling list, there is no guarantee, that your highest level pet is chosen for the queue. For example, if you have a level 10 and a level 20 pet of the same species, the level 10 pet might end in the queue, which are wasted levels if you aim to get every species to level 25.
I came up with a solution, by filtering the pets with a custom script before auto filling the queue.
The script selects the pets with the highest level and xp progress from every species.
Code: Select all
-- Collected battle pets with the highest level.
if not levels then
levels = {}
xps = {}
for petID in AllPetIDs() do
if canBattle and owned then
if not levels[C_PetJournal.GetPetInfoByPetID(petID)] then
levels[C_PetJournal.GetPetInfoByPetID(petID)] = 1
end
if not xps[C_PetJournal.GetPetInfoByPetID(petID)] then
xps[C_PetJournal.GetPetInfoByPetID(petID)] = 0
end
if levels[C_PetJournal.GetPetInfoByPetID(petID)]<select(3,C_PetJournal.GetPetInfoByPetID(petID)) then
levels[C_PetJournal.GetPetInfoByPetID(petID)]=select(3,C_PetJournal.GetPetInfoByPetID(petID))
xps[C_PetJournal.GetPetInfoByPetID(petID)]=select(4,C_PetJournal.GetPetInfoByPetID(petID))
end
if levels[C_PetJournal.GetPetInfoByPetID(petID)]==select(3,C_PetJournal.GetPetInfoByPetID(petID)) then
if xps[C_PetJournal.GetPetInfoByPetID(petID)]<select(4,C_PetJournal.GetPetInfoByPetID(petID)) then
xps[C_PetJournal.GetPetInfoByPetID(petID)]=select(4,C_PetJournal.GetPetInfoByPetID(petID))
end
end
end
end
end
if canBattle and owned and levels[speciesID]==level and xps[speciesID]==xp then
return true
end
Problem here is, if you use the default rare filter with this script and you have an uncommon pet that has the highest level of it's species, the species is left out. So if you only care for rares use this version:
Code: Select all
-- Collected rare battle pets with the highest level.
if not levels then
levels = {}
xps = {}
for petID in AllPetIDs() do
if canBattle and owned and select(5,C_PetJournal.GetPetStats(petID))==4 then
if not levels[C_PetJournal.GetPetInfoByPetID(petID)] then
levels[C_PetJournal.GetPetInfoByPetID(petID)] = 1
end
if not xps[C_PetJournal.GetPetInfoByPetID(petID)] then
xps[C_PetJournal.GetPetInfoByPetID(petID)] = 0
end
if levels[C_PetJournal.GetPetInfoByPetID(petID)]<select(3,C_PetJournal.GetPetInfoByPetID(petID)) then
levels[C_PetJournal.GetPetInfoByPetID(petID)]=select(3,C_PetJournal.GetPetInfoByPetID(petID))
xps[C_PetJournal.GetPetInfoByPetID(petID)]=select(4,C_PetJournal.GetPetInfoByPetID(petID))
end
if levels[C_PetJournal.GetPetInfoByPetID(petID)]==select(3,C_PetJournal.GetPetInfoByPetID(petID)) then
if xps[C_PetJournal.GetPetInfoByPetID(petID)]<select(4,C_PetJournal.GetPetInfoByPetID(petID)) then
xps[C_PetJournal.GetPetInfoByPetID(petID)]=select(4,C_PetJournal.GetPetInfoByPetID(petID))
end
end
end
end
end
if owned and canBattle and select(5,C_PetJournal.GetPetStats(petID))==4 and levels[speciesID]==level and xps[speciesID]==xp then
return true
end
Hope that's helpful for some of you. And Gello, feel free to modify and add the scripts to your add-on as you like.