Advertisement
jdroid91

nicoFix2

Oct 6th, 2023 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. function refuel()
  2. cf = turtle.getFuelLevel()
  3. mf = turtle.getFuelLimit()
  4. fp = math.floor(cf/mf)*100
  5. if fp <= 50 then
  6. repeat
  7. turtle.select(2)
  8. turtle.refuel()
  9. until fp >=70
  10. end end
  11.  
  12. function TR()
  13. turtle.turnRight()
  14. turtle.forward()
  15. turtle.turnRight()
  16. end
  17.  
  18. function TL()
  19. turtle.turnLeft()
  20. turtle.forward()
  21. turtle.turnLeft()
  22. end
  23.  
  24. function keep()
  25. turtle.select(1)
  26. while turtle.detectDown() do
  27. for i = 3, 16 do
  28. turtle.select(i)
  29. turtle.dropDown()
  30. end end end
  31.  
  32. function farm()
  33.     local index = 0
  34.     local index2 = 0
  35.    
  36.     while true do
  37.         refuel()
  38.         index = 0
  39.         while (index < 5)
  40.         do
  41.             turtle.forward()
  42.             index = index + 1
  43.         end
  44.        
  45.         if (index2 % 2 == 0)
  46.         then
  47.             TL()
  48.         else
  49.             TR()
  50.         end
  51.         index2 = index2 + 1
  52.     end
  53. end
  54.  
  55. farm()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement