Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main()
- checkForGravel("forward")
- turtle.dig()
- turtle.forward()
- checkForGravel("up")
- turtle.digUp()
- turtle.digDown()
- setTorch()
- local counter = 0
- while counter < 10
- do
- digLeft()
- digRight()
- nextRow()
- counter = counter + 1
- end
- end
- function nextRow()
- turtle.checkForGravel("forward")
- turtle.dig()
- turtle.forward()
- turtle.checkForGravel("forward")
- turtle.dig()
- turtle.forward()
- setTorch()
- end
- function checkForGravel(direction)
- if direction == "up" then
- if turtle.inspectUp() == 13
- then
- reactToGravel(direction)
- end
- else
- if direction == "forward"
- then
- if turtle.inspect() == 13
- then
- reactToGravel(direction)
- end
- end
- end
- end
- function reactToGravel(direction)
- if direction == "up" then
- turtle.digUp()
- checkForGravel("up")
- end
- if direction == "forward" then
- turtle.dig()
- checkForGravel("forward")
- end
- end
- function setTorch()
- turtle.select(1)
- turtle.placeDown()
- end
- function digLeft()
- turtle.turnLeft()
- local counter = 0
- while counter < 7
- do
- turtle.dig()
- checkForGravel("forward")
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- checkForGravel("up")
- counter = counter + 1
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.down()
- while counter >= -1
- do
- if turtle.detectDown() == false then
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- end
- counter = counter - 1
- end
- turtle.up()
- turtle.forward()
- turtle.turnLeft()
- end
- function digRight()
- turtle.turnRight()
- local counter = 0
- while counter < 7
- do
- turtle.dig()
- checkForGravel("forward")
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- checkForGravel("up")
- counter = counter + 1
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.down()
- while counter >= -1
- do
- if turtle.detectDown() == false
- then
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- end
- counter = counter - 1
- end
- turtle.up()
- turtle.forward()
- turtle.turnRight()
- end
- function checkStorage()
- local counter = 1
- while counter <= 16
- do
- if turtle.getItemCount(counter) < 64
- then
- return true
- end
- counter = counter + 1
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement