Advertisement
NoobieDoobie

Untitled

Feb 26th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 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. for i=0, 15, 1 do
  49. slotData = turtle.getItemDetail(i)
  50. if data.name == slotData.name then
  51. turtle.select(i)
  52. turtle.placeDown()
  53. break
  54. end
  55. end
  56. end
  57. end
  58.  
  59. function CheckField()
  60. for j=0, y, 1 do
  61. for k=0, x, 1 do
  62. CheckBelow()
  63. Mv()
  64. end
  65. if j%2 == 0 then
  66. turtle.turnRight()
  67. Mv()
  68. turtle.turnRight()
  69. else
  70. turle.turnLeft()
  71. Mv()
  72. turle.turnLeft()
  73. end
  74. end
  75. end
  76.  
  77. function TurnAround()
  78. turtle.trunLeft()
  79. turtle.turnLeft()
  80. end
  81.  
  82. function Chest()
  83. TurnAround()
  84. for n=5, 15, 1 do
  85. turtle.select(n)
  86. turtle.drop()
  87. end
  88. TurnAround()
  89. end
  90.  
  91. Startup()
  92. while true do
  93. CheckField()
  94. Chest()
  95. os.sleep(300)
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement