Advertisement
Lukyrouge22

Untitled

May 31st, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. function start()
  2. while turtle.detect() do
  3. turtle.turnLeft()
  4. end
  5. end
  6. start()
  7. a = 0
  8. function detect()
  9. if a < 6 then
  10. while turtle.detect() do
  11. print("Avance")
  12. turtle.dig()
  13. turtle.forward()
  14. a = a + 1
  15. end
  16. end
  17. if a >= 5 then
  18. print("Recul")
  19. turtle.back()
  20. turtle.back()
  21. turtle.back()
  22. turtle.back()
  23. turtle.back()
  24. vider()
  25.  
  26. end
  27. end
  28. function refuel()
  29. if turtle.getFuelLevel() < 11 then
  30. turtle.select(1)
  31. turtle.refuel(1)
  32. end
  33. end
  34. function vider()
  35. turtle.turnLeft()
  36. turtle.tranferTo(2)
  37. a = 0
  38. end
  39. while true do
  40. detect()
  41. refuel()
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement