asweigart

Untitled

Feb 15th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. -- ComputerCraft script to display fuel stats
  2. -- Written by al@inventwithpython.com
  3.  
  4. io.write(tostring(turtle.getFuelLevel()))
  5. io.write(' / ')
  6. io.write(tostring(turtle.getFuelLimit()))
  7. io.write(' ')
  8.  
  9. local amt = 100 * turtle.getFuelLevel() / turtle.getFuelLimit()
  10. print(tostring(amt) .. '%')
  11. if amt < 100 then
  12. print('Space left: ' .. tostring(turtle.getFuelLimit() - turtle.getFuelLevel()))
  13. end
Add Comment
Please, Sign In to add comment