Advertisement
LazerAio

.os

Mar 10th, 2022
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. term.clear()
  2. local function WINDOW(X,Y,EX,EY,T,C,EMPTY,H)
  3. local WIND = window.create(term.current(),X,Y,(EX),(EY))
  4. WIND.setBackgroundColor(C)
  5. if EMPTY == true then
  6. WIND.clear()
  7. end
  8. WIND.setCursorPos(1,1)
  9. WIND.write(H)
  10. for i=1,#T do
  11. WIND.setCursorPos(1,i+1)
  12. WIND.write(T[i])
  13. end
  14. end
  15. term.setBackgroundColor(colors.gray)
  16. term.clear()
  17. if fs.exists("./MAIN/") == false then
  18. term.setBackgroundColor(colors.black)
  19. term.setTextColor(colors.red)
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. print("MAIN DIR NOT FOUND")
  23. print("[C]reate or [E]xit")
  24. if string.upper(read()) == "C" then
  25. shell.run("mkdir ./MAIN")
  26. end
  27. end
  28. DIR = "./MAIN"
  29. DIRN = "C"
  30. while true do
  31. if fs.exists("img/bg.nfp") then
  32. paintutils.drawImage(paintutils.loadImage("img/bg.nfp"),2,1)
  33. end
  34. sleep(0)
  35. C = colors.lightGray
  36. W,H = term.getSize()
  37. T = fs.list(DIR)
  38. WINDOW((W/2)-11,4,(W/2),10,T,C,true,"")
  39. term.setCursorPos((W/2)-11,4)
  40. term.setBackgroundColor(colors.lightGray)
  41. print("= |A| |B| |C| S")
  42. term.setCursorPos(2,H-1)
  43. term.setBackgroundColor(colors.black)
  44. term.clearLine()
  45. print("S")
  46. term.setCursorPos(W-24,H-1)
  47. print(os.date())
  48. term.setCursorPos(1,1)
  49. while true do
  50. E,KEY,MX,MY = os.pullEventRaw()
  51. if E == "mouse_click" then
  52. break
  53. end
  54. end
  55. term.setBackgroundColor(colors.black)
  56. print(MX,MY)
  57. if MY == 4 and MX == 14 then
  58. T = {"X"}
  59. WINDOW(MX,MY,(MX),(MY+1),T,colors.gray,true,"")
  60. E,KEY,MX,MY = os.pullEventRaw("mouse_click")
  61. if MX == 14 and MY == 5 then
  62. term.setCursorPos(14,4)
  63. T = term.getTextColour()
  64. term.setTextColor(colors.orange)
  65. print("YOU ARE ABOUT END THIS AIOS SESSION")
  66. term.setTextColour(colors.yellow)
  67. term.setCursorPos(14,5)
  68. print("Y to exit")
  69. term.setCursorPos(14,6)
  70. print("N to stay")
  71. if string.upper(read()) == "Y" then
  72. break
  73. end
  74. end
  75. elseif MY == 17 and MX == 2 then
  76. T = {"ATOP","SETTINGS"}
  77. WINDOW(1,12,10,20,T,colors.blue,true,"START")
  78. E,KEY,MX,MY = os.pullEvent("mouse_click")
  79. term.setCursorPos(1,1)
  80. --print(MX,MY)
  81. if MY == 13 then
  82. term.setCursorPos(10,2)
  83. paintutils.drawFilledBox(10,2,40,20)
  84. for i=1,multishell.getCount() do
  85. term.setCursorPos(10,2+i)
  86. print(multishell.getTitle(i))
  87. end
  88. sleep(2)
  89. elseif MY == 14 then
  90. term.setTextColor(colors.lightBlue)
  91. T = {"NO SETTINGS"}
  92. WINDOW(10,10,20,20,T,colors.white,true,"SETTINGS")
  93. end
  94. sleep(1)
  95. elseif MY == 4 and MX == 38 then
  96. shell.run("fg")
  97. elseif MY == 4 and MX == 26 then
  98. if fs.exists("disk2/") then
  99. DIR = "disk2/"
  100. DIRN = "B"
  101. else
  102. T = {"DIR NOT FOUND"}
  103. WINDOW((W/2)-11,4,(W/3),4,T,colors.red,true,"ERROR")
  104. end
  105. elseif MY == 4 and MX == 19 then
  106. if fs.exists("disk/") then
  107. DIR = "disk/"
  108. DIRN = "A"
  109. else
  110. T = {"DIR NOT FOUND"}
  111. WINDOW((W/2)-11,4,(W/3),4,T,colors.red,true,"ERROR")
  112. end
  113. elseif MY == 4 and MX == 33 then
  114. DIR = "./MAIN"
  115. DIRN = "C"
  116. elseif MY == 5 then
  117. shell.run("fg",fs.list(DIR)[1])
  118. elseif MY == 6 then
  119. shell.run("fg",fs.list(DIR)[2])
  120. elseif MY == 7 then
  121. shell.run("fg",fs.list(DIR)[3])
  122. elseif MY == 8 then
  123. shell.run("fg",fs.list(DIR)[4])
  124. elseif MY == 9 then
  125. shell.run("fg",fs.list(DIR)[5])
  126. elseif MY == 10 then
  127. shell.run("fg",fs.list(DIR)[6])
  128. elseif MY == 11 then
  129. shell.run("fg",fs.list(DIR)[7])
  130. elseif MY == 12 then
  131. shell.run("fg",fs.list(DIR)[8])
  132. elseif MY == 13 then
  133. shell.run("fg",fs.list(DIR)[9])
  134. end
  135.  
  136. sleep(0.5)
  137. term.clear()
  138. term.setBackgroundColor(C)
  139. end
  140. term.setBackgroundColor(colors.black)
  141. term.clear()
  142. W,H = term.getSize()
  143. term.setCursorPos((W/2)-12,(H/2))
  144. term.setTextColor(colors.orange)
  145. term.setBackgroundColor(colors.gray)
  146. textutils.slowPrint("IT IS NOW SAFE TO SHUTDOWN")
  147. sleep(3)
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement