Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local B_x = 0
- local B_z = 0
- local B_y = 0
- local orient = 0
- local depth = 3
- local width = 2
- function dig(f)
- print("starting")
- for i=1,depth do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- B_x=B_x+(f*1)
- end
- if (orient==0) do
- turnright()
- else if(orient==2) do
- turnleft()
- end
- end
- function turnright()
- if width >1 then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- B_z=B_z+1
- width = width -1
- orient = orient +2
- dig(-1)
- else
- comeback()
- end
- end
- function comeback()
- print("returning")
- while orient >4 do
- orient = orient -4
- end
- for i=1, B_x do
- turtle.back()
- end
- if orient == 2 do
- turtle.turnRight()
- orient = 3
- end
- for i=1 B_y do
- turtle.forward()
- end
- turtle.drop()
- end
- dig(1)
- comeback()
Add Comment
Please, Sign In to add comment