This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Aikonn's profile picture

IC2 Mass Fabricator automation

Started by Aikonn, 21 January 2013 - 10:26 AM
Aikonn #1
Posted 21 January 2013 - 11:26 AM
I was looking into Mass Fabricator from IC2 automation - how to feed it with scrap and if you are out of scrap then to turn it off.
I tried BuildCraft gates but they didnt seem to work well for me then I found simple and cheap solution that I like.

1. Place basic turtle right below Mass Fabricator a copy this to turtle's startup program: http://pastebin.com/KecjL3zH
2. Feed your scraps from Recycler directly to the turtle - BuildCraft pipes will do the job nicely

How does this work:
Turtle cycle through all of 16 slots of inventory and try to dropUp() scraps to Mass Fabricator.
As it runs out of scraps it will turn Mass Fabricator off by redstone signal. Then wait 5 minutes to start again.
All in infinite loop.

Note:
- you need to run this as turtle's startup program (simply name the file "startup") otherwise when you load your world, fabricator will starts running without scraps.
- turtle cant check inventory of fabricator so when it shut down, there is usually remaining stack of scraps in fabricator. This is only downside of this solution, but if you have quarry and steady supply of scrap then its not problem at all.
- I use Filter (from RedPower2) to pull UU-matter from fabricator … guest what? if you have Filter on side of Fabricator, it is affected by turtle's redstone signal … so i added 3 lines (uncomment lines 9-11 in code) and now turtle act also as redstone timer for Filter. works perfectly.


The program itself is very simple but still I like it and wanted to share my idea. Hope someone finds it usefull.


while true do
redstone.setOutput("top", false)
print("feeding scraps")
for i=1,16 do
  turtle.select(i)
  while (turtle.getItemCount(i)>0) do
    if turtle.dropUp()==false then
	  -- redstone.setOutput("top",true)
	  -- sleep(0.5)
	  -- redstone.setOutput("top",false)
	  -- uncomment 3 lines above, if you use RP2 Filter to pull UU from Fabr.
	  sleep(5)
    end 
  end
end
print("out of scraps .. turning off")
redstone.setOutput("top", true)
for i=5,1,-1 do
  print("sleeping for "..i)
  sleep(60)
end
end
DZCreeper #2
Posted 21 January 2013 - 02:40 PM
Pretty sure sleep(5) is equal to 5 seconds, not minutes. I would personally just chance that to 60, so it waits 1 minute.
Aikonn #3
Posted 21 January 2013 - 05:12 PM
Pretty sure sleep(5) is equal to 5 seconds, not minutes. I would personally just chance that to 60, so it waits 1 minute.

If you mean sleep(5) on line 13, than it is used when dropUp() fails … which is usually when Mass Fabricator is full of scrap. In that case turtle waits 5 seconds before trying again.

5 minutes sleep - after all scrap is used - is done by second "for" cycle at the end of program.