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

MineTurtle Code

Started by mineturtle2, 06 December 2016 - 11:02 PM
mineturtle2 #1
Posted 07 December 2016 - 12:02 AM
I want to add code to make the turtle return at the end.
http://pastebin.com/5ZfcRLkf
Thank you!
Edited on 07 December 2016 - 01:25 PM
KingofGamesYami #2
Posted 07 December 2016 - 02:59 AM
If you fix your indentation, the problem becomes quite obvious:


length=10
for i=1, length, 1 do --#this loop doesn't have a specified end!
  while turtle.detect() do
    turtle.dig()
    sleep(1)
  end

  while turtle.detectUp() do
    turtle.digUp()
    sleep(1)
  end

  if turtle.dectectDown()
    turtle.digDown()
  end
--# You should add one here!
Dog #3
Posted 07 December 2016 - 04:54 AM
You're also missing a then for your if statement…

if turtle.dectectDown() then --# you're missing a then right here
  turtle.digDown()
end