Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x, y, z
- local width, length, depth = 0, 0, 0
- local xPos, yPos, zPos = 0, 0, 0
- function digLevel(w, l, d)
- x=0
- y=0
- z=0
- turtle.down()
- while z < tonumber(d) do
- while x < tonumber(w) do
- if y > 0 then
- while y< tonumber(l) do
- digOn()
- y = y + 1
- end
- else
- while y>0 do
- digOn()
- y=y-1
- end
- end
- newRow(y)
- x=x+1
- end
- goDown(x,y)
- x=0
- y=0
- end
- end
- function newRow(yy)
- turtle.digDown()
- if yy>1 then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- turtle.forward()
- turtle.digDown()
- if yy>1 then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- function digOn()
- turtle.digDown()
- turtle.forward()
- end
- function goDown(xx,yy)
- if yy>1 then
- turtle.turnRight()
- while yy > 0 do
- turtle.forward()
- yy=yy-1
- end
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- while xx > 0 do
- turtle.forward()
- xx = xx - 1
- end
- turtle.down()
- turtle.digDown()
- turtle.turnRight()
- end
- term.write("What is the width of your quarry? ")
- width = read()
- term.write("What is the length of your quarry? ")
- length = read()
- term.write("How deep? ")
- depth = read()
- digLevel(width, length, depth)
Advertisement
Add Comment
Please, Sign In to add comment