astonish01

Corridor

Feb 16th, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if turtle.getFuelLevel() < 1000 then
  2.     turtle.select(16)
  3.     turtle.refuel()
  4.     turtle.select(1)
  5. end
  6. function breakRight()
  7.     for i=1, 1 do
  8.         turtle.dig()
  9.         turtle.turnLeft()
  10.         turtle.forward()
  11.         turtle.turnRight()
  12.         turtle.dig()
  13.         turtle.turnLeft()
  14.         turtle.forward()
  15.         turtle.turnRight()
  16.         turtle.dig()
  17.     end
  18. end
  19.  
  20. function breakLeft()
  21.     for i=1, 1 do
  22.         turtle.dig()
  23.         turtle.turnRight()
  24.         turtle.forward()
  25.         turtle.turnLeft()
  26.         turtle.dig()
  27.         turtle.turnRight()
  28.         turtle.forward()
  29.         turtle.turnLeft()
  30.         turtle.dig()
  31.     end
  32. end
  33. print("Corridor length: ")
  34. local length = tonumber(read())
  35. for i=1,length do
  36.     breakLeft()
  37.     turtle.up()
  38.     breakRight()
  39.     turtle.up()
  40.     breakLeft()
  41.     turtle.up()
  42.     breakRight()
  43.     turtle.up()
  44.     breakLeft()
  45.     turtle.turnRight()
  46.     turtle.forward()
  47.     turtle.forward()
  48.     turtle.turnLeft()
  49.     turtle.down()
  50.     turtle.down()
  51.     turtle.down()
  52.     turtle.down()
  53.     turtle.forward()
  54.     turtle.turnLeft()
  55.     turtle.forward()
  56.     turtle.forward()
  57.     turtle.turnRight()
  58. end
Add Comment
Please, Sign In to add comment