Mercurial > wow > inventory
view ItemCountAddons/DataStore (without guilds).lua @ 46:87d68ccf0a8f
The premade group update processor should now properly add items when they were added to a premade group.
Items can now be indicated as removed in premade groups by setting the version number to a negative value of the latest version.
Removed Enchanted Spellthread from the Cataclysm enchants premade group.
author | Zerotorescue |
---|---|
date | Sun, 12 Dec 2010 17:18:19 +0100 |
parents | 8f5c02113c5c |
children | 06fee4208bf2 |
line wrap: on
line source
do local function GetTotalCount(itemId) local realm = GetRealmName(); local totalCount = 0; -- Process all accounts for accountName in pairs(DataStore:GetAccounts()) do -- Process all charracters for characterName, character in pairs(DataStore:GetCharacters(realm, accountName)) do -- Get only useful info (currency / gear shouldn't contain the stuff we are interested in) local bag, bank = DataStore:GetContainerItemCount(character, itemId); local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId); local mail = DataStore:GetMailItemCount(character, itemId); totalCount = totalCount + bag + bank + auctionHouse + mail; end end return totalCount or -1; end local function GetCharacterCount(itemId) local character = DataStore:GetCharacter(); local bag, bank = DataStore:GetContainerItemCount(character, itemId); local auctionHouse = DataStore:GetAuctionHouseItemCount(character, itemId); local mail = DataStore:GetMailItemCount(character, itemId); return bag, bank, auctionHouse, mail; end local function IsEnabled() return (DataStore and DataStore.GetContainerItemCount and DataStore.GetAuctionHouseItemCount and DataStore.GetMailItemCount); end IMRegisterItemCountAddon("DataStore (without guilds)", GetTotalCount, GetCharacterCount, IsEnabled); end