SHARE
TWEET

Untitled

a guest Feb 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     Mr. Tools turtle API
  3. ]]
  4.  
  5. local data = {}
  6.  
  7. local info = {
  8.     ["version"] = 0.1
  9. }
  10.  
  11. -- load core api
  12. os.loadAPI("mrtools/api/ToolApi")
  13.  
  14. function getVersion()
  15.     return info.version
  16. end
  17.  
  18. function checkFuel(way)
  19.    
  20.     if turtle.getFuelLevel() == "unlimited" then
  21.         return true
  22.     end
  23.  
  24.     local fuelLevel = tonumber(turtle.getFuelLevel())
  25.  
  26.     while fuelLevel < way do
  27.         print("Fuel level to low to work. If you want to refuel, put fuel in slot 16")
  28.         if ToolApi.simpleMenu("Refuel", "Do Nothing") then
  29.             turtle.select(16)
  30.             turtle.refuel()
  31.             fuelLevel = tonumber(turtle.getFuelLevel())
  32.         else
  33.             return false
  34.         end
  35.     end
  36.     return true
  37. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top