comparison Modules/AuctionHouse.lua @ 94:4ec8611d9466

Fixed Enchanting. I was not getting the ItemID correctly, so enchants could not be mapped to the scrolls they were to created Changed snatch to only add each item once and to only add a snatch for items you don't have API: Added haveMaterials to the item and need to the reagents that get passed to queue destinations. This is in preparation for building a shopping list module.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Wed, 11 Aug 2010 23:48:23 -0700
parents 693f664aad2b
children 4f26dc55455d
comparison
equal deleted inserted replaced
93:693f664aad2b 94:4ec8611d9466
103 ItemAuditor:Print("You must visit the Auction House before you can update Auctioneer's snatch list.") 103 ItemAuditor:Print("You must visit the Auction House before you can update Auctioneer's snatch list.")
104 return 104 return
105 end 105 end
106 clearSnatch() 106 clearSnatch()
107 107
108 local snatchList = {}
108 local function Export(data) 109 local function Export(data)
109 for id, reagent in pairs(data.reagents) do 110 if not data.haveMaterials then
110 ItemAuditor:Print("Adding %s for %s", reagent.link, Utils.FormatMoney(reagent.price)) 111 for id, reagent in pairs(data.reagents) do
111 Snatch.AddSnatch(reagent.link, reagent.price) 112 if reagent.need > 0 and not snatchList[reagent.link] then
113 snatchList[reagent.link] = true
114 ItemAuditor:Print("Adding %s for %s", reagent.link, Utils.FormatMoney(reagent.price))
115 Snatch.AddSnatch(reagent.link, reagent.price)
116 end
117 end
112 end 118 end
113 end 119 end
114 ItemAuditor:UpdateCraftingTable() 120 ItemAuditor:UpdateCraftingTable()
115 ItemAuditor:GetModule("Crafting").Export(Export) 121 ItemAuditor:GetModule("Crafting").Export(Export)
116 end 122 end