diff Modules/QuickAuctions.lua @ 20:ff9a698caebc

Added options for the crafting threshold and auction threshold. I also fixed the queue to use the item cost to determine if there is enough profit instead of the auction (QA) threshold which already has profit built in.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sun, 04 Jul 2010 09:33:25 -0700
parents 67f4151d535c
children d7f02c84994c
line wrap: on
line diff
--- a/Modules/QuickAuctions.lua	Sun Jul 04 07:24:12 2010 -0700
+++ b/Modules/QuickAuctions.lua	Sun Jul 04 09:33:25 2010 -0700
@@ -36,7 +36,6 @@
 end
 
 addon.profit_margin = 1.15
-addon.minimum_profit = 50000
 
 local function calculateQAThreshold(copper)
 	if copper == 0 then
@@ -44,7 +43,8 @@
 	end
 	
 	-- add my minimum profit margin
-	copper = copper * addon.profit_margin 
+	-- GetAuctionThreshold returns a percent as a whole number. This will convert 25 to 1.25
+	copper = copper *  (1+addon:GetAuctionThreshold())
 	
 	-- Adding the cost of mailing every item once.
 	copper = copper + 30
@@ -85,6 +85,8 @@
 		self:Print("This feature requires LilSparky's Workshop.")
 		return
 	end
+	self:Debug(format("Auction Threshold: %d%%", self:GetAuctionThreshold()*100 ))
+	self:Debug(format("Crafting Threshold: %s", self:FormatMoney(self:GetCraftingThreshold())))
 	
 	for i = 1, GetNumTradeSkills() do
 		local itemLink = GetTradeSkillItemLink(i)
@@ -135,15 +137,15 @@
 				
 				-- bonus?
 				
-				if newThreshold < currentPrice and (currentPrice - newThreshold) > addon.minimum_profit then
+				if newThreshold < currentPrice and (currentPrice - newCost) > self:GetCraftingThreshold() then
 					self:Debug(format("Adding %s x%s to skillet queue. Profit: %s", 
 						itemLink, 
 						toQueue, 
 						addon:FormatMoney(currentPrice - newThreshold)
 					))
 					self:AddToQueue(skillId,i, toQueue)
-				else
-					self:Debug(format("Skipping %s x%s. Would lose %s ", itemLink, toQueue, addon:FormatMoney(currentPrice - newThreshold)))
+				elseif ItemAuditor.db.profile.messages.queue_skip then
+					self:Debug(format("Skipping %s x%s. Profit: %s ", itemLink, toQueue, addon:FormatMoney(currentPrice - newCost)))
 				end
 			end
 		  end