diff --git a/workorders.lic b/workorders.lic index 83d6db5a67..8282f8c2ec 100644 --- a/workorders.lic +++ b/workorders.lic @@ -9,15 +9,16 @@ class WorkOrders arg_definitions = [ [ { name: 'discipline', options: %w[blacksmithing weaponsmithing tailoring shaping carving remedies artificing], description: 'What type of workorder to do?' }, - { name: 'repair', regex: /repair/i, optional: true, description: 'repair tools instead of crafting' } + { name: 'repair', regex: /repair/i, optional: true, description: 'repair tools instead of crafting' }, + { name: 'turnin', regex: /turnin/i, optional: true, description: 'get work order and turn it in immediately with items already on hand' } ] ] args = parse_args(arg_definitions) - work_order(args.discipline, args.repair) + work_order(args.discipline, args.repair, args.turnin) end - def work_order(discipline, repair) + def work_order(discipline, repair, turnin) @settings = get_settings @worn_trashcan = @settings.worn_trashcan @worn_trashcan_verb = @settings.worn_trashcan_verb @@ -144,7 +145,14 @@ class WorkOrders exit end - send(craft_method, info, materials_info, item, quantity) + if turnin + quantity.times do + DRCI.get_item(item['noun'], @settings.default_container) + bundle_item(item['noun'], info['logbook']) + end + else + send(craft_method, info, materials_info, item, quantity) + end complete_work_order(info)