Advertisement
Guest User

RefuelLava

a guest
Jan 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. print("You have " .. tostring(turtle.getFuelLevel())  .. " Fuel Left")
  2. term.write("How much do you want: ")
  3. amount = tonumber(read())
  4.  
  5. while (turtle.getFuelLevel() < amount) do
  6.   turtle.place()
  7.   turtle.placeUp()
  8.   turtle.select(2)
  9.   turtle.placeUp()
  10.   turtle.refuel()
  11.   turtle.select(1)
  12.   term.clear()
  13.   term.setCursorPos(1, 1)
  14.   print(tostring(turtle.getFuelLevel() / amount * 100) .. "%"
  15.   )
  16. end
  17.  
  18. print("Done")
  19. sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement