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

powerful Tree Farm

Started by Kaikaku, 03 March 2015 - 02:20 PM
Kaikaku #1
Posted 03 March 2015 - 03:20 PM
Program aTreeFarm

Hi there! There are already lots of tree farm programs shared here, so you might ask: "Why adding one more to the list?"
Well, I think this program is a little bit different from what I've seen so far and it's quite powerful.

Features:
- automatic tree farm set-up (small thing, but usefull)
- no bonemeal
- turtle auto-refuels from crafted planks
- uses up to 88 saplings (I think)
- collects sapplings and replants them
- handles allmost all tree types (some modded trees are hard to handle…)
- handels 2x2 trees
- easy to use (I hope)
- everything within one chunk
- option to switch off with redstone signal
- option to set how many rounds the turtle should go

Program:
http://pastebin.com/JgRgRK5q

Video:
[media]http://youtu.be/eMxNI2QjO1k[/media]

Output test:
I tested 12 tree types, started with new empty farms and 64 sapplings
and this is the output after 2 hours (planted sapplings not included).


Improvement ideas:
- add GPS support for startup (would need to swap out the crafting table)
- as the turtle doesn't collect all sapplings a water system or s.th. like a vacuum hopper would help
- I have some ideas for a different approach that could be a bit more efficient, but who needs so much wood? ;)/>


If you have comments, feedback or improvement ideas I'd like to hear them :)/>
AngelWhite193 #2
Posted 01 April 2015 - 12:06 AM
need startup for this program :(/>
Lupus590 #3
Posted 01 April 2015 - 01:06 AM
for any program to start at on computer boot make a file called startup in the root directory

add this code to it

shell.run("programName")

where programName is the path and name of the program you want to run
Kaikaku #4
Posted 01 April 2015 - 07:22 AM
need startup for this program :(/>
for any program to start at on computer boot make a file called startup in the root directory

add this code to it

shell.run("programName")

where programName is the path and name of the program you want to run

Yes, that's generally right.

In order to make the turtle start this program without asking for pressing enter a few times, you need to add any additional parameter (well, not setup).
If this is a number, the turtle will go for so many rounds and stops then.
For example: Save the following line of code as startup and the turtle will go for 4 rounds, when the chunk is loaded.

shell.run("aTreefarm 4")

When the chunk is unloaded (not using a chuck loader, save single player world, sever shut down) the turtle will stop execution where it is and later starts from this point.
To prevent the turtle from doing so, please make sure that it halts at its starting position (e.g. by only going for x rounds / applying a redstone signal at its back / manual shut-down).
I think in part 2 of the video I give some info about this.
stubob #5
Posted 04 April 2015 - 11:42 PM
This is amazing! Thank you.
Kaikaku #6
Posted 09 April 2015 - 08:06 AM
This is amazing! Thank you.

You're welcome and many thanks :)/>
Zair #7
Posted 23 May 2015 - 03:10 PM
Suggestion: It appears that the turtle uses the chest to store wood in before refueling, then pulls wood out if necessary to refuel. I set up some pipes to pull the products out of the chest automatically, and this caused the turtle to eventually run out of fuel. Would it be possible to have the Turtle maintain a constant supply of wood and/or planks internally so that the chest could be kept empty?

Question/problem/bug?: I ran into an issue where the program would hang on the the startup step where it says "Provide materials and press enter:" with the instructions above. Pressing enter does nothing, I can type into the prompt but when I press enter it just deletes what I typed and does nothing. The setup worked fine, it is just the run step that is failing. This program was working a few weeks ago the last time I used it, just now it is failing. Any suggestions?

Thank you very much for an excellent program, and thanks in advance for the support and/or future expansion!
~Zair

Edit: Running FTB Ultimate v1.7.10 pack
Edited on 23 May 2015 - 03:55 PM
Zeplar #8
Posted 16 June 2015 - 07:49 PM
Question/problem/bug?: I ran into an issue where the program would hang on the the startup step where it says "Provide materials and press enter:" with the instructions above. Pressing enter does nothing, I can type into the prompt but when I press enter it just deletes what I typed and does nothing. The setup worked fine, it is just the run step that is failing. This program was working a few weeks ago the last time I used it, just now it is failing. Any suggestions?

Thank you very much for an excellent program, and thanks in advance for the support and/or future expansion!
~Zair

Edit: Running FTB Ultimate v1.7.10 pack

The program requires that you have 11+ saplings, *exactly one* log, and *exactly one* chest. If your turtle has >1 log in its inventory, it won't start.
YukiiSan #9
Posted 17 August 2015 - 04:08 AM
Hello all!

I was definitely excited about trying this program out, however once placing all the correct items into the correct slots and pressing enter to start, I got this message….
fell:173: attempt to perform arithmetic__sub on string and number
Fell being the program name as most will probably know.

What can I do to fix this?
Restioson #10
Posted 25 December 2015 - 05:30 PM
Suggestion: It appears that the turtle uses the chest to store wood in before refueling, then pulls wood out if necessary to refuel. I set up some pipes to pull the products out of the chest automatically, and this caused the turtle to eventually run out of fuel. Would it be possible to have the Turtle maintain a constant supply of wood and/or planks internally so that the chest could be kept empty?

This would be a good idea ^^
Restioson #11
Posted 26 December 2015 - 07:41 AM
I'm getting an error which relates to auto-refuelling. I believe this is because there is no fuel in slot 15, maybe this is because of autocrafting failing.

Screenshots:
SpoilerError log
Turtle inventory
Chest inventory

Also, I have a suggestion pertaining to running the program. When you run the program setup, it places a chest down at the beginning of the loop. However, when you run the program, it still requires you to provide it with a chest, leading to a setup like this.

Thanks,
Restioson
Towtow10 #12
Posted 26 January 2016 - 05:47 AM
I have made a modified version of this to be compatible with turtles with unlimited fuel.
http://pastebin.com/xWGAdiP6
Foogles #13
Posted 26 January 2016 - 05:40 PM
This is a fantastic program! I use it gather fuel for my farming turtle :)/>
stubob #14
Posted 22 February 2016 - 05:21 AM
I really enjoy this one. A startup/resume script would be real nice though.
Andale #15
Posted 07 April 2016 - 04:07 PM
Improvement ideas:
- add GPS support for startup (would need to swap out the crafting table)


If you have comments, feedback or improvement ideas I'd like to hear them :)/>

Gonna suggest that rather than a gps you set it up to track its position either to an external file or by using the blocks below.

With the external file the problem becomes possibly bad data depending on the timing of restarts. I've tried this and it worked, but now every time. Sometimes it would update the file before the move and so the restart would put it back 1 block.


The pathway blocks are a great way to do it tho. If you had a separate autonomous program as a startup file that made it drop down and compare blocks for the path (which means saving 1 path block) and travel to the end of the path by comparing under and to sides. The easiest way would be to make it do compare/move until it got to the chest and then to begin the normal program. It would waste some fuel, but probably better than having to hunt the thing out of the trees grown around it.


I'd also point out that you should either remove the 20 minimum saps to start or make it save at least 20. Every restart I have to manually farm to get 15 or so saps to restart it.
Edited on 07 April 2016 - 02:12 PM
Makenshi #16
Posted 02 February 2018 - 11:55 PM
I know this is a necro, but I've exhausted all options to fix this problem. So please bear with me.

I've made the turtle and put in all the required materials and told it to run the setup. However when it asks for fuel no matter what I put in, whether its a single item or a whole stack, the turtle registers only 20/1920 fuel and deletes everything else in the fuel slot. I've tried logs, planks, coal, charcoal, but nothing makes it register over 20 fuel.

If I modify the program to require only 20 fuel, then it works and places anywhere from 9-13 blocks for the path and then stops. After that the only way to get it to do anything is break it and start over. So I have no idea what to do. I'm on a 1.7.10 server if that helps.
Bomb Bloke #17
Posted 03 February 2018 - 03:37 AM
Can you get any turtle past 20 fuel? If you type "refuel all" straight into the command prompt, it'll attempt to charge up off anything in its inventory. It sounds like your server owner has changed ComputerCraft's config.