Advertisement
rungholt

microspruce

Aug 26th, 2021 (edited)
1,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. local function InOutChest()
  2.     turtle.turnRight()
  3.     turtle.turnRight()
  4.     turtle.select(1)
  5.     turtle.drop()
  6.     turtle.select(2)
  7.     turtle.drop()
  8.     turtle.select(3)
  9.     turtle.drop()
  10.     turtle.select(4)
  11.     turtle.drop()
  12.     turtle.select(1)
  13.     turtle.suck(1)
  14.     turtle.turnRight()
  15.     turtle.turnRight()
  16. end
  17.  
  18. local function goDown()
  19.     while turtle.detectDown() == false do
  20.         turtle.down()
  21.     end
  22.     turtle.up()
  23. end
  24.  
  25. local function harvest()
  26.     for i = 1, 9 do
  27.         turtle.dig()
  28.         turtle.digUp()
  29.         turtle.up()
  30.     end
  31. end
  32.  
  33. local function plant()
  34.     turtle.select(1)
  35.     turtle.place()
  36. end
  37.  
  38. while turtle.getFuelLevel() <= 200 do
  39.     turtle.select(16)
  40.     turtle.refuel(16)
  41. end
  42.  
  43. while true do
  44.     local success, data = turtle.inspect()
  45.         if success then
  46.             if data.name == "minecraft:spruce_log" then
  47.                 harvest()
  48.                 goDown()
  49.                 InOutChest()
  50.                 plant()
  51.             else
  52.                 sleep(60)
  53.                 turtle.suckUp()
  54.                 turtle.suckDown()
  55.                 turtle.suck()
  56.             end
  57.         end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement