While the code did kind of work it had a bug where it first only tops off to non-red limit and then next Shift or Ctrl-click adds into red area. I used AI to figure out how to make it always insert into chest, and it worked. (Ollama app with gpt-oss:20b, free stuff entirely and most of it processed on the PC itself)
In control.lua: line 16:
--if inventory.get_insertable_count(item) > 0 then return end -- Original line
if inventory.get_insertable_count(item) > 0 then return bar end
I did some testing but didn't see any error in behavior, it works just like Dyson Sphere Program chest insertion from a glance. I don't understand what it did but... maybe you do? Of course it tried to explain it to me... AI summary:
Short answer
inventory.get_insertable_count(item) tells you how many more of that item the chest can hold.
The code that decides whether the chest’s “red‑area” bar can be activated must therefore **look for the case where that number is greater than zero (i.e., there is still room).
The original version returned nil when the number was > 0, so the bar was never set unless the chest was already full.
By inverting the test:
if inventory.get_insertable_count(item) > 0 then
return bar -- there is space → activate the bar
end
the function returns the current bar only when the chest can actually accept the stack, letting the split work immediately, even when the chest’s normal slots aren’t full.