BillBodkin

level

Jun 22nd, 2021
843
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function DigUp()
  2.     while turtle.detectUp() do
  3.         turtle.digUp()
  4.     end
  5. end
  6.  
  7. function DigDown()
  8.     while turtle.detectDown() do
  9.         turtle.digDown()
  10.     end
  11. end
  12.  
  13. function Dig()
  14.     while turtle.detect() do
  15.         turtle.dig()
  16.     end
  17. end
  18.  
  19. function Forward()
  20.     while turtle.forward() == false do
  21.         turtle.attack()
  22.         turtle.dig()
  23.     end
  24. end
  25.  
  26. function CheckFuel()
  27.     if turtle.getFuelLevel() < turtle.getFuelLimit() * 0.25 then
  28.         print("Refueling...")
  29.         while turtle.getFuelLevel() < turtle.getFuelLimit() * 0.75 do
  30.             for i = 1, 16 do
  31.                 turtle.select(i)
  32.                 if turtle.refuel() then
  33.                     break
  34.                 end
  35.             end
  36.         end
  37.     end
  38. end
  39.  
  40. function Step()
  41.     print("Step")
  42.     CheckFuel()
  43.     DigUp()
  44.     Dig()
  45.     DigDown()
  46.     turtle.forward()
  47. end
  48.  
  49. local len = 16 * 16
  50.  
  51. while len > 0 do
  52.     for i = 1, 2 do
  53.         for ld = 1, len do
  54.             Step()
  55.         end
  56.         turtle.turnRight()
  57.     end
  58.     len = len - 1
  59. end
  60.  
RAW Paste Data