Advertisement
rungholt

wheat

Aug 4th, 2023 (edited)
1,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. local x = 7
  2. local y = 7
  3.  
  4. local function checkFuel()
  5.     local fuel = turtle.getFuelLevel()
  6.     if (fuel < 200) then
  7.         turtle.select(16)
  8.         turtle.refuel(2)
  9.         turtle.select(1)
  10.     end
  11. end
  12.  
  13. local function mineX()
  14.     for i = 1, x do
  15.         turtle.digDown()
  16.         turtle.select(1)
  17.         turtle.placeDown()
  18.         turtle.forward()
  19.     end
  20. end
  21.  
  22. local function changeRight()
  23.     turtle.turnRight()
  24.     turtle.forward()
  25.     turtle.turnRight()
  26. end
  27.  
  28. local function changeLeft()
  29.     turtle.turnLeft()
  30.     turtle.forward()
  31.     turtle.turnLeft()
  32. end
  33.  
  34. local function fullMine()
  35.     mineX()
  36.     changeRight()
  37.     mineX()
  38.     changeLeft()
  39.     mineX()
  40.     changeRight()
  41.     mineX()
  42.     changeLeft()
  43.     mineX()
  44.     changeRight()
  45.     mineX()
  46.     changeLeft()
  47.     mineX()
  48.     turtle.turnLeft()
  49. end
  50.  
  51. local function goHomeY()
  52.     for i = 1, y - 1 do
  53.         turtle.forward()
  54.     end
  55.     turtle.turnLeft()
  56. end
  57.  
  58. local function goHomeX()
  59.     for i = 1, x do
  60.         turtle.forward()
  61.     end
  62.     turtle.turnLeft()
  63.     turtle.turnLeft()
  64. end
  65.  
  66. local function itemsOut()
  67.     for i = 2, 15 do
  68.         turtle.select(i)
  69.         turtle.dropDown()
  70.     end
  71.     turtle.select(1)
  72. end
  73.  
  74. local function startMine()
  75.     checkFuel()
  76.     turtle.forward()
  77.     fullMine()
  78.     goHomeY()
  79.     goHomeX()
  80.     itemsOut()
  81. end
  82.  
  83. while true do
  84.     startMine()
  85.     sleep(300)
  86. end
  87.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement