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

How to detect if a tree is grown

Started by wxyzsupermod, 27 January 2016 - 12:21 AM
wxyzsupermod #1
Posted 27 January 2016 - 01:21 AM
Hi guys I am new to CCraft but am a fairly experienced programmer and I am trying to make a tree farm. The problem is I have code basically

if turtle.detect

chop tree until no more wood

go down to ground

go back one and plant

that is just pesudocode I have the actual save in a turtle anyway it detects a sapling as a block and that makes it continuously try to cut down the tree even though the sapling hasn't grown also there is turtle.compare which I tried to use but the doesn't seem to be turtle.compareForward just up and down so how can I detect if a sapling grows and not just a sapling
Bomb Bloke #2
Posted 27 January 2016 - 07:14 AM
turtle.compare() checks the item in the currently selected slot against whatever's in front of the turtle; that's the "turtle.compareForward()" you're looking for.
Lupus590 #3
Posted 27 January 2016 - 09:37 AM
If you don't know about it already, you may find the wiki very useful: http://computercraft...i/Category:APIs

if you scroll to the bottom of that page, you will get all of the APIs with links to function descriptions
Edited on 27 January 2016 - 08:38 AM