Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- distance = args[1]
- currentDist = 0
- movingBack = false
- i = 0
- turtle.refuel()
- print("Fuel: " .. turtle.getFuelLevel())
- sleep(2)
- doMove(movingBack)
- function doMove (back)
- if back then
- turtle.back()
- end
- if back == false then
- turtle.dig()
- turtle.forward()
- end
- currentDist = currentDist + 1
- i = i + 1
- if i % 10 == 0 then
- print("Fuel: " .. turtle.getFuelLevel())
- i = 0
- end
- if currentDist == distance then
- if movingBack == false then
- currentDist = 0
- movingBack = true
- end
- if movingBack == true then
- return
- end
- end
- if currentDist < distance then
- doMove(movingBack)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement