Posted 02 January 2013 - 05:01 AM
Hello everyone who is reading this i have some problems with my program
im trying to make a mining turtle to dig a tunnel, but it dosnt perform a loop correctly
i have tried testing it out by putting some gravel in front of it but it only dig 1 gravel out then carry on the script
im trying to make a mining turtle to dig a tunnel, but it dosnt perform a loop correctly
i have tried testing it out by putting some gravel in front of it but it only dig 1 gravel out then carry on the script
local fuel = 1
local x = 0
term.clear()
term.setCursorPos(1,1)
print("Turtle has started")
function getFuel()
if turtle.getFuelLevel() <=10 then
turtle.select(1)
turtle.refuel(2)
end
end
function Detect() -- this function
while turtle.detect() do
turtle.dig()
end
end
getFuel()
turtle.up()
while x < 16 do --digging the tunnel
Detect()
turtle.forward()
turtle.digDown()
turtle.turnRight()
Detect()
turtle.forward()
turtle.turnLeft()
turtle.digDown()
Detect()
turlle.forward()
turtle.digDown()
turtle.turnLeft()
Detect()
turtle.forward()
turtle.turnRight()
turtle.digDown()
x = x + 1
end