Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local runif = true
- turtle.select(1)
- turtle.refuel()
- print(turtle.getFuelLevel())
- local selectedSlot = 2
- turtle.select(selectedSlot)
- local previousRotation = 1
- local turnCount = 0
- while runif do
- if turtle.getItemCount() == 0 then
- selectedSlot = selectedSlot + 1
- turtle.select(selectedSlot)
- end
- if turtle.getItemCount(16) == 64 then
- runif = false
- else
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- turnCount = 0
- else
- if turnCount == 0 then
- if previousRotation == 1 then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- previousRotation = 0
- else
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- previousRotation = 1
- end
- else
- runif = false
- end
- turnCount = 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement