Mercurial > wow > itemauditor
diff Core.lua @ 13:8c83d5f6e306
OPTIONS! QuickAuctions is now an optional dependency. I have also added some configuration options for it. If you have QA but don't want IA to update your thresholds you can shut off the integration. I have also added other options so you can select your faction or the neutral AH and it will update the tooltip.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Fri, 02 Jul 2010 21:39:24 -0700 |
parents | 6a6296dd249f |
children | 44e70a3fdb19 |
line wrap: on
line diff
--- a/Core.lua Wed Jun 30 22:59:37 2010 -0700 +++ b/Core.lua Fri Jul 02 21:39:24 2010 -0700 @@ -17,12 +17,13 @@ function addon:OnInitialize() local DB_defaults = { char = { - debug = false + debug = false, + ah = 1, + use_quick_auctions = false, }, factionrealm = { item_account = {}, items = {}, - AHCut = 0.05, }, } self.db = LibStub("AceDB-3.0"):New("ItemAuditorDB", DB_defaults, true) @@ -49,18 +50,11 @@ if self:GetItem(link).count == 0 or self:GetItem(link).invested == 0 then self:RemoveItem(link) end - -- addon:UpdateQAThreshold(link) end self:RefreshQAGroups() end -function addon:RefreshQAGroups() - for groupName in pairs(QAAPI:GetGroups()) do - self:UpdateQAGroup(groupName) - end -end - function addon:GetCurrentInventory() local i = {} local bagID @@ -254,39 +248,6 @@ end end -function addon:UpdateQAThreshold(link) - _, link= GetItemInfo(link) - - self:UpdateQAGroup(QAAPI:GetItemGroup(link)) -end - -function addon:UpdateQAGroup(groupName) - if groupName then - local threshold = 0 - - for link in pairs(QAAPI:GetItemsInGroup(groupName)) do - local _, itemCost= ItemAuditor:GetItemCost(link, 0) - - threshold = max(threshold, itemCost) - end - - if threshold == 0 then - threshold = 10000 - end - - -- add my minimum profit margin - threshold = threshold * 1.10 - - -- Adding the cost of mailing every item once. - threshold = threshold + 30 - - -- add AH Cut - local keep = 1 - self.db.factionrealm.AHCut - threshold = threshold/keep - - QAAPI:SetGroupThreshold(groupName, ceil(threshold)) - end -end local defaultBagDelay = 0.2