Advertisement
Lukyrouge22

Untitled

Jun 8th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. w = peripheral.wrap("left")
  2. w.open(1)
  3. function range()
  4. for i = 1, 9 do
  5. turtle.digDown()
  6. turtle.placeDown()
  7. turtle.forward()
  8. end
  9. end
  10. function rotate_L()
  11. turtle.turnLeft()
  12. turtle.forward()
  13. turtle.digDown()
  14. turtle.placeDown()
  15. turtle.turnLeft()
  16. end
  17. function rotate_R()
  18. turtle.turnRight()
  19. turtle.forward()
  20. turtle.digDown()
  21. turtle.placeDown()
  22. turtle.turnRight()
  23. end
  24. function comeback()
  25. turtle.turnRight()
  26. turtle.turnRight()
  27. for b = 1, 2 do
  28. for a = 1, 9 do
  29. turtle.forward()
  30. end
  31. turtle.turnRight()
  32. end
  33. for p = 2, 16 do
  34. turtle.select(p)
  35. turtle.dropDown()
  36. end
  37. end
  38. function go()
  39. turtle.select(1)
  40. w.transmit(1, 1, "La turtle du blé fonctionne !")
  41. i = 0
  42. while i < 9 do
  43. range()
  44. if i % 2 == 0 then
  45. rotate_R()
  46. else
  47. rotate_L()
  48. end
  49. i = i +1
  50. end
  51. comeback()
  52. end
  53. function refuel()
  54. fuel = turtle.getFuelLevel()
  55. if fuel < 80 then
  56. print("BESOIN DE FUEL !!! SLOT 2 MINIMUM 5 COAL")
  57.  
  58. w.transmit(1 ,1, "La turtle du FarmLand de blé a besoin de Fuel !")
  59. turtle.select(2)
  60. turtle.reFuel()
  61. end
  62. end
  63.  
  64. while true do
  65. refuel()
  66. go()
  67. os.sleep(900)
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement