Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Template for new versions:
## New Tools

## New Features
- `combine`: added functionality to override the max stack quantity

## Fixes

Expand Down
7 changes: 6 additions & 1 deletion combine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local opts, args = {
types = nil,
quiet = false,
verbose = 0,
override = nil,
}, {...}

-- TODO:
Expand All @@ -18,7 +19,6 @@ local opts, args = {
-- - Combine partial bars in smelters.
-- - Combine thread, quality of thread.
-- - Quality for food, currently ignoring.
-- - Override stack size; armok option.
-- - Override container limits; quantum containers armok option.

-- list of types that use race and caste
Expand Down Expand Up @@ -169,6 +169,10 @@ local function stack_type_new(type_vals)
stack_type[k] = v
end

if opts.override then
stack_type.max_stack_qty = opts.override
end

-- item info
stack_type.comp_items = CList:new() -- key:comp_key, val:comp_item
stack_type.item_qty = 0 -- total quantity of items types
Expand Down Expand Up @@ -785,6 +789,7 @@ local function parse_commandline(opts, args)
{'d', 'dry-run', handler=function() opts.dry_run = true end},
{'q', 'quiet', handler=function() opts.quiet = true end},
{'v', 'verbose', hasArg=true, handler=function(optarg) opts.verbose = math.tointeger(optarg) or 0 end},
{'o', 'override', hasArg=true, handler=function(optarg) opts.override = math.tointeger(optarg) or 0 end}
})

-- if stockpile option is not specificed, then default to all
Expand Down
3 changes: 3 additions & 0 deletions docs/combine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ Options
``-v``, ``--verbose n``
Print verbose output for debugging purposes, n from 1 to 4.

``-o``, ``--override n``
Override the default max stack qty.

Notes
-----

Expand Down