LibGuildBankScan

3.5k Downloads

Library to scan guild bank and return total count for a itemid.

This lib handles the GUILDBANKFRAME_OPENED event and stores all the items and counts in a table to be scanned by your addon after the frame is closed.

Quick and crude example below.

local GBS = LibStub("LibGuildBankScan")
local testids = { 76130, 76133, 76134 }

function addon:OnEnable()
    core:RegisterEvent("GUILDBANKFRAME_CLOSED", "countGuild")
end


function addon:guildCounts( itemid )
    local total = GBS:scanResult( itemid )
    print( total )
end

function addon:countGuild()
    for _, itemid in pairs( testids ) do
        self:guildCounts(itemid)
    end
end