Mercurial > wow > itemauditor
changeset 93:693f664aad2b
Added '/ia snatch'. This new command works with your queue (/ia crafting) to replace your snatch list with the materials you need for crafting. NOTE: Auctioneer requires visiting the AH before you can modify the snatch list.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Wed, 11 Aug 2010 22:16:59 -0700 |
parents | 71053b1f6c1c |
children | 4ec8611d9466 |
files | CHANGELOG.txt Core.lua ItemAuditor.toc Modules/AuctionHouse.lua Modules/Crafting.lua |
diffstat | 5 files changed, 50 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGELOG.txt Wed Aug 11 21:09:59 2010 -0700 +++ b/CHANGELOG.txt Wed Aug 11 22:16:59 2010 -0700 @@ -3,6 +3,7 @@ - Fixed an issue where trading an item and gold in exchange for a different item was not considering the gold in the price of the new item. - Fixed a bug where postage was being counted more than once if you send mail and then open mail in the same session. - Added a warning when sending items with value to characters on other accounts. +- Added '/ia snatch'. This new command works with your queue (/ia crafting) to replace your snatch list with the materials you need for crafting. NOTE: Auctioneer requires visiting the AH before you can modify the snatch list. 2010-08-10 Asa Ayers <Asa.Ayers@Gmail.com>
--- a/Core.lua Wed Aug 11 21:09:59 2010 -0700 +++ b/Core.lua Wed Aug 11 22:16:59 2010 -0700 @@ -87,7 +87,7 @@ -- ItemAuditor_DebugFrame:Show() -- self:CreateFrame('tab_crafting') self:RegisterEvent("TRADE_SKILL_SHOW", function() - ItemAuditor:CreateFrame('tab_crafting') + ItemAuditor:DisplayCrafting() end) --@end-debug@ end
--- a/ItemAuditor.toc Wed Aug 11 21:09:59 2010 -0700 +++ b/ItemAuditor.toc Wed Aug 11 22:16:59 2010 -0700 @@ -13,8 +13,8 @@ Core.lua +Modules\Utils.lua Modules\AuctionHouse.lua -Modules\Utils.lua Modules\Options.lua Modules\Frames.lua Modules\Events.lua
--- a/Modules/AuctionHouse.lua Wed Aug 11 21:09:59 2010 -0700 +++ b/Modules/AuctionHouse.lua Wed Aug 11 22:16:59 2010 -0700 @@ -1,6 +1,8 @@ local ItemAuditor = select(2, ...) local AuctionHouse = ItemAuditor:NewModule("AuctionHouse") +local Utils = ItemAuditor:GetModule("Utils") + local addon_options local function getAddons() -- this will ensure that the addons are only scanned once per session. @@ -75,9 +77,53 @@ set = function(info, value) ItemAuditor.db.profile.pricing_method = value end, order = 1, } + }, } +local function clearSnatch() + ItemAuditor:Print('clearing snatch') + local Snatch = AucAdvanced.Modules.Util.SearchUI.Searchers.Snatch + local snatchList = Snatch.Private.snatchList + + for itemLink in pairs(snatchList) do + local link = select(2, GetItemInfo('item:'..itemLink)) + Snatch.RemoveSnatch(link) + end +end + +function AuctionHouse.Snatch() + if not AucAdvanced or not AucAdvanced.Version then + ItemAuditor:Print("The snatch command requires Auctioneer.") + return + end + + local Snatch = AucAdvanced.Modules.Util.SearchUI.Searchers.Snatch + if not Snatch.Private.frame then + ItemAuditor:Print("You must visit the Auction House before you can update Auctioneer's snatch list.") + return + end + clearSnatch() + + local function Export(data) + for id, reagent in pairs(data.reagents) do + ItemAuditor:Print("Adding %s for %s", reagent.link, Utils.FormatMoney(reagent.price)) + Snatch.AddSnatch(reagent.link, reagent.price) + end + end + ItemAuditor:UpdateCraftingTable() + ItemAuditor:GetModule("Crafting").Export(Export) +end + +ItemAuditor.Options.args.snatch = { + type = "execute", + handler = AuctionHouse, + name = "snatch", + desc = "Replace Auctioner's snatch list with all the reagents you need for crafting.", + func = "Snatch", + guiHidden = true, +} + function AuctionHouse:GetAuctionPrice(itemLink) local link = select(2, GetItemInfo(itemLink)) assert(link, 'Invalid item link: '..itemLink)
--- a/Modules/Crafting.lua Wed Aug 11 21:09:59 2010 -0700 +++ b/Modules/Crafting.lua Wed Aug 11 22:16:59 2010 -0700 @@ -385,6 +385,7 @@ local reagentLink = GetTradeSkillReagentItemLink(i, reagentId) reagents[reagentId] = { + link = reagentLink, name = reagentName, count = reagentCount, price = self:GetReagentCost(reagentLink, reagentCount),