Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1.  
  2. --
  3.  
  4. function harvest()
  5. print ("Harvesting..")
  6. turtle.dig()
  7. turtle.suck()
  8. plant()
  9. end
  10.  
  11.  
  12. function inspect()
  13. local success,i =turtle.inspect()
  14. if success then
  15. local f = textutils.serialise(i.state.age)
  16. if f=="3" then
  17. print("Fully grown soyboi detected.")
  18. harvest()
  19. end
  20. elseif not success then
  21. plant()
  22. end
  23. end
  24.  
  25. function turn()
  26. turtle.turnLeft()
  27. end
  28.  
  29. function fuel()
  30. local t = turtle.getFuelLevel()
  31. if t<50 then
  32. print("Fuel less then 50.Please insert fuel to resume")
  33. while turtle.getFuelLevel()<50 do
  34. for i=1,16 do
  35. turtle.select(i)
  36. turtle.refuel()
  37. end
  38. end
  39. end
  40. print("Current fuel:".. t)
  41. end
  42.  
  43. function plant()
  44. for i=1,16 do
  45. local s = turtle.select(i)
  46. local c = turtle.getItemDetail()
  47. if c then
  48. local g =c.name
  49. if g=="harvestcraft:soybeanitem" then
  50. print("Planting new seed..")
  51. turtle.place()
  52. end
  53. end
  54. end
  55. end
  56.  
  57. function transfer()
  58. for i=1,16 do
  59. local t = turtle.select(i)
  60. local k = turtle.getItemCount()
  61. local m = turtle.getItemDetail()
  62.  
  63. if m then
  64. local f = m.name
  65. print (f)
  66. if f=="harvestcraft:soybeanitem" then
  67. if k>4 then
  68. turtle.dropDown(k-4)
  69. print ("Storing ".. k-4 .." soybois")
  70. end
  71. end
  72. end
  73. end
  74. end
  75.  
  76. while true do
  77. fuel()
  78. for i=1,4 do
  79. inspect()
  80. turn()
  81. end
  82. transfer()
  83. os.sleep(5)
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement