Guest User

Untitled

a guest
Sep 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. write("Please enter depth/2")
  2. depth=read()
  3.  
  4. function dig()
  5.   while not turtle.forward() do
  6.     turtle.dig()
  7.   end
  8. end
  9.  
  10. function cycle()
  11.   dig()
  12.   turtle.digDown()
  13.   turtle.down()
  14.   if not turtle.detectDown() then
  15.     turtle.placeDown() end
  16.   turtle.up()
  17. end
  18.  
  19. turtle.up()
  20. counter=0
  21. for i=0, depth do
  22.   cycle()
  23.   turtle.turnRight()
  24.   cycle()
  25.   if counter==3 then
  26.     turtle.turnRight()
  27.     turtle.select(9)
  28.     turtle.place()
  29.     turtle.select(1)
  30.     turtle.turnLeft()
  31.     counter=0
  32.   end
  33.   turtle.turnLeft()
  34.   cycle()
  35.   turtle.turnLeft()
  36.   cycle()
  37.   turtle.turnRight()
  38.   counter=counter+1
  39. end
  40.  
  41. turtle.turnRight()
  42. turtle.turnRight()
  43. for i=0, depth*2 do
  44.   turtle.forward()
  45. end
Add Comment
Please, Sign In to add comment