Advertisement
BigGamingGamers

Refuel Test

Nov 10th, 2020 (edited)
3,483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. local SLOT_COUNT = 16
  2.  
  3. function checkFuel()
  4. turtle.select(1)
  5.  
  6. if(turtle.getFuelLevel() < 100) then
  7. for slot = 1, SLOT_COUNT, 1 do
  8. print(string.format("Attempting refuel on slot %d", slot))
  9. turtle.select(slot)
  10. if(turtle.refuel(1)) then
  11. return true
  12. end
  13. end
  14. end
  15.  
  16.  
  17. end
  18.  
  19. while(true)
  20. do
  21. if(not checkFuel()) then
  22. print("Turtle is out of fuel...")
  23.  
  24. break
  25. end
  26.  
  27. end
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement