Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Chaos Console File Manager
- --By Metallist | Under GNU GPLv3
- --Version 1.0
- --Author's Skype : metalgamestudio
- local dir
- local pos = 1
- local w,h = term.getSize()
- local filename = ""
- local screen = 0
- local col = {
- ["bg"] = colours.red,
- ["bar"] = colours.gray,
- ["btn"] = colours.black,
- ["txt"] = colours.black,
- ["bt"] = colours.white
- }
- local ucc = {
- ["bg"] = colours.white,
- ["bar"] = colours.white,
- ["btn"] = colours.black,
- ["txt"] = colours.black,
- ["bt"] = colours.white
- }
- if not term.isColor() then col = ucc end
- function redraw()
- local tfiles = fs.list(dir)
- term.setBackgroundColor(col["bg"])
- term.clear()
- term.setCursorPos(1,1)
- term.setBackgroundColor(col["bar"])
- write(dir.." ")
- term.setCursorPos(w-5,1)
- term.setBackgroundCol(col["btn"])
- term.setTextColor(col["bt"])
- write("X")
- term.setTextColor(col["txt"])
- if screen == 0 then
- term.setCursorPos(w-1,1)
- term.setBackgroundColor(col["btn"])
- term.setTextColor(col["bt"])
- term.write("^")
- term.setTextColor(col["txt"])
- term.setBackgroundColor(col["bg"])
- for i = pos, h - 2 do
- if tfiles[i] == nil then break end
- term.setCursorPos(1,i+1)
- write(tfiles[i])
- local type = ""
- if fs.isDir(tfiles[i]) then
- type = "folder"
- else
- local sp = split(tfiles[i], ".")
- if #sp == 1 then
- type = "executable"
- else
- type = sp[#sp] .. " file"
- end
- end
- term.setCursorPos(20,i+1)
- write(type)
- end
- term.setCursorPos(w - 1, h)
- term.setbackgroundColor(col["btn"])
- write(" ")
- elseif screen == 1 then
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement