Mercurial > wow > itemauditor
comparison Modules/QuickAuctions.lua @ 59:4ec321eb0dfe
Adding a crafing tab to the ItemAuditor window.
| author | Asa Ayers <Asa.Ayers@Gmail.com> |
|---|---|
| date | Sun, 25 Jul 2010 15:51:13 -0700 |
| parents | 5273038322d7 |
| children | 70dc84df13b3 |
comparison
equal
deleted
inserted
replaced
| 58:bdf3aba93aa9 | 59:4ec321eb0dfe |
|---|---|
| 67 threshold = calculateQAThreshold(threshold) | 67 threshold = calculateQAThreshold(threshold) |
| 68 | 68 |
| 69 QAAPI:SetGroupThreshold(groupName, ceil(threshold)) | 69 QAAPI:SetGroupThreshold(groupName, ceil(threshold)) |
| 70 end | 70 end |
| 71 end | 71 end |
| 72 | |
| 73 local function isProfitable(data) | |
| 74 if addon.IsQAEnabled() then | |
| 75 local QAGroup = QAAPI:GetItemGroup(data.link) | |
| 76 if QAGroup ~= nil then | |
| 77 local currentInvested, _, currentCount = addon:GetItemCost(data.link) | |
| 78 | |
| 79 local stackSize = QAAPI:GetGroupPostCap(QAGroup) * QAAPI:GetGroupPerAuction(QAGroup) | |
| 80 stackSize = stackSize / GetTradeSkillNumMade(data.tradeSkillIndex) | |
| 81 | |
| 82 -- bonus | |
| 83 stackSize = ceil(stackSize *1.25) | |
| 84 | |
| 85 local newThreshold = ((data.cost*stackSize) + currentInvested) / (currentCount + stackSize) | |
| 86 newThreshold = calculateQAThreshold(newThreshold) | |
| 87 | |
| 88 if newThreshold < data.price then | |
| 89 return stackSize | |
| 90 end | |
| 91 | |
| 92 return -1 | |
| 93 end | |
| 94 end | |
| 95 return 0 | |
| 96 end | |
| 97 ItemAuditor:RegisterCraftingDecider('IA QuickAuctions', isProfitable) | |
| 72 | 98 |
| 73 --[[ | 99 --[[ |
| 74 This is based on KTQ | 100 This is based on KTQ |
| 75 ]] | 101 ]] |
| 76 function addon:Queue() | 102 function addon:Queue() |
