Marlingaming

Boot Loader Menu

Dec 15th, 2021 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. --this script acts as a Boot Adminstrator
  2. version = "1.0.0"
  3. local function Clear()
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. end
  7.  
  8. local function MainMenu()
  9. Clear()
  10. print("BOOT MANAGER")
  11. print("--VERSION--"..version)
  12. print("////OPTIONS////")
  13. print(" 1- [Logs]")
  14. print(" 2- [Boot Files]")
  15. print(" 3- [Update Boot Loader]")
  16. print(" 4- [Reboot]")
  17. print(" 5- [Continue Boot up]")
  18. local Selected = -1
  19. repeat
  20. local event, key = os.pullEvent("key")
  21. Selected = key
  22. until key == keys.one or key == keys.two or key == keys.three or key == keys.four or key == keys.five
  23. if Selected == keys.one then
  24. DisplayLogs()
  25. elseif Selected == keys.two then
  26. BootFileMenu()
  27. elseif Selected == keys.three then
  28. shell.run(".Boot_BootUpdater")
  29. elseif Selected == keys.four then
  30. os.reboot()
  31. elseif Selected == keys.five then
  32. shell.run(".Boot_TaskRunner")
  33. end
  34. end
  35.  
  36. local function DisplayLogs()
  37. Clear()
  38. local file = fs.open("BootLogs","r")
  39. print(file.readAll)
  40. file.close()
  41. print("Press Enter to Return to Menu")
  42. repeat
  43. local event, key = os.pullEvent("key")
  44. until key == keys.enter
  45. MainMenu()
  46. end
  47.  
  48. local function BootFileMenu()
  49. Clear()
  50. print("---FILES---")
  51. print("these are the files ran during Boot, in this order")
  52. print("//////////////////////////////////////////////////")
  53. local file = fs.open(".Boot_BootFile")
  54. print(BootFile.readAll)
  55. file.close()
  56. print("//////////////////////////////////////////////////")
  57. print("Press Enter to return to menu")
  58. repeat
  59. local event, key = os.pullEvent("key")
  60. until key == keys.enter
  61. MainMenu()
  62. end
  63.  
  64.  
  65. MainMenu()
Advertisement
Add Comment
Please, Sign In to add comment