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

Autocrafty turtle

Started by borg286, 18 February 2017 - 10:04 PM
borg286 #1
Posted 18 February 2017 - 11:04 PM
I wrote a program that simply crafts a particular recipe for you continuously. I wanted it to be easy to use and simple to chain together.
  1. Place chest/jabba barrel that will hold all the items needed for crafting
  2. Place crafty turtle on any side
  3. Place items in turtle's inventory (top-left 3x3) so that crafting it produces the item you want.
  4. Run "craft <side>"
The turtle will then scan the first 3 rows and pull from the selected side as much as it can to fill up on recipe's items.
It then crafts as many times, leaving at least 1 recipe in place (in case you want to rearrange it)
All crafted items are spit out the front.
If it could spit the products out the front it waits for 1 second before trying to fill up and craft again.
Otherwise it only waits for 10 seconds under the assumption that the inventory in front of it is full and needs to be piped elsewhere.

It only pulls in items it needs for the recipe, and it can work with either jabba barrels or chests (anything that openperipherals shows has the getAllStacks and pushItemIntoSlot methods). Thus you can have 1 chest that multiple turtles feed from trying to craft their own thing from them.

To get this script do
pastebin get gshAyG5X craft

or download it directly here
http://pastebin.com/gshAyG5X
blunty666 #2
Posted 19 February 2017 - 07:11 AM
This is a really good idea! It's the kind of thing I can actually see myself using when playing survival mode.

Some suggestions for further improvements:
1) Add the ability to press a key and pause/unpause the program to let you change the crafting pattern
2) Add support for Applied Energistics interfaces so you can pull directly from an AE system them dump the crafted items back in to the system
meigrafd #3
Posted 17 June 2017 - 10:28 PM
Check this out: http://www.computercraft.info/forums2/index.php?/topic/24140-auto-crafty-turtle/