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

farming turtle

Started by Syntron, 02 December 2012 - 10:41 PM
Syntron #1
Posted 02 December 2012 - 11:41 PM
hello guys,
im busy at writing a code for the farming turtle for farming my wheat and i have two questions about it.

1. Is there a lua command for the farming turtle to check if the crops are fully grown? i didnt found one on the wikipage

2. I just started and put my code together and it looks maintenant like this:

Spoiler

while turtle.detect() == false do
  turtle.digDown()
  turtle.placeDown()
  turtle.forward()
  turtle.detect()
end

if turtle.detect() == true then
turtle.turnLeft()
turtle.detect()
end


my problem is the following:
my turtle does everything fine exept for the part where it turn left. the turtle stops after turing left everytime i try it… i dont know why but its a dumb fail for sure >.>
can i do anything about it?
sjele #2
Posted 03 December 2012 - 12:43 AM
As of now there is not a function to check if wheat is fully grown.

STops after turning left? You notice you have only one function called after turtle.turnLeft() and that dosent show visualy.

Allso is that the full code?
Doyle3694 #3
Posted 03 December 2012 - 12:45 AM
ASTU is really helpful for checking for example if wheat is fully grown
Syntron #4
Posted 03 December 2012 - 01:41 AM
ASTU is what please?

yes thats the full code. yes it turn left and after that it should detect there is nothing-> false and above is written:
while turtle.detect() ==false do
shouldnt it loop again the first part?

Edit: So does this mean i can compare the wheat item with the fully grown crop block?
Doyle3694 #5
Posted 03 December 2012 - 01:47 AM
http://www.computerc...urnace-turtles/

The database turtle is perfect for your purpose :)/>
Syntron #6
Posted 03 December 2012 - 01:59 AM
oh cool :D/>
but it woulb also nice to know why this code does not made my turtle do what i want it do.
ChunLing #7
Posted 03 December 2012 - 04:05 AM
Your turtle stops after turning left because it has reached the end of the program. The while loop only operates while not turtle.detect(). Once that loop is exited, a few more things happen and the program exits, just as it should.