Advertisement
LazerAio

FM2

Mar 18th, 2022
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. term.setBackgroundColor(colors.black)
  2. term.setTextColor(colors.white)
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. W,H = term.getSize()
  6. term.setCursorPos(1,1)
  7. list = fs.list(".")
  8. nOption = 1
  9. while true do
  10. term.setCursorPos(1,1)
  11. for i=1,#list do
  12. if fs.isReadOnly(list[i]) then
  13. term.setTextColor(colors.red)
  14. elseif fs.isDir(list[i]) then
  15. term.setTextColor(colors.lime)
  16. else
  17. term.setTextColor(colors.brown)
  18. end
  19. print(" "..list[i])
  20. end
  21. term.setCursorPos(1,nOption)
  22. print(">")
  23. E,K = os.pullEvent("key")
  24. if K == 208 or string.byte("W") == K then
  25. nOption = nOption + 1
  26. elseif K == 200 or string.byte("S") == K then
  27. nOption = nOption - 1
  28. end
  29. if nOption > #list or nOption < 1 then
  30. nOption = 1
  31. end
  32. term.setCursorPos(1,nOption)
  33. if fs.isDir(list[nOption]) then
  34. term.setCursorPos(15,1)
  35. temp = fs.list(list[nOption])
  36. for j=1,#temp do
  37. term.setCursorPos(15,j)
  38. print(temp[j])
  39. end
  40. else
  41. term.clear()
  42. term.setCursorPos(1,nOption)
  43. print(">")
  44. end
  45. if string.byte(" ") == K or K == 57 or K == 205 then
  46. if fs.isDir(list[nOption]) then
  47. term.setTextColor(colors.lightBlue)
  48. for l=1,10 do
  49. shell.run("cd ..")
  50. end
  51. shell.run("cd",list[nOption])
  52. term.clear()
  53. term.setCursorPos(1,1)
  54. break
  55. else
  56. if fs.exists("ANO") then
  57. shell.run("ANO",list[nOption])
  58. end
  59. end
  60. end
  61. sleep(0)
  62. end
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement