Advertisement
Guest User

Untitled

a guest
May 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. while true do
  2. function CheckWheat()
  3. local success, data = turtle.inspect()
  4. local mature
  5. if success and data.metadata == 7 then
  6. mature = true
  7. elseif success and data.metadata ~= 7 then
  8. mature = fals
  9. else
  10. mature = nil
  11. end
  12. return mature
  13. end
  14. function FuelUp()
  15. local fuel = turtle.getFuelLevel()
  16. if fuel<128 then
  17. turtle.suck(32)
  18. turtle.refuel(32)
  19. end
  20. end
  21. function Store()
  22. turtle.select(1)
  23. for i = 1, 16
  24. local inv = turtle.getItemDetail()
  25. if inv and inv.name == "minecraft:wheat" then
  26. turtle.drop()
  27. elseif inv and inv == "minecraft:wheat_seeds" and i > 2 then
  28. turtle.drop()
  29. end
  30. end
  31.  
  32. repeat
  33. turtle.turnLeft()
  34. local wheat = CheackWheat()
  35. if wheat == true then
  36. turtle.dig()
  37. elseif wheat == nil then
  38. turtle.select(2)
  39. turtle.place()
  40. end
  41. turtle.turnRight()
  42. turtle.turnRight()
  43. local wheat =CheckWheat()
  44. if wheat == true then
  45. turtle.dig()
  46. elseif wheat == nil then
  47. turtle.place()
  48. end
  49. turtle.turnLeft()
  50. local stop = turtle.detect()
  51. if stop == true then
  52. FuelUp()
  53. end
  54. until stop == true
  55. repeat
  56. turtle.turnLeft()
  57. local wheat = CheackWheat()
  58. if wheat == true then
  59. turtle.dig()
  60. elseif wheat == nil then
  61. turtle.select(2)
  62. turtle.place()
  63. end
  64. turtle.turnRight()
  65. turtle.turnRight()
  66. local wheat =CheckWheat()
  67. if wheat == true then
  68. turtle.dig()
  69. elseif wheat == nil then
  70. turtle.place()
  71. end
  72. turtle.turnLeft()
  73. local stop = turtle.detect()
  74. if stop == true then
  75. Store()
  76. end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement