avoid endless back/forth stacks
This commit is contained in:
parent
efd2cef8c4
commit
02421b9539
2
IO.lua
2
IO.lua
@ -40,7 +40,7 @@ while true do
|
|||||||
for slot, item in pairs(stacks_stored) do
|
for slot, item in pairs(stacks_stored) do
|
||||||
local ii = w.get_internal_identifier(item)
|
local ii = w.get_internal_identifier(item)
|
||||||
local stored = get_item_count(ii)
|
local stored = get_item_count(ii)
|
||||||
local wanted = conf.items[ii] or 0
|
local wanted = conf.items[ii] + 1 or 0
|
||||||
if (get_num_stacks(stored) * 64) >= wanted then -- if item is not in want list or we have too many, send it back to storage
|
if (get_num_stacks(stored) * 64) >= wanted then -- if item is not in want list or we have too many, send it back to storage
|
||||||
local result = w.unwrap(w.query_by_type("storage", {
|
local result = w.unwrap(w.query_by_type("storage", {
|
||||||
type = "insert",
|
type = "insert",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user