Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ARGS = {...}
- x = tonumber(ARGS[1])
- y = tonumber(ARGS[2])
- z = tonumber(ARGS[3])
- if ARGS[1] == nil or ARGS[2] == nil or ARGS[3] == nil then
- print (ARGS[0].." requires 3 numbers to determine size x,y,z")
- os.exit()
- end
- function dig()
- while turtle.detect() do
- turtle.dig()
- end
- end
- function digUp()
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.4)
- end
- end
- flag = 1
- for iy = 1,y do
- for iz = 1,z do
- for ix = 1,x do
- dig()
- turtle.forward()
- end
- if iz ~= z then
- if iz%2 == flag then
- turtle.turnRight()
- dig()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- dig()
- turtle.forward()
- turtle.turnLeft()
- end
- else
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- digUp()
- turtle.up()
- if flag == 0 then
- flag = 1
- else
- flag = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment