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

[1.41] Full-Automatic Tree Farmer v1.0

Started by Jan, 14 August 2012 - 09:19 AM
Jan #1
Posted 14 August 2012 - 11:19 AM
[1.41] Full-Automatic Tree Farmer v1.0

Why?

You might ask "Why yet another tree farmer?". Well, this one is different from others. The most important difference is that it doenst only cut the trunk of the tree, but also the leaves. This way the turtle has always enough saplings in his inventory, for continuous use.


(Screenshot of my large treefarm on Noodle's server)

Features
- Cut's leaves for saplings
- Checks multiple trees, by following a user defined path
- Places saplings
- Doesnt crash if a mob stands in the way
- Optionally drops off wood in a chest

Requirements
- A flat area (of any material)
- Dirt blocks
- Birchtree saplings
- A mining turtle (or axe turtle)
- A chest or two

Download
http://pastebin.com/TN64uSSX
or if http API is enabled, do ingame:

pastebin get TN64uSSX tree

Set-up
1. First make sure you got the requirements.
Then place the dirt blocks on the flat area, with 4 air blocks inbetween. For example:


2. Next, make a hole in the ground, before a dirtblock. Make sure there is free space on the right . Place a (double) chest so, that there are 2 air blocks, between the chest and the hole.



3. Then we place navigation blocks to tell the turtle where he should go. The navigation blocks work like so

If there are no navigation blocks, go straight on
If there is a navigation block left, go to the right
If there is a navigation block right, go to the left
(a navigation block can be any kind of block)
Make a nice path through your dirtblocks using them


4. Check if the path is a nice circle


5. Place the turtle if front of a dirtblock. Add the birchtree saplings in the first slot and run the program!



Now the turle will start farming, full-automatic :P/>/>

License

1. I am not responsible for damage
2. Don't remove the license when sharing
3. please give me credit if you share it :D/>/>

Changelog
- initial release v1.0

Bugs
- Turtle stops when the chunks is unloaded.
Possible fixes:
- maybe the cc-devs will add a feature that keeps chunks with turtles loaded.
- Make the turtle resume after the chunk is loaded again (via persistant variables)

Upcoming features
None yet. Suggestions are welcome.
basdxz #2
Posted 16 August 2012 - 10:25 PM
Works great! Could you add bonemeal to the program?
Jan #3
Posted 16 August 2012 - 10:37 PM
Works great! Could you add bonemeal to the program?
Glad to hear that it works on other's computers too :(/>/>

For the bonemeal, maybe try editing line 48 Replace this:

up() sleep(1)
with this:

up() sleep(1) turtle.select(16) turtle.place() turtle.select(1)
And put bonemeal in slot 16 ofcourse. Havent tested it, tell me if it works :)/>/>
BigSHinyToys #4
Posted 16 August 2012 - 11:06 PM
I like how it pathfinds with placed blocks and detects chest drop off point with a hole It is a simple but effective system. I was looking for a tree felling program and think i just found it. good work.
basdxz #5
Posted 17 August 2012 - 02:24 PM
Works great! Could you add bonemeal to the program?
Glad to hear that it works on other's computers too :)/>/>

For the bonemeal, maybe try editing line 48 Replace this:

up() sleep(1)
with this:

up() sleep(1) turtle.select(16) turtle.place() turtle.select(1)
And put bonemeal in slot 16 ofcourse. Havent tested it, tell me if it works :)/>/>
Yeah it works, but it deposits the bonemeal to the chest with the wood and extra saplings :(/>/> .
Jan #6
Posted 17 August 2012 - 11:21 PM
Works great! Could you add bonemeal to the program?
Glad to hear that it works on other's computers too :)/>/>

For the bonemeal, maybe try editing line 48 Replace this:

up() sleep(1)
with this:

up() sleep(1) turtle.select(16) turtle.place() turtle.select(1)
And put bonemeal in slot 16 ofcourse. Havent tested it, tell me if it works :)/>/>
Yeah it works, but it deposits the bonemeal to the chest with the wood and extra saplings :(/>/> .
Oh LOL ofc! Replace line 40 then:

for k=2,16 do
with

for k=2,15 do
Now it shouldnt drop the bonemeal.
SilentPro #7
Posted 18 August 2012 - 02:16 AM
It's not "full-automatic" unless it refuels itself from time to time, ie if fuel level drops below a threshold.
You could/should use the harvested wood as a fuel as it comes free without limit.
BigSHinyToys #8
Posted 18 August 2012 - 03:54 AM
It's not "full-automatic" unless it refuels itself from time to time, ie if fuel level drops below a threshold.
You could/should use the harvested wood as a fuel as it comes free without limit.
refueling from saplings and or wood could be a nice feature.
Jan #9
Posted 18 August 2012 - 01:37 PM
It's not "full-automatic" unless it refuels itself from time to time, ie if fuel level drops below a threshold.
You could/should use the harvested wood as a fuel as it comes free without limit.
Oh on the server I play on, I need no fuel. So I am not familiar with fuelling
But self-fueling is nice idea. Does anyone know if saplings or wood are accepted as fuel? Otherwise it should put birchtree wood in a furnace and use charcoal (if charcoal can be used instead of coal). You may try to implement it if you like.
zaper270 #10
Posted 18 August 2012 - 10:52 PM
It works well but when my turtle reaches the chest it just drops the items infront of it instead of putting them in the chest
Jan #11
Posted 19 August 2012 - 04:21 PM
It works well but when my turtle reaches the chest it just drops the items infront of it instead of putting them in the chest
Try moving the chest? :D/>/>

EDIT: Make sure you got the latest version of ComputerCraft
chalenged #12
Posted 28 August 2012 - 05:12 AM
I've been using this and it's been working amazingly (don't have forestry on my server). I tried replacing birch saplings with rubber ones from industrial craft, and it doesn't work because sometimes they grow to high or too low. Can you make this work with rubber trees as well? or have a seperate function for rubber trees?
Jan #13
Posted 31 August 2012 - 12:08 PM
I've been using this and it's been working amazingly (don't have forestry on my server). I tried replacing birch saplings with rubber ones from industrial craft, and it doesn't work because sometimes they grow to high or too low. Can you make this work with rubber trees as well? or have a seperate function for rubber trees?
Nice to hear that you enjoy the program :)/>/>
But for rubbertrees, I dont exactly know how these grow. This program does a standard-procedure as soon as it hits the first leaf.
So it could be, that an extra wood block is left behind on the top of the tree.
Maybe you could give me a screenshot? Then I can propose a fix. Or you can try out yourself.
Andale #14
Posted 06 September 2012 - 06:29 AM
Ok, I just realized that it might not work at all since tekkit is still 1.3 CC so if it won't just tell me and I'll try another one.

Here's been my issue: It does the path fine, it plants the saplings fine, it gets to the end of the path and just stops dead at the chest and only deposits 2 saplings (started with 64 and planted 16), if I bonemeal a tree it goes up to the leaves then stops at the leaves.

I made a video to explain the last bit.
I had to copy the entire thing manually since the pastebin wouldn't work for some reason and it won't copy/paste all of it, only one line at a time. Anyway, I did my best to copy it, tho skipped the line gaps.
Found out how to add in Win Explorer
Video
Jan #15
Posted 09 September 2012 - 04:18 PM
Ok, I just realized that it might not work at all since tekkit is still 1.3 CC so if it won't just tell me and I'll try another one.

Here's been my issue: It does the path fine, it plants the saplings fine, it gets to the end of the path and just stops dead at the chest and only deposits 2 saplings (started with 64 and planted 16), if I bonemeal a tree it goes up to the leaves then stops at the leaves.

I made a video to explain the last bit.
I had to copy the entire thing manually since the pastebin wouldn't work for some reason and it won't copy/paste all of it, only one line at a time. Anyway, I did my best to copy it, tho skipped the line gaps.
Found out how to add in Win Explorer
Video
If the error still occurs when you have exactly the same code, the problem could be Zone protection.
Add the turtle, for example id 99, to the area with the name [ComputerCraft]99
nathanhd123 #16
Posted 17 November 2012 - 07:18 AM
Ok, I just realized that it might not work at all since tekkit is still 1.3 CC so if it won't just tell me and I'll try another one.

Here's been my issue: It does the path fine, it plants the saplings fine, it gets to the end of the path and just stops dead at the chest and only deposits 2 saplings (started with 64 and planted 16), if I bonemeal a tree it goes up to the leaves then stops at the leaves.

I made a video to explain the last bit.
I had to copy the entire thing manually since the pastebin wouldn't work for some reason and it won't copy/paste all of it, only one line at a time. Anyway, I did my best to copy it, tho skipped the line gaps.
Found out how to add in Win Explorer
Video

I have had a similar problem, however with me when the mining turtle gets to the chest it just spits the items out onto the floor (not into the chest) and then stops dead. Also my turtles seem to have only 9 slots rather than 16.