Factorization barrels with Builcraft pipes

Mulchman

New Member
Jul 29, 2019
9
0
0
One optimization is placing a Filter next to the router, instead of a Retriever, as that removes the need for running blutricity to the router area but you then have to use a Machine Filter on the Router otherwise the Router treats the Filter as a valid inventory and starts dumping items into the Filter. I've got the setup running with a bunch of buffer chests feeding into a single ejector Router that then feeds into the actual barrels + Item Detector/Router/jam-clearing system. It seems okay in creative mode spamming it with stacks on stacks of cobblestone...

EDIT: A more compact design, with the Item Detector directly touching the Router and the Computer directly touching the Filter and Item Detector, makes the system much faster (since there's no tube transit time).

EDIT EDIT: I found a flaw in my latest design - if the tube from the Sorting Machine to the Item Detector is long-ish then the Sorting Machine has the potential to stop sending items to the Item Detector due to it being 'backstuffed' and not being a valid inventory for the Sorting Machine. I get around this by creating a restriction tube loop so that the Sorting Machine is constantly spitting out items. Reading this entire post, the whole thing is hard to interpret now; I think I'll make a video showing the whole thing.

EDIT EDIT EDIT:
 

Mulchman

New Member
Jul 29, 2019
9
0
0
Hit a bug with the system: when spamming it with extreme numbers of stacks - like having a timer pulse a Retriever as fast as it can go and looping the Retriever output into the storage system - there's a potential race condition.

Here's the race-
* Router gets a stack of items to process
* Item Detector tries to place another stack into the Router before the Router has serviced the stack it currently has in its inventory
* Item Detector goes into 'backstuffed' mode and emits a redstone signal
* Router processes the stack in its inventory so the Item Detector inputs a new stack into the Router
* Computer, because it got the previous redstone signal, pulses the Filter which pumps out whatever is currently in the Router
In short: false jams are being detected causing random stacks to go to the overflow

To fix this I modified the ComputerCraft Computer program to count the number of times it receives a redstone signal from the Item Detector, and if that number reaches a certain threshold, do the redstone pulse. This slows down processing quite a bit but fixes the problem (so be sure you have a good amount of buffer chests).

tl;dr Essentially we're ensuring we receive the Item Detector redstone pulse several times so we don't inadvertently clear a non-jammed Router

Here's the modified Lua code (pastebin below):
Code:
function doRsPulse()
  rs.setOutput("back", true)
  sleep(0.1)
  rs.setOutput("back", false)
end
 
local itemDetRsCount = 0
local itemDetRsCountThresh = 3
 
function checkAndPulse()
  if rs.getInput("bottom") then
    itemDetRsCount = itemDetRsCount + 1
  else
    itemDetRsCount = 0
  end
 
  if itemDetRsCount >= itemDetRsCountThresh then
    doRsPulse()
    itemDetRsCount = 0
  end
 
  sleep(0.2)
end
 
while true do checkAndPulse() end

EDIT: Discovered you can directly put to pastebin in a recent Direwolf20 video so here's the code there: http://pastebin.com/NUNkWa7q
 

Mulchman

New Member
Jul 29, 2019
9
0
0
I kind of agree. It works fantastically (and with very little effort!) for distributed tasks/jobs/processing - for instance spamming furnaces with things to smelt:

2013-03-04_12.05.15.png