Advertisement
PancakePhD

Botania Flower farm

Apr 30th, 2021 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. waitTime = 60
  2.  
  3. local function harvest()
  4. for i=1,9 do
  5. for j=1,9 do
  6. turtle.forward()
  7.  
  8. isBlockDown, blockDown = turtle.inspectDown()
  9.  
  10. if isBlockDown and string.find(blockDown.name, "mystical_flower") then
  11. turtle.digDown()
  12. turtle.suckDown()
  13. end
  14. end
  15.  
  16. if i % 2 ~= 0 then
  17. turtle.turnLeft()
  18. turtle.forward()
  19. turtle.turnLeft()
  20. else
  21. turtle.turnRight()
  22. turtle.forward()
  23. turtle.turnRight()
  24. end
  25. end
  26. end
  27.  
  28. local function main()
  29. os.setComputerLabel("Fuel: "..turtle.getFuelLevel())
  30. while turtle.getFuelLevel() < 81 do
  31. turtle.select(1)
  32. turtle.refuel()
  33. os.setComputerLabel("Put Fuel in Slot 1")
  34. end
  35.  
  36. harvest()
  37.  
  38. sleep(5)
  39.  
  40.  
  41. for i=1,2 do
  42. for j=1,9 do
  43. turtle.forward()
  44. end
  45. turtle.turnLeft()
  46. end
  47.  
  48. isBlockDown, blockDown = turtle.inspectDown()
  49.  
  50. if isBlockDown and blockDown.name == "minecraft:chest" then
  51. for slot=1,16 do
  52. turtle.select(slot)
  53. turtle.dropDown()
  54. end
  55. end
  56.  
  57. for i=1,waitTime do
  58. os.setComputerLabel("Waiting "..waitTime-i.." seconds")
  59. sleep(1)
  60. end
  61. end
  62.  
  63. while true do
  64. main()
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement