WoW LibPetJournal-2.0 addon Shadowlands/classic 2021
logo
wow addon LibPetJournal-2.0

LibPetJournal-2.0

Game Version: 8.0.1
Total Downloads: 54,116
Updated: Jul 18, 2018
Created: Sep 3, 2012
download LibPetJournal-2.0Download Earlier Versions

Earlier Versions

Name Size Uploaded Game Version Downloads
2.0.33 release 8.10 KB Jul 18, 2018 8.0.1 8,691 download LibPetJournal-2.0 2.0.33 releaseDownload
2.0.32 release 8.09 KB Jul 18, 2016 6.2.4 10,488 download LibPetJournal-2.0 2.0.32 releaseDownload
2.0.31 release 7.97 KB May 31, 2016 6.2.4 1,259 download LibPetJournal-2.0 2.0.31 releaseDownload
2.0.30 release 7.97 KB May 25, 2016 6.2.4 710 download LibPetJournal-2.0 2.0.30 releaseDownload
2.0.28 release 7.65 KB Oct 24, 2015 6.2.2 2,180 download LibPetJournal-2.0 2.0.28 releaseDownload
2.0.27 release 7.64 KB Sep 11, 2014 6.0.2 4,529 download LibPetJournal-2.0 2.0.27 releaseDownload
2.0.26 release 7.67 KB May 5, 2013 5.2.0 3,924 download LibPetJournal-2.0 2.0.26 releaseDownload
2.0.25 release 7.70 KB Mar 5, 2013 5.2.0 1,527 download LibPetJournal-2.0 2.0.25 releaseDownload
2.0.24.1 release 7.70 KB Dec 31, 2012 5.1.0 1,262 download LibPetJournal-2.0 2.0.24.1 releaseDownload
2.0.24 release 7.69 KB Oct 26, 2012 5.0.5 1,381 download LibPetJournal-2.0 2.0.24 releaseDownload
2.0.23 release 7.67 KB Oct 25, 2012 5.0.5 422 download LibPetJournal-2.0 2.0.23 releaseDownload
2.0.22 release 7.61 KB Oct 11, 2012 5.0.5 772 download LibPetJournal-2.0 2.0.22 releaseDownload
2.0.21 release 7.61 KB Sep 28, 2012 5.0.5 684 download LibPetJournal-2.0 2.0.21 releaseDownload
2.0.20 release 7.60 KB Sep 24, 2012 5.0.5 416 download LibPetJournal-2.0 2.0.20 releaseDownload
2.0.19 release 7.64 KB Sep 24, 2012 5.0.5 74 download LibPetJournal-2.0 2.0.19 releaseDownload
2.0.18 release 7.65 KB Sep 20, 2012 5.0.5 121 download LibPetJournal-2.0 2.0.18 releaseDownload
2.0.17 release 7.66 KB Sep 20, 2012 5.0.5 53 download LibPetJournal-2.0 2.0.17 releaseDownload
2.0.16 release 7.50 KB Sep 17, 2012 5.0.5 151 download LibPetJournal-2.0 2.0.16 releaseDownload
2.0.15 release 7.49 KB Sep 13, 2012 5.0.5 126 download LibPetJournal-2.0 2.0.15 releaseDownload
2.0.14 release 7.44 KB Sep 11, 2012 5.0.4 116 download LibPetJournal-2.0 2.0.14 releaseDownload
r137-alpha alpha 8.20 KB Aug 6, 2018 8.0.1 8,934 download LibPetJournal-2.0 r137-alpha alphaDownload
r135-alpha alpha 8.12 KB Aug 6, 2018 8.0.1 10 download LibPetJournal-2.0 r135-alpha alphaDownload
r134-alpha alpha 7.80 KB Jul 19, 2018 8.0.1 747 download LibPetJournal-2.0 r134-alpha alphaDownload
r133-alpha alpha 7.80 KB Jul 18, 2018 8.0.1 25 download LibPetJournal-2.0 r133-alpha alphaDownload
r132-alpha alpha 8.09 KB Jul 18, 2018 8.0.1 9 download LibPetJournal-2.0 r132-alpha alphaDownload
r131-alpha alpha 8.04 KB Jul 18, 2018 8.0.1 9 download LibPetJournal-2.0 r131-alpha alphaDownload
r130-alpha alpha 8.01 KB Sep 5, 2017 7.3.0 1,124 download LibPetJournal-2.0 r130-alpha alphaDownload
3b1c59268169-alpha alpha 8.04 KB Mar 29, 2017 7.2.0 995 download LibPetJournal-2.0 3b1c59268169-alpha alphaDownload
e3258da68c22-alpha alpha 8.00 KB Dec 1, 2016 7.1.0 1,041 download LibPetJournal-2.0 e3258da68c22-alpha alphaDownload
3f762d561833-alpha alpha 8.17 KB Dec 1, 2016 7.1.0 15 download LibPetJournal-2.0 3f762d561833-alpha alphaDownload
r125 alpha 9.16 KB Jul 19, 2016 7.0.3 362 download LibPetJournal-2.0 r125 alphaDownload
r124 alpha 9.17 KB Jul 18, 2016 6.2.4 13 download LibPetJournal-2.0 r124 alphaDownload
r123 alpha 9.15 KB Jul 18, 2016 6.2.4 10 download LibPetJournal-2.0 r123 alphaDownload
r122 alpha 9.20 KB Jul 15, 2016 6.2.4 72 download LibPetJournal-2.0 r122 alphaDownload
r120 alpha 9.14 KB Jul 13, 2016 6.2.4 58 download LibPetJournal-2.0 r120 alphaDownload
r119 alpha 9.01 KB May 31, 2016 6.2.4 12 download LibPetJournal-2.0 r119 alphaDownload
r118 alpha 9.02 KB May 31, 2016 6.2.4 54 download LibPetJournal-2.0 r118 alphaDownload
r117 alpha 9.04 KB May 31, 2016 6.2.4 30 download LibPetJournal-2.0 r117 alphaDownload
r116 alpha 9.02 KB May 25, 2016 6.2.4 13 download LibPetJournal-2.0 r116 alphaDownload
r115 alpha 9.04 KB May 25, 2016 6.2.4 12 download LibPetJournal-2.0 r115 alphaDownload
r114 alpha 9.05 KB May 13, 2016 6.2.4 69 download LibPetJournal-2.0 r114 alphaDownload
r113 alpha 9.05 KB May 13, 2016 6.2.4 37 download LibPetJournal-2.0 r113 alphaDownload
r106 alpha 8.65 KB Oct 24, 2015 6.2.2 15 download LibPetJournal-2.0 r106 alphaDownload
r105 alpha 8.63 KB Oct 17, 2015 6.2.2 86 download LibPetJournal-2.0 r105 alphaDownload
r104 alpha 8.66 KB Oct 17, 2015 6.2.2 16 download LibPetJournal-2.0 r104 alphaDownload
r101 alpha 8.64 KB Sep 24, 2015 6.2.2 85 download LibPetJournal-2.0 r101 alphaDownload
r100 alpha 8.61 KB Sep 24, 2015 6.2.2 54 download LibPetJournal-2.0 r100 alphaDownload
r99 alpha 8.57 KB Sep 24, 2015 6.2.2 19 download LibPetJournal-2.0 r99 alphaDownload
r98 alpha 8.63 KB Sep 24, 2015 6.1.0 11 download LibPetJournal-2.0 r98 alphaDownload
r96 alpha 8.58 KB Feb 25, 2015 6.1.0 206 download LibPetJournal-2.0 r96 alphaDownload
r95 alpha 8.60 KB Sep 11, 2014 6.0.1 22 download LibPetJournal-2.0 r95 alphaDownload
r91 alpha 8.62 KB May 5, 2013 5.2.0 11 download LibPetJournal-2.0 r91 alphaDownload
r89 alpha 8.67 KB May 5, 2013 5.2.0 10 download LibPetJournal-2.0 r89 alphaDownload
r87 alpha 8.75 KB Mar 5, 2013 5.2.0 9 download LibPetJournal-2.0 r87 alphaDownload
r84 alpha 8.85 KB Dec 31, 2012 5.1.0 12 download LibPetJournal-2.0 r84 alphaDownload
r83 alpha 8.85 KB Nov 29, 2012 5.1.0 152 download LibPetJournal-2.0 r83 alphaDownload
r81 alpha 8.83 KB Nov 2, 2012 5.0.5 127 download LibPetJournal-2.0 r81 alphaDownload
r80 alpha 8.99 KB Oct 26, 2012 5.0.5 11 download LibPetJournal-2.0 r80 alphaDownload
r79 alpha 9.01 KB Oct 26, 2012 5.0.5 16 download LibPetJournal-2.0 r79 alphaDownload
r77 alpha 9.02 KB Oct 25, 2012 5.0.5 13 download LibPetJournal-2.0 r77 alphaDownload
r75 alpha 9.11 KB Oct 24, 2012 5.0.5 75 download LibPetJournal-2.0 r75 alphaDownload
r74 alpha 9.03 KB Oct 11, 2012 5.0.5 12 download LibPetJournal-2.0 r74 alphaDownload
r72 alpha 9.05 KB Oct 9, 2012 5.0.5 70 download LibPetJournal-2.0 r72 alphaDownload
r71 alpha 9.03 KB Sep 28, 2012 5.0.5 19 download LibPetJournal-2.0 r71 alphaDownload
r68 alpha 8.99 KB Sep 24, 2012 5.0.5 13 download LibPetJournal-2.0 r68 alphaDownload
r64 alpha 9.05 KB Sep 24, 2012 5.0.5 16 download LibPetJournal-2.0 r64 alphaDownload
r58 alpha 9.03 KB Sep 20, 2012 5.0.5 18 download LibPetJournal-2.0 r58 alphaDownload
r54 alpha 8.95 KB Sep 20, 2012 5.0.5 19 download LibPetJournal-2.0 r54 alphaDownload
r49 alpha 8.74 KB Sep 20, 2012 5.0.5 19 download LibPetJournal-2.0 r49 alphaDownload
r47 alpha 8.66 KB Sep 19, 2012 5.0.5 50 download LibPetJournal-2.0 r47 alphaDownload
r45 alpha 8.53 KB Sep 17, 2012 5.0.5 17 download LibPetJournal-2.0 r45 alphaDownload
r44 alpha 8.52 KB Sep 17, 2012 5.0.5 23 download LibPetJournal-2.0 r44 alphaDownload
r40 alpha 8.68 KB Sep 13, 2012 5.0.5 16 download LibPetJournal-2.0 r40 alphaDownload
r38 alpha 8.67 KB Sep 13, 2012 5.0.5 16 download LibPetJournal-2.0 r38 alphaDownload
r35 alpha 8.54 KB Sep 11, 2012 5.0.4 17 download LibPetJournal-2.0 r35 alphaDownload
r34 alpha 8.55 KB Sep 10, 2012 5.0.4 23 download LibPetJournal-2.0 r34 alphaDownload
r31 alpha 8.57 KB Sep 9, 2012 5.0.4 19 download LibPetJournal-2.0 r31 alphaDownload
r27 alpha 8.42 KB Sep 8, 2012 5.0.4 21 download LibPetJournal-2.0 r27 alphaDownload
r25 alpha 8.38 KB Sep 8, 2012 5.0.4 27 download LibPetJournal-2.0 r25 alphaDownload
r24 alpha 8.33 KB Sep 8, 2012 5.0.4 21 download LibPetJournal-2.0 r24 alphaDownload
r21 alpha 8.41 KB Sep 7, 2012 5.0.4 20 download LibPetJournal-2.0 r21 alphaDownload
r20 alpha 8.37 KB Sep 6, 2012 5.0.4 29 download LibPetJournal-2.0 r20 alphaDownload
r15 alpha 8.15 KB Sep 6, 2012 5.0.4 48 download LibPetJournal-2.0 r15 alphaDownload
r14 alpha 8.14 KB Sep 6, 2012 5.0.4 15 download LibPetJournal-2.0 r14 alphaDownload
r13 alpha 7.86 KB Sep 5, 2012 5.0.4 23 download LibPetJournal-2.0 r13 alphaDownload
r12 alpha 7.91 KB Sep 5, 2012 5.0.4 24 download LibPetJournal-2.0 r12 alphaDownload
r11 alpha 7.73 KB Sep 4, 2012 5.0.4 18 download LibPetJournal-2.0 r11 alphaDownload
r10 alpha 7.69 KB Sep 3, 2012 5.0.4 16 download LibPetJournal-2.0 r10 alphaDownload

Description

Share this:

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.

Comments

Add a comment