Advertisement
rungholt

birch

Aug 2nd, 2023 (edited)
749
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 1 0
  1. local function harvest()
  2.     turtle.dig()
  3.     turtle.forward()
  4.     for i = 1, 6 do
  5.         turtle.digUp()
  6.         turtle.up()
  7.     end
  8. end
  9.  
  10. local function goDown()
  11.     while turtle.detectDown() == false do
  12.         turtle.down()
  13.     end
  14. end
  15.  
  16. local function plant()
  17.     turtle.up()
  18.     for i = 1, 6 do
  19.         turtle.select(1)
  20.         turtle.placeDown()
  21.         turtle.back()
  22.     end
  23. end
  24.  
  25. local function checkFuel()
  26.     if turtle.getFuelLevel() <= 200 then
  27.         turtle.select(16)
  28.         turtle.refuel(16)
  29.         turtle.select(1)
  30.     end
  31. end
  32.  
  33. local function itemsOut()
  34.     for i = 2, 15 do
  35.         turtle.select(i)
  36.         turtle.dropDown()
  37.     end
  38.     turtle.select(1)
  39. end
  40.  
  41. while true do
  42.     if turtle.detect() == true then
  43.         checkFuel()
  44.        for i = 1, 6 do
  45.             harvest()
  46.             goDown()
  47.        end
  48.        plant()
  49.        turtle.down()
  50.        itemsOut()
  51.        sleep(1800)
  52.     end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement