Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg = {...}
- if arg == nil then
- print("Usage: 6x6 <forward> <right> <down>")
- return 2
- end
- z = tonumber (arg[1])
- x = tonumber (arg[2])
- y = tonumber (arg[3])
- function checkInv()
- for i=1,16 do
- if turtle.getItemCount(i) == 0 then
- print("Slot number "..i.." is empty, returning")
- return
- end
- end
- turtle.select(16)
- turtle.placeUp()
- for q=1,15 do
- turtle.select(q)
- turtle.dropUp()
- end
- turtle.select(1)
- end
- function dig(x)
- for i=1,x do
- turtle.digDown()
- turtle.forward()
- turtle.digDown()
- checkInv()
- end
- end
- for i=1,y do
- print("Starting level: "..i)
- for o=1,x do
- print("Starting row: "..o)
- if o == x then
- dig(z-1)
- elseif o%2 == 0 then
- dig(z-1)
- turtle.turnLeft()
- dig(1)
- turtle.turnLeft()
- else
- dig(z-1)
- turtle.turnRight()
- dig(1)
- turtle.turnRight()
- end
- end
- if i==y then
- print("Finished")
- elseif x%2 == 1 then
- turtle.turnRight()
- turtle.turnRight()
- turtle.down()
- elseif x%2 == 0 then
- turtle.turnRight()
- turtle.turnRight()
- turtle.down()
- dig(z-1)
- turtle.turnRight()
- turtle.turnRight()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment