Advertisement
LazerAio

.FM.lua

Mar 1st, 2022
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local function LIST(dir)
  3. local FileList = fs.list(dir)
  4. term.setBackgroundColor( colors.gray )
  5. for _, file in ipairs(FileList) do
  6. sleep(0.5)
  7. if fs.isDir(file) then
  8. print("--"..file.."--")
  9. LIST(file)
  10. print("----")
  11. else
  12. print(file)
  13. end
  14. end
  15. end
  16. local function drawTaskBar(s,x)
  17. term.setCursorPos(x,18)
  18. term.setBackgroundColor( colors.black )
  19. term.clearLine()
  20. term.write(s)
  21. term.setBackgroundColor( colors.gray )
  22. end
  23. drawTaskBar("OS | File Manager", 1)
  24.  
  25. term.setCursorPos(1,1)
  26. term.setBackgroundColor(colors.gray)
  27. term.setTextColor(colors.white)
  28. term.clear()
  29. print("LOADING")
  30. DE = false
  31. DL = ""
  32. if fs.exists("/disk") then
  33. DS = peripheral.find("disk")
  34. print(DS)
  35. DE = true
  36. print(DE)
  37. DL = "DISK"
  38. print(DL)
  39. end
  40. sleep(0.5)
  41. term.clear()
  42. term.setCursorPos(1,1)
  43. local function GUI(DriveType)
  44. if DriveType == "DISK" then
  45. term.clear()
  46. drawTaskBar("OS | FileManager -A", 1)
  47. term.setCursorPos(1,1)
  48. print("Drive A contains")
  49. textutils.slowPrint("---------")
  50. shell.run("ls", "/disk")
  51. print("[E]xit [C]D")
  52. else
  53. term.clear()
  54. drawTaskBar("OS | FileManager -C", 1)
  55. term.setCursorPos(1,1)
  56. print("Drive C contains")
  57. textutils.slowPrint("---------")
  58. LIST("")
  59. print("[E]xit [C]D")
  60. end
  61. choise = read()
  62. if choise == "C" or choise == "c" then
  63. term.clear()
  64. drawTaskBar("OS | FileManager", 1)
  65. term.setCursorPos(1,1)
  66. print("ENTER FOLDER NAME")
  67. shell.run("ls", read())
  68. print("Returning to menu")
  69. sleep(10)
  70. else
  71. sleep(1)
  72. end
  73. end
  74. if DE then
  75. print("SETUP")
  76. print("Select drive")
  77. print("A = "..DL)
  78. print("C = ".."COMPUTER")
  79. print("")
  80. selection = read()
  81. if selection == "A" then
  82. GUI("DISK")
  83. elseif selection == "C" then
  84. GUI("PC")
  85. else
  86. print("Not an option")
  87. shell.run(".FM.lua")
  88. sleep(1)
  89. shell.run(".menu")
  90. end
  91. else
  92. GUI("PC")
  93. end
  94.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement