Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Working with LibItemCache's API is very similar to working with Blizzard's: for example, the method
:GetItemInfo(owner, bag, slot) works much alike the server method
It is strictly better than using Blizzard's API though, because it allows you to select the owner to query, and works independently of your character's location - for instance, whether he/she is at the bank is irrelevant.
local info = LibStub('LibItemCache-2.0'):GetOwnerInfo('Smartypants') print(info.money)
All LibItemCache functions assume that, if ownerID is nil, then the current character being played is the owner being queried.
Returns an information data structure about the requested bag. Note that the Void Storage is considered a bag as well, and that guild bank tabs are considered bags owned by the guild. See more in bagID.
local info = LibStub('LibItemCache-2.0'):GetOwnerInfo('Smartypants', 1) print(info.icon, info.free)
:GetItemInfo(ownerID, bagID, slot)
:GetBagInfo, returns an information data structure about the requested item slot.
Returns a stateless iterator over all the cached onwers (players and guilds) that belong to the current realm being played on, or to realms the current one is connected to.
for ownerID in LibStub('LibItemCache-2.0'):IterateOwners() do print(ownerID) end