Advertisement
DomMOW

Refuelling Test

Jul 18th, 2025 (edited)
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fuelSaid = false
  2. fuelYes = "Cabbages"
  3.  
  4. function fuelCheck()
  5.     fuelLevel = turtle.getFuelLevel()
  6.     while not(fuelLevel > 0) do
  7.         if fuelSaid == false then
  8.             fuelSaidCheck()
  9.             hasFuel = true
  10.         end
  11.         shell.run("refuel all")
  12.         fuelLevel = turtle.getFuelLevel()
  13.     end
  14.     if hasFuel == true then
  15.         shell.run("clear")
  16.         print("I'm Ready, Master. Type: 'Go' to Start")
  17.         fuelGoCheck = read()
  18.         fuelGo()
  19.     end
  20.     shell.run("clear")
  21.     hasFuel = false
  22.     fuelSaid = false
  23. end
  24.  
  25. function fuelGo()
  26.     while not(fuelGoCheck == "Go") do
  27.         print("ERROR! Please try Again")
  28.         print("Once I have Fuel Type: 'Go'")
  29.         fuelGoCheck = read()
  30.         shell.run("clear")
  31.     end
  32. end
  33.  
  34. function fuelAdded()
  35.     while not(fuelYes == "Y") do
  36.         shell.run("clear")
  37.         print("ERROR! Please try Again")
  38.         print("Once I have Fuel, Type: 'Y'")
  39.         fuelYes = read()
  40.     end
  41. end
  42.  
  43. function fuelSaidCheck()
  44.     shell.run("clear")
  45.     print("I need Fuel, Master.")
  46.     print("Once I have Fuel Type: 'Y'")
  47.     fuelYes = read()
  48.     fuelAdded()
  49. end
  50.  
  51. while true do
  52.   fuelCheck()
  53. end
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement