Advertisement
Guest User

tunnel

a guest
Jan 16th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. function gravelCheck()
  2.   while turtle.detect() do
  3.     turtle.dig()
  4.   end
  5. end
  6. function leftTunnel()
  7.   turtle.turnLeft()
  8.   for i=1, 5 do
  9.     turtle.dig()
  10.     if turtle.detect then
  11.       gravelCheck()
  12.     else
  13.     turtle.forward()
  14.     end
  15.     turtle.digUp()
  16.   end
  17.   for i=1, 5 do
  18.     turtle.back()
  19.   end
  20.   turtle.turnRight()
  21. end
  22. write("")
  23. print("How long")
  24. x = read()
  25. local torch = 0
  26. local digLeft = 0
  27. for i=1, x do
  28.   torch = torch + 1
  29.   digLeft = digLeft + 1
  30.   if digLeft == 4 then
  31.    leftTunnel()
  32.    digLeft=0
  33.   end
  34.   if torch == 10 then
  35.     turtle.select(16)
  36.     turtle.turnRight()
  37.     turtle.placeUp()
  38.     turtle.turnLeft()
  39.     torch=0
  40.   end
  41.   turtle.dig()
  42.   if turtle.detect() then
  43.     gravelCheck()
  44.   else
  45.   turtle.forward()
  46.   end
  47.   turtle.digUp()
  48. end
  49. for i=1, x do
  50.   turtle.back()
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement