Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- W,H = term.getSize()
- term.setCursorPos(1,1)
- list = fs.list(".")
- nOption = 1
- while true do
- term.setCursorPos(1,1)
- for i=1,#list do
- if fs.isReadOnly(list[i]) then
- term.setTextColor(colors.red)
- elseif fs.isDir(list[i]) then
- term.setTextColor(colors.lime)
- else
- term.setTextColor(colors.brown)
- end
- print(" "..list[i])
- end
- term.setCursorPos(1,nOption)
- print(">")
- E,K = os.pullEvent("key")
- if K == 208 or string.byte("W") == K then
- nOption = nOption + 1
- elseif K == 200 or string.byte("S") == K then
- nOption = nOption - 1
- end
- if nOption > #list or nOption < 1 then
- nOption = 1
- end
- term.setCursorPos(1,nOption)
- if fs.isDir(list[nOption]) then
- term.setCursorPos(15,1)
- temp = fs.list(list[nOption])
- for j=1,#temp do
- term.setCursorPos(15,j)
- print(temp[j])
- end
- else
- term.clear()
- term.setCursorPos(1,nOption)
- print(">")
- end
- if string.byte(" ") == K or K == 57 or K == 205 then
- if fs.isDir(list[nOption]) then
- term.setTextColor(colors.lightBlue)
- for l=1,10 do
- shell.run("cd ..")
- end
- shell.run("cd",list[nOption])
- term.clear()
- term.setCursorPos(1,1)
- break
- else
- if fs.exists("ANO") then
- shell.run("ANO",list[nOption])
- end
- end
- end
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement