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

Turtle keeps Moving Upwards

Started by JaydenLoon3y, 19 December 2012 - 01:20 PM
JaydenLoon3y #1
Posted 19 December 2012 - 02:20 PM
I'm making a lumberjack program and the turtle does not stop

Please post possible fixes

All help would be much appreciated

Here's my code!



H = 7

local function checkFuel()
  if turtle.getFuelLevel() < 20 then
    turtle.select(1)
    turtle.refuel(1)
  end
end

while H == 7 do
  checkFuel()
  turtle.dig()
  turtle.forward()
  H = H-1
end

while H < 7 do
  checkFuel()
  turtle.digUp()
  turtle.up()
  H = H - 1
end

while H == 0 do
  checkFuel()
  turtle.down()
  turtle.down()
  turtle.down()
  turtle.down()
  turtle.down()
  turtle.down()
  checkFuel()
  turtle.turnRight()
  turtle.turnRight()
  turtle.forward()
  turtle.select(4)
  turtle.drop()
  checkFuel()
  turtle.turnRight()
  turtle.turnRight()
  turtle.select(2)
  turtle.place()
  turtle.select(3)
  turtle.place()
  H = H + 7
end 
Lyqyd #2
Posted 19 December 2012 - 02:22 PM
Your previous post was merged into your first question about this same piece of code. Do not keep posting topics just because you think it should be a new thread. Locked.