Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local X = 16
- local Y = 20
- local Z = 16
- x = 1
- y = 1
- z = 1
- running = "yes"
- direction = "up"
- function mineX()
- while turtle.detect() == true do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- x = x + 1
- end
- function mineZ()
- while turtle.detect() == true do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- z = z + 1
- end
- function mineY()
- turtle.turnRight()
- while z > 1 do
- turtle.forward()
- end
- turtle.turnRight()
- if turtle.detectDown() == true then
- turtle.digDown()
- end
- turtle.down()
- y = y + 1
- end
- function finished()
- while y > 1 do
- turtle.up()
- end
- running = "no"
- end
- function fuel()
- if turtle.getFuelLevel() < 200 then
- turtle.refuel(5)
- end
- end
- while running == "yes" do
- term.clear()
- term.setCursorPos(1,1)
- print("X = ".. x)
- print("Y = ".. y)
- print("Z = ".. z)
- print("fuel = ".. turtle.getFuelLevel())
- fuel()
- if y < Y then
- if z < Z then
- if x < X then
- mineX()
- else
- if direction == "up" then
- turtle.turnRight()
- mineZ()
- turtle.turnRight()
- x = 1
- direction = "down"
- else
- turtle.turnLeft()
- mineZ()
- turtle.turnLeft()
- x = 1
- direction = "up"
- end
- end
- else
- mineY()
- end
- else
- finished()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment