Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- if #args ~= 1 then
- print( "Usage: program <distance>" )
- error()
- end
- function moveForward()
- repeat
- turtle.dig()
- until turtle.forward()
- end
- function moveUp()
- repeat
- turtle.digUp()
- until turtle.up()
- end
- function moveDown()
- repeat
- turtle.digDown()
- until turtle.down()
- end
- function iterate(k)
- for j=1, k do
- moveUp()
- end
- moveForward()
- for j=1, k do
- moveDown()
- end
- moveForward()
- end
- length = args[1]
- for i=1, length do
- turtle.select(1)
- turtle.refuel()
- iterate(5)
- end
- turtle.turnLeft()
- iterate(1)
- turtle.turnLeft()
- for i=1, length do
- turtle.select(1)
- turtle.refuel()
- iterate(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement