Mercurial > wow > itemauditor
diff Core.lua @ 105:eb0493400ff0
Ticket 32 - Based on the patch from lrdx, I have chaned ItemAuditor to depend on DataStore directly instead of going through Altoholic.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Mon, 23 Aug 2010 14:50:07 -0700 |
parents | 1f410255ebd8 |
children | c59d22fac6d1 |
line wrap: on
line diff
--- a/Core.lua Fri Aug 20 06:16:05 2010 -0700 +++ b/Core.lua Mon Aug 23 14:50:07 2010 -0700 @@ -369,8 +369,18 @@ return results end +local realm = GetRealmName() +local ds_account = 'Default' function ItemAuditor:GetItemCount(searchID) - local count = Altoholic:GetItemCount(searchID) + local count = 0 + for _, character in pairs(DataStore:GetCharacters(realm, ds_account)) do + local bag, bank = DataStore:GetContainerItemCount(character, searchID) + count = count + (bag or 0) + (bank or 0) + count = count + (DataStore:GetAuctionHouseItemCount(character, searchID) or 0) + count = count + (DataStore:GetInventoryItemCount(character, searchID) or 0) + count = count + (DataStore:GetMailItemCount(character, searchID) or 0) + count = count + (DataStore:GetCurrencyItemCount(character, searchID) or 0) + end local itemName = GetItemInfo(searchID) for character, mailbox in pairs(allMailboxes) do for type, items in pairs(mailbox) do