Mercurial > wow > itemauditor
changeset 108:706b173b0fa1
Ticket 20 - Added a Bonus Queue to the Crafting Rules
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Tue, 24 Aug 2010 22:40:07 -0700 |
parents | f1a013c64270 |
children | c59d22fac6d1 |
files | CHANGELOG.txt Modules/CraftingRules.lua |
diffstat | 2 files changed, 23 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 <Asa.Ayers@Gmail.com> - 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 <Asa.Ayers@Gmail.com>
--- 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