Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function turtle.forwards(numForw)
- for i = 1, numForw do
- turtle.forward()
- end
- end
- function turtle.upwards(numUpw)
- for i = 1, numUpw do
- turtle.up()
- end
- end
- function turtle.downwards(numDownw)
- for i = 1, numDownw do
- turtle.down()
- end
- end
- function turtle.turns180()
- for i = 1, 2 do
- turtle.turnRight()
- end
- end
- function scan()
- if turtle.detect() then
- turtle.dig()
- end
- end
- function scanUp()
- if turtle.detectUp() then
- turtle.digUp()
- end
- end
- function mining(distance)
- for i = 1, distance do
- scan();
- scanUp();
- turtle.forward()
- i = i + 1;
- end
- scanUp();
- for i = 1, distance do
- turtle.back()
- i = i - 1;
- end
- end
- print("input mining length")
- local distance = tonumber(io.read())
- while not distance do
- print("Invalid input. Please enter a number.")
- distance = tonumber(io.read())
- end
- mining(distance)
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- mining(distance)
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- mining(distance)
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- mining(distance)
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- mining(distance)
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- mining(distance)
- turtle.turnLeft()
- turtle.forwards(5)
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement