Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local size = {...}
- if size ~= 3 then
- print("I need an x, y,")
- print("and z coordinate.")
- print("Try again.")
- term.clear()
- term.setCursorPos(1,1)
- error()
- else
- print("Digging a hole...")
- end
- function move(count)
- for z = 1, count do
- turtle.forward()
- end
- end
- function next(length, width)
- if width % 2 == 0 then
- turtle.turnRight()
- turtle.move(width - 1)
- turtle.turnRight()
- else
- turtle.turnRight()
- turtle.turnRight()
- move(length - 1)
- turtle.turnRight()
- move(width - 1)
- turtle.turnRight()
- end
- turtle.down()
- end
- function home(depth)
- for i = 1, depth do
- turtle.up()
- end
- turtle.back()
- print("Hole complete. :)")
- end
- for i = 1, size[3] do
- for j = 1, size[2] do
- for k = 1, (size[1] - 1) do
- turtle.digDown()
- turtle.forward()
- end
- turtle.digDown()
- if j == size[2] then
- next(size[1], size[2])
- elseif j % 2 == 0 then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- end
- Home(size[3])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement