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

Chalenged's turtle programs (tree farm, sorting, etc.)

Started by chalenged, 09 October 2012 - 04:00 AM
chalenged #1
Posted 09 October 2012 - 06:00 AM
Chalenged's tree farm

This is a tree farm i made. The idea is that most tree farms harvest birch trees because of their predictable size, The problem is that they give less wood per sapling than a jungle tree. Jungle trees grow in a much wider range, and give few saplings. My program aims to solve these problems. Although it should work with birch trees, jungle trees grow taller, and are therefore more efficient. My program will harvest what trees exist, go out to the chest, dump it's items, and pulse downward, allowing for an easy minecart system. It will then loop. Set up a nice area like this:

Basically, build a nice field like this, where g=grass, s=sapling, t=turtle, and c=chest (o=air):

oosggggsggggsggggs
oogggggggggggggggg
oogggggggggggggggg
oogggggggggggggggg
oogggggggggggggggg
oosggggsggggsggggs
oogggggggggggggggg
oogggggggggggggggg
oogggggggggggggggg
oogggggggggggggggg
cosggggsggggsggggs
ootooooooooooooooo

have the turtle face that sapling, and run the program. Make sure it has sapling(s) in it's first slot and wood in the second slot.
UPDATE!
It will now automatically refuel! You do, however, need to put EXACTLY 2 chests in it's third slot, and it needs to be a crafty turtle. Also, i added a variable you can change and it will drop saplings in front instead of on bottom.
Rarely, if a tree grows while the top few leaves of the previous tree are still there, the new tree can grow above, causing the turtle to not harvest the whole tree, and leaving a floating wood and leaves. this is VERY rare, however, and i will NOT be fixing it (probably)
pastebin link: http://pastebin.com/11msYdvd
(i added comments for you:))

Chalenged's storage management

I made a turtle program that sorts into a wall of chests. It goes out 8 chests and up 6, but you can configure it if you want (by editing the code atm)
It will go through each chest and compare with whats in it's inventory and place anything thats the same in the chest. This is meant to be used with iron chests mod, so i suggest using that. Place the turtle at the bottom right, out 2 blocks, facing the chests. Place a chest to it's left to have it sort through that whole chest when you run it.
pastebibn link: http://pastebin.com/gJpW98Gk

The fetch program will require you to configure the table how you want. It shouldn't be terribly hard. This fetch program is meant to run off of the same turtle as sort. It will go to the right chest, and do it's best to take what you ask it to, but leave at least one item left for when it sorts. You simple run it like this:
fetch <item> <amount>
Do note it is not perfect, and requesting a multiple of 64 when the chest doesn't have enough will probably take the last one. it will tell you it's errors on monitor at top
link: http://pastebin.com/DSPE0eQT

I made a craft program to use the same wall of chests. You simply create a table of where the items belong in the Recipes table, and then run the program and pass it the item. Don't ask it to craft something if it would result in a stack larger than 64 (i.e. requesting 17 torch), as it will craft a stack and simply bring you the excess. The program is easily capable of complicated recipes, and the piston being one is proof. The table it uses for storage placement is the same as fetch.
link: http://pastebin.com/av5XTdbJ

IMPORTANT!
i am not responsible for damage, loss of turtle, world corruption, friends hacking your turtle, or mental trauma cause by use of my programs. You are free to look at and use parts of my code, however you may not claim my code as your own.
Edited on 11 October 2012 - 10:29 PM
chalenged #2
Posted 11 October 2012 - 03:49 AM
Updated with automatic refual, so you can let your tree farm run endlessly (or until your chunk unloads XD). Also added option to have it drop saplings in front instead of bottom to seperate from wood.
chalenged #3
Posted 12 October 2012 - 12:32 AM
Added a craft program, capable of crafting anything your storage wall can give materials for. Please let me know your opinions and suggestions.
Hodoo #4
Posted 20 October 2012 - 04:46 AM
Could you post a screenshot to show how the sorting wall/turtle should be set up please? :P/>/> It sounds as if it would be very useful to me