Advertisement
Guest User

digLayer

a guest
Jun 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. function dig()
  2.   while turtle.detectUp() do
  3.     turtle.digUp()
  4.   end
  5.   while turtle.detect() do
  6.     turtle.dig()
  7.   end
  8.   while turtle.detectDown() do
  9.     turtle.digDown()
  10.   end
  11. end
  12.  
  13. function digRow(n)
  14.   for i = 1,n do
  15.     dig()
  16.     turtle.forward()
  17.   end
  18. end
  19.  
  20. function digBlock()
  21.   for i = 1, 6 do
  22.     digRow(11)
  23.     turtle.turnRight()
  24.     digRow(1)
  25.     turtle.turnRight()
  26.     digRow(11)
  27.     turtle.turnLeft()
  28.     digRow(1)
  29.     turtle.turnLeft()
  30.   end
  31. end
  32.  
  33. function digLayer()
  34.   digBlock()
  35.   turtle.turnLeft()
  36.   digRow(1)
  37.   for x = 1,3 do
  38.     turtle.digDown()
  39.     turtle.down()
  40.   end
  41. end
  42.  
  43. for i = 1,16 do
  44.   digLayer()
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement