Advertisement
Lukyrouge22

Untitled

Jun 6th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. size_x = 9
  2. size_y = 9
  3. x = 0
  4. y = 0
  5. a = 0
  6. timer = 0
  7. function move()
  8. turtle.forward()
  9. turtle.digDown()
  10. turtle.placeDown()
  11. end
  12. function move2()
  13. turtle.forward()
  14. end
  15. function farm()
  16. while y ~= size_y do
  17. for o = 1, size_x do
  18. move()
  19. end
  20. a = a+1
  21. if a % 2 == 0 then
  22. turtle.turnLeft()
  23. move()
  24. turtle.turnLeft()
  25. else
  26. turtle.turnRight()
  27. move()
  28. turtle.turnRight()
  29. end
  30. y = y + 1
  31. end
  32. if y == size_y then
  33. turtle.turnRight()
  34. turtle.turnRight()
  35. for u = 1, 9 do
  36. turtle.forward()
  37. end
  38. turtle.turnRight()
  39. for t = 1, 9 do
  40. turtle.forward()
  41. end
  42. y = 0
  43. timer = 800
  44. end
  45. end
  46. function graph()
  47. term.clear()
  48. term.setCursorPos(1, 1)
  49. print("Il y a : " + turtle.getFuelLevel() + " fuel")
  50. print("Temps avant récolte : " + timer + " secondes")
  51. os.sleep(1)
  52. timer = timer - 1
  53. end
  54.  
  55. function refuel()
  56. while turtle.getFuelLevel() < 80 do
  57. print("REFUEL !!!! SLOT 2 MINIMUM 5 CHARBONS")
  58. turtle.select(2)
  59. turtle.refuel(5)
  60. end
  61. end
  62. while true do
  63. refuel()
  64. graph()
  65. if timer == 0 then
  66. farm()
  67. end
  68.  
  69.  
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement