Earlier Versions
Name | Size | Uploaded | Game Version | Downloads | |
2.0.33 release | 8.10 KB | Jul 18, 2018 | 8.0.1 | 8,691 | Download |
2.0.32 release | 8.09 KB | Jul 18, 2016 | 6.2.4 | 10,488 | Download |
2.0.31 release | 7.97 KB | May 31, 2016 | 6.2.4 | 1,259 | Download |
2.0.30 release | 7.97 KB | May 25, 2016 | 6.2.4 | 710 | Download |
2.0.28 release | 7.65 KB | Oct 24, 2015 | 6.2.2 | 2,180 | Download |
2.0.27 release | 7.64 KB | Sep 11, 2014 | 6.0.2 | 4,529 | Download |
2.0.26 release | 7.67 KB | May 5, 2013 | 5.2.0 | 3,924 | Download |
2.0.25 release | 7.70 KB | Mar 5, 2013 | 5.2.0 | 1,527 | Download |
2.0.24.1 release | 7.70 KB | Dec 31, 2012 | 5.1.0 | 1,262 | Download |
2.0.24 release | 7.69 KB | Oct 26, 2012 | 5.0.5 | 1,381 | Download |
2.0.23 release | 7.67 KB | Oct 25, 2012 | 5.0.5 | 422 | Download |
2.0.22 release | 7.61 KB | Oct 11, 2012 | 5.0.5 | 772 | Download |
2.0.21 release | 7.61 KB | Sep 28, 2012 | 5.0.5 | 684 | Download |
2.0.20 release | 7.60 KB | Sep 24, 2012 | 5.0.5 | 416 | Download |
2.0.19 release | 7.64 KB | Sep 24, 2012 | 5.0.5 | 74 | Download |
2.0.18 release | 7.65 KB | Sep 20, 2012 | 5.0.5 | 121 | Download |
2.0.17 release | 7.66 KB | Sep 20, 2012 | 5.0.5 | 53 | Download |
2.0.16 release | 7.50 KB | Sep 17, 2012 | 5.0.5 | 151 | Download |
2.0.15 release | 7.49 KB | Sep 13, 2012 | 5.0.5 | 126 | Download |
2.0.14 release | 7.44 KB | Sep 11, 2012 | 5.0.4 | 116 | Download |
r137-alpha alpha | 8.20 KB | Aug 6, 2018 | 8.0.1 | 8,934 | Download |
r135-alpha alpha | 8.12 KB | Aug 6, 2018 | 8.0.1 | 10 | Download |
r134-alpha alpha | 7.80 KB | Jul 19, 2018 | 8.0.1 | 747 | Download |
r133-alpha alpha | 7.80 KB | Jul 18, 2018 | 8.0.1 | 25 | Download |
r132-alpha alpha | 8.09 KB | Jul 18, 2018 | 8.0.1 | 9 | Download |
r131-alpha alpha | 8.04 KB | Jul 18, 2018 | 8.0.1 | 9 | Download |
r130-alpha alpha | 8.01 KB | Sep 5, 2017 | 7.3.0 | 1,124 | Download |
3b1c59268169-alpha alpha | 8.04 KB | Mar 29, 2017 | 7.2.0 | 995 | Download |
e3258da68c22-alpha alpha | 8.00 KB | Dec 1, 2016 | 7.1.0 | 1,041 | Download |
3f762d561833-alpha alpha | 8.17 KB | Dec 1, 2016 | 7.1.0 | 15 | Download |
r125 alpha | 9.16 KB | Jul 19, 2016 | 7.0.3 | 362 | Download |
r124 alpha | 9.17 KB | Jul 18, 2016 | 6.2.4 | 13 | Download |
r123 alpha | 9.15 KB | Jul 18, 2016 | 6.2.4 | 10 | Download |
r122 alpha | 9.20 KB | Jul 15, 2016 | 6.2.4 | 72 | Download |
r120 alpha | 9.14 KB | Jul 13, 2016 | 6.2.4 | 58 | Download |
r119 alpha | 9.01 KB | May 31, 2016 | 6.2.4 | 12 | Download |
r118 alpha | 9.02 KB | May 31, 2016 | 6.2.4 | 54 | Download |
r117 alpha | 9.04 KB | May 31, 2016 | 6.2.4 | 30 | Download |
r116 alpha | 9.02 KB | May 25, 2016 | 6.2.4 | 13 | Download |
r115 alpha | 9.04 KB | May 25, 2016 | 6.2.4 | 12 | Download |
r114 alpha | 9.05 KB | May 13, 2016 | 6.2.4 | 69 | Download |
r113 alpha | 9.05 KB | May 13, 2016 | 6.2.4 | 37 | Download |
r106 alpha | 8.65 KB | Oct 24, 2015 | 6.2.2 | 15 | Download |
r105 alpha | 8.63 KB | Oct 17, 2015 | 6.2.2 | 86 | Download |
r104 alpha | 8.66 KB | Oct 17, 2015 | 6.2.2 | 16 | Download |
r101 alpha | 8.64 KB | Sep 24, 2015 | 6.2.2 | 85 | Download |
r100 alpha | 8.61 KB | Sep 24, 2015 | 6.2.2 | 54 | Download |
r99 alpha | 8.57 KB | Sep 24, 2015 | 6.2.2 | 19 | Download |
r98 alpha | 8.63 KB | Sep 24, 2015 | 6.1.0 | 11 | Download |
r96 alpha | 8.58 KB | Feb 25, 2015 | 6.1.0 | 206 | Download |
r95 alpha | 8.60 KB | Sep 11, 2014 | 6.0.1 | 22 | Download |
r91 alpha | 8.62 KB | May 5, 2013 | 5.2.0 | 11 | Download |
r89 alpha | 8.67 KB | May 5, 2013 | 5.2.0 | 10 | Download |
r87 alpha | 8.75 KB | Mar 5, 2013 | 5.2.0 | 9 | Download |
r84 alpha | 8.85 KB | Dec 31, 2012 | 5.1.0 | 12 | Download |
r83 alpha | 8.85 KB | Nov 29, 2012 | 5.1.0 | 152 | Download |
r81 alpha | 8.83 KB | Nov 2, 2012 | 5.0.5 | 127 | Download |
r80 alpha | 8.99 KB | Oct 26, 2012 | 5.0.5 | 11 | Download |
r79 alpha | 9.01 KB | Oct 26, 2012 | 5.0.5 | 16 | Download |
r77 alpha | 9.02 KB | Oct 25, 2012 | 5.0.5 | 13 | Download |
r75 alpha | 9.11 KB | Oct 24, 2012 | 5.0.5 | 75 | Download |
r74 alpha | 9.03 KB | Oct 11, 2012 | 5.0.5 | 12 | Download |
r72 alpha | 9.05 KB | Oct 9, 2012 | 5.0.5 | 70 | Download |
r71 alpha | 9.03 KB | Sep 28, 2012 | 5.0.5 | 19 | Download |
r68 alpha | 8.99 KB | Sep 24, 2012 | 5.0.5 | 13 | Download |
r64 alpha | 9.05 KB | Sep 24, 2012 | 5.0.5 | 16 | Download |
r58 alpha | 9.03 KB | Sep 20, 2012 | 5.0.5 | 18 | Download |
r54 alpha | 8.95 KB | Sep 20, 2012 | 5.0.5 | 19 | Download |
r49 alpha | 8.74 KB | Sep 20, 2012 | 5.0.5 | 19 | Download |
r47 alpha | 8.66 KB | Sep 19, 2012 | 5.0.5 | 50 | Download |
r45 alpha | 8.53 KB | Sep 17, 2012 | 5.0.5 | 17 | Download |
r44 alpha | 8.52 KB | Sep 17, 2012 | 5.0.5 | 23 | Download |
r40 alpha | 8.68 KB | Sep 13, 2012 | 5.0.5 | 16 | Download |
r38 alpha | 8.67 KB | Sep 13, 2012 | 5.0.5 | 16 | Download |
r35 alpha | 8.54 KB | Sep 11, 2012 | 5.0.4 | 17 | Download |
r34 alpha | 8.55 KB | Sep 10, 2012 | 5.0.4 | 23 | Download |
r31 alpha | 8.57 KB | Sep 9, 2012 | 5.0.4 | 19 | Download |
r27 alpha | 8.42 KB | Sep 8, 2012 | 5.0.4 | 21 | Download |
r25 alpha | 8.38 KB | Sep 8, 2012 | 5.0.4 | 27 | Download |
r24 alpha | 8.33 KB | Sep 8, 2012 | 5.0.4 | 21 | Download |
r21 alpha | 8.41 KB | Sep 7, 2012 | 5.0.4 | 20 | Download |
r20 alpha | 8.37 KB | Sep 6, 2012 | 5.0.4 | 29 | Download |
r15 alpha | 8.15 KB | Sep 6, 2012 | 5.0.4 | 48 | Download |
r14 alpha | 8.14 KB | Sep 6, 2012 | 5.0.4 | 15 | Download |
r13 alpha | 7.86 KB | Sep 5, 2012 | 5.0.4 | 23 | Download |
r12 alpha | 7.91 KB | Sep 5, 2012 | 5.0.4 | 24 | Download |
r11 alpha | 7.73 KB | Sep 4, 2012 | 5.0.4 | 18 | Download |
r10 alpha | 7.69 KB | Sep 3, 2012 | 5.0.4 | 16 | Download |
Description
Requires: LibStub, CallbackHandler-1.0
With 5.0 a new C_PetJournal API was introduced, and unfortunately the old GetCompanionInfo API no longer works properly (it does not, for example, know anything about non-combat pets obtained before the account-wide merge, and you also can no longer summon non-combat pets using it).
This library provides the list of player owned pet ids and all species ids, which can be used with C_PetJournal.GetPetInfoByPetID() and C_PetJournal.GetPetInfoBySpeciesID().
It primarily deals with two problems with scanning the pet journal:
- Filters: The Pet Journal filters are cleared and then restored, as they affect the return values given from C_PetJournal.GetPetInfoByIndex()
- Updating in response to event: Manipulating the Pet Journal filters causes PET_JOURNAL_LIST_UPDATE to fire, which is also the only event that always fires when you lose or gain a pet. Filter manipulation is detected and we never try to rescan pets in response. When this is not the case, a CallbackHandler event is fired which can be used to safely detect changes to the pet list.
Links
Getting Started
API Documentation
WoWAce Thread
Example
local LibPetJournal = LibStub("LibPetJournal-2.0") local function ScanPets() for _,petid in LibPetJournal:IteratePetIDs() do local speciesID, customName, level, xp, maxXp, displayID, isFavorite, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable, unique = C_PetJournal.GetPetInfoByPetID(petid) if name == "Feline Familiar" then print("Player has a cat in a hat.") end end end ScanPets()
If you wanted to automatically scan for little cats in hats when the pet list changes, you could register a callback, such as:
LibPetJournal.RegisterCallback(addon, "PetListUpdated", ScanPets)
Obviously you would normally use the speciesID or creatureID return values from C_PetJournal.GetPetInfoByPetID() to find a particular pet, but this is just a silly example.
Add a comment