Skip to content

Commit

Permalink
Merge pull request #6819 from BinuDR/patch-14
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored May 19, 2024
2 parents 2ea6581 + 87950cc commit 6a8684e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions workorders.lic
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 6a8684e

Please sign in to comment.