# HG changeset patch # User Asa Ayers # Date 1282714807 25200 # Node ID 706b173b0fa13d67eeff5f9b77dd4c0057879c21 # Parent f1a013c64270d49f6c78ba2104beb575963869d7 Ticket 20 - Added a Bonus Queue to the Crafting Rules diff -r f1a013c64270 -r 706b173b0fa1 CHANGELOG.txt --- a/CHANGELOG.txt Tue Aug 24 22:34:23 2010 -0700 +++ b/CHANGELOG.txt Tue Aug 24 22:40:07 2010 -0700 @@ -1,6 +1,7 @@ 2010-08-24 Asa Ayers - Ticket 20 - Added a Skip Singles option to the Crafting Rules. +- Ticket 20 - Added a Bonus Queue to the Crafting Rules 2010-08-23 Asa Ayers diff -r f1a013c64270 -r 706b173b0fa1 Modules/CraftingRules.lua --- a/Modules/CraftingRules.lua Tue Aug 24 22:34:23 2010 -0700 +++ b/Modules/CraftingRules.lua Tue Aug 24 22:40:07 2010 -0700 @@ -19,6 +19,9 @@ if nil == rule.skip_singles then rule.skip_singles = false end + if nil == rule.bonus_queue then + rule.bonus_queue = 0 + end return rule end @@ -110,6 +113,20 @@ end, order = 12, }, + bonus_queue = { + type = "range", + name = "Bonus Queue", + desc = "If don't have any of an item, this number will be added to the number to craft.", + min = 0, + max = 1000, + softMax = 50, + step = 1, + get = function() return ItemAuditor.db.char.rules[name].bonus_queue end, + set = function(info, value) + ItemAuditor.db.char.rules[name].bonus_queue = value + end, + order = 13, + }, header_delete = { type = 'header', name = '', @@ -193,6 +210,10 @@ local function runRule(rule, itemName, itemID, data) local searches = {strsplit(',', rule.search:upper())} + local bonus = 0 + if data.count == 0 then + bonus = rule.bonus_queue + end for _, search in pairs(searches) do search = search:trim() @@ -201,7 +222,7 @@ if rule.skip_singles and data.count+1 == rule.target then return data.count end - return rule.target + return rule.target + bonus end end return 0