Advertisement
Phemto

beetCarrotWheatFarm

Jan 12th, 2022 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. --Beat Farming (or other seed based crops (I think)
  2. --slot 1: beat seeds
  3. --slot 2: bone meal
  4. --slot 3: carrot
  5. --slot 4: wheat seeds
  6. while true do
  7. --look down
  8. success, data = turtle.inspectDown()
  9. if success and string.find(data.name,"beet") then
  10. while data.state.age < 3 do
  11. turtle.select(2)
  12. if turtle.getItemCount(2) > 1 then
  13. turtle.placeDown()
  14. end
  15. sleep(1)
  16. success, data = turtle.inspectDown()
  17. end
  18. turtle.select(1)
  19. turtle.digDown()
  20. turtle.placeDown()
  21. elseif success and string.find(data.name,"carrot") then
  22. while data.state.age < 7 do
  23. turtle.select(2)
  24. if turtle.getItemCount(2) > 1 then
  25. turtle.placeDown()
  26. end
  27. sleep(1)
  28. success, data = turtle.inspectDown()
  29. end
  30. turtle.select(3)
  31. turtle.digDown()
  32. turtle.placeDown()
  33. elseif success and string.find(data.name,"wheat") then
  34. while data.state.age < 7 do
  35. turtle.select(2)
  36. if turtle.getItemCount(2) > 1 then
  37. turtle.placeDown()
  38. end
  39. sleep(1)
  40. success, data = turtle.inspectDown()
  41. end
  42. turtle.select(4)
  43. turtle.digDown()
  44. turtle.placeDown()
  45. else
  46. --must be something else or broken land. plant something
  47. turtle.select(4)
  48. turtle.digDown()
  49. turtle.placeDown()
  50. end
  51. --now check forward
  52. success_forward,data_forward = turtle.inspect()
  53. if success_forward then
  54. --we've hit a corner
  55. print("We've hit a corner.")
  56. turtle.select(2)
  57. turtle.suckUp(64-turtle.getItemCount(2))
  58. if string.find(data_forward.name,"chest") then
  59. for s=5,16,1 do
  60. turtle.select(s)
  61. turtle.drop()
  62. end
  63. turtle.turnLeft()
  64. elseif string.find(data_forward.name,"jack") then
  65. turtle.turnLeft()
  66. elseif string.find(data_forward.name,"pump") then
  67. turtle.turnRight()
  68. end
  69. end
  70. turtle.forward()
  71. sleep(4)
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement