Advertisement
Lukyrouge22

Untitled

Nov 9th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. empty()
  2. function refuel()
  3. if (turtle.getFuelLevel() <= 150)
  4. turtle.select(16)
  5. fuel = turtle.getFuelLevel()
  6. fuel_l = (850 - fuel) / 80
  7. turtle.suckDown(fuel_l)
  8. end
  9. end
  10. function empty()
  11. turtle.turnLeft()
  12. turtle.turnLeft()
  13. for b = 1, 16 do
  14. turtle.select(i)
  15. turtle.drop()
  16. end
  17. turtle.turnLeft()
  18. turtle.turnLeft()
  19. end
  20. function farm()
  21. nbLig = 9
  22. nbCol = 9
  23. b = 0
  24. for i = 1, nbLig do
  25. for j = 1, nbCol do
  26. inspect()
  27. end
  28. b = b + 1
  29. if (b%2 ~= 0) then
  30. turtle.turnLeft()
  31. inspect()
  32. turtle.turnLeft()
  33. else
  34. turtle.turnRight()
  35. inspect()
  36. turtle.turnRight()
  37. end
  38. end
  39. sleep(1)
  40. maison()
  41. empty()
  42. end
  43. function maison()
  44. print("Retours Maison")
  45. for l = 1, 2 do
  46. for k = 1, nbLig do
  47. turtle.forward()
  48. end
  49. turtle.turnLeft()
  50. end
  51. turtle.back()
  52. end
  53. function inspect()
  54. local success, data = turtle.inspectDown()
  55. if data.metadata == 7 then
  56. turtle.digDown()
  57. end
  58. turtle.placeDown()
  59. turtle.forward()
  60. end
  61.  
  62. while true do
  63. refuel()
  64. farm()
  65. sleep(60)
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement