Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- local function LIST(dir)
- local FileList = fs.list(dir)
- term.setBackgroundColor( colors.gray )
- for _, file in ipairs(FileList) do
- sleep(0.5)
- if fs.isDir(file) then
- print("--"..file.."--")
- LIST(file)
- print("----")
- else
- print(file)
- end
- end
- end
- local function drawTaskBar(s,x)
- term.setCursorPos(x,18)
- term.setBackgroundColor( colors.black )
- term.clearLine()
- term.write(s)
- term.setBackgroundColor( colors.gray )
- end
- drawTaskBar("OS | File Manager", 1)
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.clear()
- print("LOADING")
- DE = false
- DL = ""
- if fs.exists("/disk") then
- DS = peripheral.find("disk")
- print(DS)
- DE = true
- print(DE)
- DL = "DISK"
- print(DL)
- end
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- local function GUI(DriveType)
- if DriveType == "DISK" then
- term.clear()
- drawTaskBar("OS | FileManager -A", 1)
- term.setCursorPos(1,1)
- print("Drive A contains")
- textutils.slowPrint("---------")
- shell.run("ls", "/disk")
- print("[E]xit [C]D")
- else
- term.clear()
- drawTaskBar("OS | FileManager -C", 1)
- term.setCursorPos(1,1)
- print("Drive C contains")
- textutils.slowPrint("---------")
- LIST("")
- print("[E]xit [C]D")
- end
- choise = read()
- if choise == "C" or choise == "c" then
- term.clear()
- drawTaskBar("OS | FileManager", 1)
- term.setCursorPos(1,1)
- print("ENTER FOLDER NAME")
- shell.run("ls", read())
- print("Returning to menu")
- sleep(10)
- else
- sleep(1)
- end
- end
- if DE then
- print("SETUP")
- print("Select drive")
- print("A = "..DL)
- print("C = ".."COMPUTER")
- print("")
- selection = read()
- if selection == "A" then
- GUI("DISK")
- elseif selection == "C" then
- GUI("PC")
- else
- print("Not an option")
- shell.run(".FM.lua")
- sleep(1)
- shell.run(".menu")
- end
- else
- GUI("PC")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement