diff --git a/fix/dry-buckets.lua b/fix/dry-buckets.lua index b49e5b161..27834abb8 100644 --- a/fix/dry-buckets.lua +++ b/fix/dry-buckets.lua @@ -1,7 +1,15 @@ +local argparse = require("argparse") + +local quiet = false + local emptied = 0 local in_building = 0 local water_type = dfhack.matinfo.find('WATER').type +argparse.processArgsGetopt({...}, { + {'q', 'quiet', handler=function() quiet = true end}, +}) + for _,item in ipairs(df.global.world.items.other.IN_PLAY) do local container = dfhack.items.getContainer(item) if container @@ -19,7 +27,9 @@ for _,item in ipairs(df.global.world.items.other.IN_PLAY) do end end -print('Emptied '..emptied..' buckets.') -if emptied > 0 then - print(('Unclogged %d wells.'):format(in_building)) +if not quiet then + print('Emptied '..emptied..' buckets.') + if emptied > 0 then + print(('Unclogged %d wells.'):format(in_building)) + end end diff --git a/internal/control-panel/registry.lua b/internal/control-panel/registry.lua index c7b591f8e..5f20954cc 100644 --- a/internal/control-panel/registry.lua +++ b/internal/control-panel/registry.lua @@ -71,6 +71,9 @@ COMMANDS_BY_IDX = { {command='fix/dead-units', group='bugfix', mode='repeat', default=true, desc='Fix units still being assigned to burrows after death.', params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dead-units', '--burrow', '-q', ']'}}, + {command='fix/dry-buckets', group='bugfix', mode='repeat', default=true, + desc='Allow discarded water buckets and clogged wells to be used again.', + params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dry-buckets', '-q', ']'}}, {command='fix/empty-wheelbarrows', group='bugfix', mode='repeat', default=true, desc='Make abandoned full wheelbarrows usable again.', params={'--time', '1', '--timeUnits', 'days', '--command', '[', 'fix/empty-wheelbarrows', '-q', ']'}},