comparison Queue.lua @ 31:e732843b16d2 v0.1.6-BETA

Added an info box to the top of the general group. Removed the ?Don't queue when below threshold?, this is now default (can?t make it too complicated). Implemented working functionality for virtual groups. ?Include in local item data? can now be overridden in every group. Added help text at the replenishing stock indicating how auction values are used when queueing. The tabs ?add items? and ?current items? will now be hidden rather than disabled when you have a virtual group selected. The auction value/price threshold for items will now be used when queueing items.
author Zerotorescue
date Sat, 30 Oct 2010 23:04:45 +0200
parents 7d7aaa3fbe94
children 58fb38f0b447
comparison
equal deleted inserted replaced
30:8177b5bcb883 31:e732843b16d2
74 -- Remember which items have been processed 74 -- Remember which items have been processed
75 temp[itemId] = true; 75 temp[itemId] = true;
76 end 76 end
77 77
78 local currentStock = addon:GetItemCount(itemId, groupName); 78 local currentStock = addon:GetItemCount(itemId, groupName);
79
79 if currentStock >= 0 then 80 if currentStock >= 0 then
80 -- Current stock will be -1 when no itemcount addon was found 81 -- Current stock will be -1 when no itemcount addon was found
82
83 -- Retrieve group settings
81 local restockTarget = addon:GetOptionByKey(groupName, "restockTarget"); 84 local restockTarget = addon:GetOptionByKey(groupName, "restockTarget");
82 local bonusQueue = addon:GetOptionByKey(groupName, "bonusQueue"); 85 local bonusQueue = addon:GetOptionByKey(groupName, "bonusQueue");
83 local minCraftingQueue = floor( addon:GetOptionByKey(groupName, "minCraftingQueue") * restockTarget ); 86 local minCraftingQueue = floor( addon:GetOptionByKey(groupName, "minCraftingQueue") * restockTarget );
84 87
88 -- Calculate the amount to be queued
85 local amount = ( restockTarget - currentStock ); 89 local amount = ( restockTarget - currentStock );
86 90
87 if currentStock == 0 and bonusQueue > 0 then 91 if currentStock == 0 and bonusQueue > 0 then
92 -- If we have none left and the bonus queue is enabled, modify the amount to be queued
93
88 amount = floor( ( amount * ( bonusQueue + 1 ) ) + .5 ); -- round 94 amount = floor( ( amount * ( bonusQueue + 1 ) ) + .5 ); -- round
89 end 95 end
90 96
91 if amount > 0 and amount >= minCraftingQueue then 97 if amount > 0 and amount >= minCraftingQueue then
92 self:Queue(i, amount, groupName); 98 -- If we are queueing at least one AND more than the minimum amount, then proceed
93 99
94 print("Queued " .. amount .. " of " .. itemLink); 100 -- Auction value settings
101 local priceThreshold = addon:GetOptionByKey(groupName, "priceThreshold");
102
103 if priceThreshold == 0 or addon:GetAuctionValue(itemLink, groupName) >= priceThreshold then
104 -- If no price threshold is set or the auction value is equal to or larger than the price threshold, then proceed
105
106 self:Queue(i, amount, groupName);
107
108 print("Queued " .. amount .. " of " .. itemLink);
109 end
95 end 110 end
96 else 111 else
97 print("No usable itemcount addon found."); 112 print("No usable itemcount addon found.");
98 end 113 end
99 end 114 end