Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args={...}
- local dist = tonumber(args[1]) or 16
- local width = tonumber(args[2]) or 16
- if dist*width*1.2<turtle.getFuelLevel() then
- print("more fuel required")
- return
- end
- local turn={[0]=turtle.turnLeft, [1]=turtle.turnRight}
- for i=1,width do
- turtle.digDown()
- for j=1,dist-1 do
- while turtle.detect() do
- turtle.up()
- end
- turtle.forward()
- turtle.digDown()
- end
- if i<width then
- turn[i%2]()
- turtle.forward()
- turn[i%2]()
- end
- end
- --return to start
- turtle.back(dist-1)
- turtle.turnLeft()
- turtle.back(width-1)
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement