Posted 08 January 2013 - 05:22 PM
I created my first real program for a mining turtle (back when they had 9 slots)
Now when I run it in the 1.4 update (turtles have 16 slots) it just spins in a circle
Whats wrong?
Now when I run it in the 1.4 update (turtles have 16 slots) it just spins in a circle
Whats wrong?
function dig()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.up()
turtle.digUp()
turtle.up()
turtle.turnRight()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.down()
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
end
function moveForward()
turtle.select(2)
turtle.dig()
turtle.forward()
if turtle.detectDown() == false then
turtle.placeDown()
end
end
function placeTorch()
turtle.select(1)
turtle.turnLeft()
turtle.turnLeft()
turtle.place()
turtle.turnRight()
turtle.turnRight()
end
term.clear()
term.setCursorPos(1, 1)
print("How Far Should I Dig?")
numberToMine = tonumber(read())
counter = 0
torchCounter = 0
textutils.slowPrint("Please Put 20 Torches in My Top Left Slot")
while turtle.getItemCount(1) < 20 do
sleep(5)
print("Please Insert " .. 20 - turtle.getItemCount(1) .. " more torches")
end
term.clear()
term.setCursorPos(1, 1)
textutils.slowPrint("Now Tunneling")
while counter < numberToMine do
if torchCounter == 10 then
placeTorch()
torchCounter = 0
end
moveForward()
dig()
counter = counter + 1
torchCounter = torchCounter + 1
end
print("Mined Tunnel " .. numberToMine .. " Block(s) Long")