API

LibGuildBankComm-1.0 synchronizes guild bank data across all guild members running the library or some embedding addon. Data is stored privately within the library but can be accessed through the functions below. See the examples page for information regarding the available callbacks and more complete examples of using the Library in your addons.

LibGuildBankComm:GetGuildFunds()

Returns the amount of money in the guild back in copper.

Usage

local LGBC = LibStub("LibGuildBankComm-1.0")
local copper = LGBC:GetGuildFunds()
print("You have", GetCoinText(copper), "in your guild bank.")

LibGuildBankComm:GetNumBankTabs()

Returns the number of purchased tabs available in the guild bank.

Usage

local LBGC = LibStub("LibGuildBankComm-1.0")
local numTabs = LGBC:GetNumBankTabs()
print("Your guild bank has", numTabs, "tabs.")

LibGuildBankComm:GetTabInfo(page)

Returns the name given to the page and the texture path for that tab.

Parameters

page
The page number that you want the information from. Must be between 1 and the number of available tabs, inclusive.

Usage

local LGBC = LibStub("LibGuildBankComm-1.0")
local numTabs = LGBC:GetNumBankTabs()
for i = 1, numTabs do
    local name, icon = LGBC:GetTabInfo(i)
    print("Guild bank tab", i, "is called", name)
end

LibGuildBankComm:GetPageTimestamp(page)

Returns the Unix timestamp that represents the last time the specified page was scanned.

Parameters

page
The page number that you want the information from. Must be between 1 and the number of available tabs, inclusive.

Usage

local LGBC = LibStub("LibGuildBankComm-1.0")
local numTabs = LGBC:GetNumBankTabs()
for i = 1, numTabs do
    local lastScan = LGBC:GetPageTimestamp(i)
    print("Guild bank tab", i, "was last scanned", date("%x at %X", lastScan))
end
--if lastScan is 1302117202 for page 1 then
--the result is "Guild bank tab 1 was last scanned 04/06/11 at 14:13:22"
--assuming you are in the United States, Central timezone

LibGuildBankComm:IteratePage(page)

Returns an iterator over the specified page's data that will give the slot number, item link and stack count for every item on the page.
This iterator will always yield a slot number (1-98, inclusive) and will yield nil for the item and stack count on empty slots.

Parameters

page
The page number that you want the information from. Must be between 1 and the number of available tabs, inclusive.

Usage

local LGBC = LibStub("LibGuildBankComm-1.0")
for slot, link, stack in LGBC:IteratePage(1) do
    print("Slot number", slot, "contains", stack, link)
end

LibGuildBankComm:IteratePageLinks(page)

Returns an iterator over the specified page's data that will give the slot number and item link for every item on the page.
The iterator will always yield the slot number (1-98, inclusive) and will yield nil for the link on empty slots.

Parameters

page
The page number that you want the information from. Must be between 1 and the number of available tabs, inclusive.

Usage

local LGBC = LibStub("LibGuildBankComm-1.0")
for slot, link in LGBC:IteratePageLinks(1) do
    print("Slot number", slot, "contains", link)
end

LibGuildBankComm:IteratePageStacks(page)

Returns an iterator over the specified page's data that will give the slot number and stack count for every item on the page.
The iterator will always yield the slot number (1-98, inclusive) and will yield nil for the stack count on empty slots.

Parameters

page
The page number that you want the information from. Must be between 1 and the number of available tabs, inclusive.

Usage

local LGBC = LibStub("LibGuildBankComm-1.0")
for slot, stack in LGBC:IteratePageStacks(1) do
    print("Slot number", slot, "is a stack of", stack, "items.")
end

Comments

Posts Quoted:
Reply
Clear All Quotes