Advertisement
NoobieDoobie

Untitled

Feb 26th, 2021
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. function Coal()
  2. if turtle.getFuelLevel() < 40 and turtle.getItemCount(1) <2 then
  3. print "Bitte Treibstoff in den 1. Slot geben"
  4. end
  5. end
  6.  
  7. function Refuel()
  8. if turtle.getFuelLevel() < 100 then
  9. turtle.select(1)
  10. turtle.refuel(turtle.getItemCount()-1)
  11. end
  12. end
  13.  
  14. x=-1
  15. y=-1
  16.  
  17. function Mv()
  18. Coal()
  19. Refuel()
  20. while not turtle.forward() do
  21. turtle.attack()
  22. end
  23. end
  24.  
  25. function Startup()
  26. while turtle.forward() do
  27. x=x+1
  28. end
  29. turtle.turnRight()
  30. while turtle.forward() do
  31. y=y+1
  32. end
  33. turtle.turnRight()
  34. for l=0, x, 1 do
  35. Mv()
  36. end
  37. turtle.turnRight()
  38. for m=0, y, 1 do
  39. Mv()
  40. end
  41. turtle.turnRight()
  42. end
  43.  
  44. function CheckBelow()
  45. success, data = turtle.inspectDown()
  46. if data.metadata == 7 then
  47. turtle.digDown()
  48. if data.name == "minecraft:carrots" then
  49. turtle.select(3)
  50. turtle.placeDown()
  51. elseif data.name == "minecraft:potatoes" then
  52. turtle.select(2)
  53. turtle.placeDown()
  54. end
  55. end
  56. end
  57.  
  58. function CheckField()
  59. for j=0, y, 1 do
  60. for k=0, x, 1 do
  61. CheckBelow()
  62. Mv()
  63. end
  64. if j%2 == 0 then
  65. turtle.turnRight()
  66. Mv()
  67. turtle.turnRight()
  68. else
  69. turle.turnLeft()
  70. Mv()
  71. turle.turnLeft()
  72. end
  73. end
  74. end
  75.  
  76. function TurnAround()
  77. turtle.trunLeft()
  78. turtle.turnLeft()
  79. end
  80.  
  81. function Chest()
  82. TurnAround()
  83. for n=5, 16, 1 do
  84. turtle.select(n)
  85. turtle.drop()
  86. end
  87. TurnAround()
  88. end
  89.  
  90. Startup()
  91. while true do
  92. CheckField()
  93. Chest()
  94. os.sleep(300)
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement