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

Tree Turtle - Initial Release v1.02 [Session Support!]

Started by Cain, 21 June 2013 - 01:08 PM
Cain #1
Posted 21 June 2013 - 03:08 PM
Hi everyone, I decided to write my own tree turtle script as the "Ultimate Wood Chopper" was turning out to be a little buggy on my server for some strange reason, anyway.

This script comes with two scripts, one called "treeFarm" and one called "startup".

Use the "treeFarm" script initially to build the base and then you can run startup, be sure the correct items are in there however.

Scripts:

If you want to automate the install, use this:
http://pastebin.com/4JpDFRaz
pastebin get 4JpDFRaz initial

Just type initial and it will automatically download, and if you already have the script, update for you.

http://pastebin.com/HEpZc2vf
pastebin get HEpZc2vf treeFarm

http://pastebin.com/mhS0Qzzr
pastebin get mhS0Qzzr startup

For the "treeFarm" script, some items must be placed initially into the turtle for it to build with the right resources.



Once the base has been built, you will have 3 chests beside the turtle.

On the left is where the wood goes, on the right is where the saplings go and on the top is where the bonemeal goes, the turtle DOES NOT need Bonemeal to function however you will get wood much faster.

Good luck everyone, and tell me any bugs you come across.

This is my first real script aswell, with a little bit of help from kyle0440.

Oh, forgot to mention, it places a lever than you can use to turn on/off the turtle script.

Changelog
v1.01 - Changed turtle.forward() to turtle.detect() to see if there is a tree there.
v1.02 - Aded basic session support, will return to original place if it crashed when it was placing bonemeal.
SWGCryand #2
Posted 21 June 2013 - 04:46 PM
Hi everyone, I decided to write my own tree turtle script as the "Ultimate Wood Chopper" was turning out to be a little buggy on my server for some strange reason, anyway.

This script comes with two scripts, one called "treeFarm" and one called "startup".

Use the "treeFarm" script initially to build the base and then you can run startup, be sure the correct items are in there however.

Scripts:
http://pastebin.com/HEpZc2vf
pastebin get HEpZc2vf treeFarm

http://pastebin.com/mhS0Qzzr
pastebin get mhS0Qzzr startup

For the "treeFarm" script, some items must be placed initially into the turtle for it to build with the right resources.



Once the base has been built, you will have 3 chests beside the turtle.

On the left is where the wood goes, on the right is where the saplings go and on the top is where the bonemeal goes, the turtle DOES NOT need Bonemeal to function however you will get wood much faster.

Good luck everyone, and tell me any bugs you come across.

This is my first real script aswell, with a little bit of help from kyle0440.

Oh, forgot to mention, it places a lever than you can use to turn on/off the turtle script.

What saplings are required? Where do we put fuel (What slot?) does it have to have a block under it? Do we need bone meal? We need some more information man :)/>
aaa #3
Posted 21 June 2013 - 06:07 PM
The point of tree farm is to automatically chop wood, and wood is fuel. You sould try or wait for Cain's response, but I guess it automatically refuels (you got to put fuel just the first time)
Edited on 21 June 2013 - 04:08 PM
Cain #4
Posted 21 June 2013 - 09:25 PM
Hi everyone, I decided to write my own tree turtle script as the "Ultimate Wood Chopper" was turning out to be a little buggy on my server for some strange reason, anyway.

This script comes with two scripts, one called "treeFarm" and one called "startup".

Use the "treeFarm" script initially to build the base and then you can run startup, be sure the correct items are in there however.

Scripts:
http://pastebin.com/HEpZc2vf
pastebin get HEpZc2vf treeFarm

http://pastebin.com/mhS0Qzzr
pastebin get mhS0Qzzr startup

For the "treeFarm" script, some items must be placed initially into the turtle for it to build with the right resources.



Once the base has been built, you will have 3 chests beside the turtle.

On the left is where the wood goes, on the right is where the saplings go and on the top is where the bonemeal goes, the turtle DOES NOT need Bonemeal to function however you will get wood much faster.

Good luck everyone, and tell me any bugs you come across.

This is my first real script aswell, with a little bit of help from kyle0440.

Oh, forgot to mention, it places a lever than you can use to turn on/off the turtle script.

What saplings are required? Where do we put fuel (What slot?) does it have to have a block under it? Do we need bone meal? We need some more information man :)/>

Hi, I have tested this only with fir saplings.
You have to put them fuel in initially yourself for the turtle to start working correctly.

(eg: put coal in slot 1, refuel)

It does not require a block under it, and it will stop building the base if there is initially one below it to avoid dupe bases.

Bonemeal is not a requirement.

The point of tree farm is to automatically chop wood, and wood is fuel. You sould try or wait for Cain's response, but I guess it automatically refuels (you got to put fuel just the first time)

The turtle fuels itself from the wood it chops, but needs some initially for it to start. :)/>
Cain #5
Posted 22 June 2013 - 02:01 PM
Clearly this script is a fail as I haven't gotten any responses, oh well.
Niseg #6
Posted 23 June 2013 - 10:14 AM
Hi everyone, I decided to write my own tree turtle script as the "Ultimate Wood Chopper" was turning out to be a little buggy on my server for some strange reason, anyway.

I think Unobtainium fixed his session persistence in UWC but I haven't tested it . I wrote a similar script to his (without the collection setup ) and had the same problems with session persistence and I went all the way to turn the whole script into a state machine. The problem is always using counters and saving them to file. File saves in Computer craft are instant while server saves are not . This causes the script to think it's more ahead than it actually is. Detecting the environment /inventory is always the best option. Unobtainium fixed his script by cutting the bottom first and then cut the tree until it hits an empty block and then cut down the tree until it hits an empty blocks . Without counters UWC should be much more reliable.

After a quick look in your script I found a problem in line 89 where you have an infinite recursion until the tree grows . You can also replace the turtle.forward() with a turtle.detect() and a while loop. I'm still not sure about the tree cutting mechanics and what happens when the server reset.
Cain #7
Posted 23 June 2013 - 03:46 PM
Hi everyone, I decided to write my own tree turtle script as the "Ultimate Wood Chopper" was turning out to be a little buggy on my server for some strange reason, anyway.

I think Unobtainium fixed his session persistence in UWC but I haven't tested it . I wrote a similar script to his (without the collection setup ) and had the same problems with session persistence and I went all the way to turn the whole script into a state machine. The problem is always using counters and saving them to file. File saves in Computer craft are instant while server saves are not . This causes the script to think it's more ahead than it actually is. Detecting the environment /inventory is always the best option. Unobtainium fixed his script by cutting the bottom first and then cut the tree until it hits an empty block and then cut down the tree until it hits an empty blocks . Without counters UWC should be much more reliable.

After a quick look in your script I found a problem in line 89 where you have an infinite recursion until the tree grows . You can also replace the turtle.forward() with a turtle.detect() and a while loop. I'm still not sure about the tree cutting mechanics and what happens when the server reset.

That problem is not a bug, it's a feature. Also I updated the script to v1.01 to change forward to detect. :)/>