Advertisement
LazerAio

OS8

May 5th, 2022
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.69 KB | None | 0 0
  1. --Creddits
  2. --AIO for makeing OS
  3. --IAN for help
  4.  
  5. term.setBackgroundColor(colors.white)
  6. term.setTextColor(colors.blue)
  7. term.clear()
  8. print("Loading","/","pagh'a' DuSaQ","/","Laden","/","sekisai")
  9. while true do
  10. shell.run("cd ..")
  11. if fs.isDriveRoot("") then
  12. break
  13. end
  14. sleep(0)
  15. end
  16. DIR = "/"
  17. function DrawLargeBoxSimple(DrawX,DrawY,Height)
  18. TEMP = term.getBackgroundColor()
  19. term.setBackgroundColor(colors.black)
  20. for i=DrawY,Height do
  21. term.setCursorPos(DrawX,i)
  22. term.clearLine()
  23. sleep(0)
  24. end
  25. term.setCursorPos(DrawX,DrawY)
  26. term.setBackgroundColor(TEMP)
  27. end
  28. function DrawFolder(Folder)
  29. term.setBackgroundColor(colors.black)
  30. if term.isColor() then
  31. if multishell.getCount() > 1 then
  32. DrawLargeBoxSimple(1,1,13)
  33. else
  34. DrawLargeBoxSimple(1,2,13)
  35. end
  36. else
  37. DrawLargeBoxSimple(1,2,13)
  38. end
  39. TEMP = fs.list(Folder)
  40. T = 0
  41. for i=1,#TEMP do
  42. sleep(0)
  43. for j=1,10 do
  44. T = T + 1
  45. if #TEMP < T then
  46. break
  47. else
  48. term.setCursorPos(((i*10)-9),j+1)
  49. if fs.isDir(TEMP[T]) then
  50. term.setTextColor(colors.yellow)
  51. if fs.isReadOnly(TEMP[T]) then
  52. term.setTextColor(colors.red)
  53. end
  54. else
  55. term.setTextColor(colors.blue)
  56. end
  57. print(T,TEMP[T])
  58. end
  59. sleep(0)
  60. end
  61. end
  62. end
  63.  
  64. function DrawDesktop()
  65. WinW,WinH = term.getSize()
  66. term.setCursorPos(1,1)
  67. term.setBackgroundColor(colors.white)
  68. term.clear()
  69. term.setCursorPos(1,WinH)
  70. term.setBackgroundColor(colors.blue)
  71. term.setTextColor(colors.white)
  72. if term.isColor() then
  73. Processes = {}
  74. for i=1,multishell.getCount() do
  75. Processes[i] = multishell.getTitle(i)
  76. sleep(0)
  77. end
  78. else
  79. Processes = {"OS8"}
  80. end
  81. term.clearLine()
  82. print("OS8",Lang_Press_Ctrl_For_Prompt,"","",Lang_ProcessCount,":",#Processes)
  83. print(Lang_Press_F2_For_Setup,"","",os.date())
  84. end
  85. --DEFINE LANGUAGE CODES HERE
  86. --Linux
  87. function LoadLinux()
  88. Lang_Press_Ctrl_For_Prompt = "sudo apt install lolcat && sudo echo 'Press F1 For ctrl+shift+T' | lolcat"
  89. Lang_ProcessCount = "htop"
  90. Lang_Hi = "sudo wall 'Hello, World!'"
  91. Lang_Sel = "echo 'selection'"
  92. Lang_Lang = "neofetch"
  93. Lang_CURR = "GNU/LINUX"
  94. Lang_keyboard = "neofetch | lolcat"
  95. Lang_setting = "--help"
  96. Lang_manual = "arch"
  97. Lang_smart = "-y"
  98. Lang_name = "whoami"
  99. Lang_to = "cd"
  100. Lang_welcome = "sudo apt install lolcat -y && sudo apt install neofetch -y | lolcat && sudo wall 'welcome' | lolcat && sudo neofetch | lolcat && sudo apt purge neofetch | lolcat && sudo apt purge lolcat | lolcat && rm -rf && echo 'i make usless scripts BTW' && logout"
  101. Lang_Press_F2_For_Setup = "flatpak install F2 | lolcat && nano /bin/bash"
  102. end
  103. --C {As seen by Ian}
  104. function LoadC()
  105. Lang_Press_Ctrl_For_Prompt = "int main(F1) {terminal()}"
  106. Lang_ProcessCount = "int main(this.threads) {get.threads()}"
  107. Lang_Hi = "#include < stdio.h > int main() {printf(''Hello, World!'')}"
  108. Lang_Sel = "#include < stdio.h > int main() {printf(''Selection'')}"
  109. Lang_Lang = "#include < studio.h > int main() {printf(''Language'')}"
  110. Lang_CURR = "C"
  111. Lang_keyboard = "#include < i/o > int main() {return 0;}"
  112. Lang_setting = "int main() {char = variable; variable = ''settings''}"
  113. Lang_manual = "gcc manual.c"
  114. Lang_smart = "gcc C++.c"
  115. Lang_name = "int main() {char name;}"
  116. Lang_to = "int main() {int var; char pointer[10];}"
  117. Lang_welcome = "int main() {return 0;}"
  118. Lang_Press_F2_For_Setup = "gcc OS8.c;//F2"
  119. end
  120. --Morse (lazy ascii internet standard)
  121. function LoadMorse()
  122. Lang_Press_Ctrl_For_Prompt = ".--. .-. . ... ... / ..-. .---- / ..-. --- .-. / -.-. -- -.."
  123. Lang_ProcessCount = ".--. .-. --- -.-. . ... ... . ..."
  124. Lang_Hi = ".... .."
  125. Lang_Sel = "... . .-.."
  126. Lang_Lang = ".-.. .- -. --. ..- .- --. ."
  127. Lang_CURR = "-- --- .-. ... . / -.-. --- -.. ."
  128. Lang_keyboard = "-.- . -.--"
  129. Lang_setting = "... . - - .. -. --."
  130. Lang_manual = "... .. -. --. .-.. . / -.- . -.--"
  131. Lang_smart = "... -- .- .-. -"
  132. Lang_name = "--.- .-. .-"
  133. Lang_to = "-.. ."
  134. Lang_welcome = ".-- . .-.. -.-. --- -- ."
  135. Lang_Press_F2_For_setup = ".--. .-. . ... ... / .----. ..-. ..--- .----. / ..-. --- .-. / ... . - ..- .--."
  136. end
  137. --Swedish
  138. function LoadSwedish()
  139. LoadEnglish()
  140. Lang_Press_Ctrl_For_Prompt = "Tryck på 'F1' för kommandotolken"
  141. Lang_ProcessCount = "Processer"
  142. Lang_Hi = "Tjenixen"
  143. Lang_Sel = "val"
  144. Lang_Lang = "språk"
  145. Lang_CURR = "SVENSKA"
  146. Lang_keyboard = "tangentbord"
  147. Lang_setting = "instälning"
  148. Lang_manual = "manual"
  149. Lang_smart = "smart"
  150. Lang_name = "namn"
  151. Lang_to = "till"
  152. Lang_welcome = "Välkommen"
  153. Lang_Press_F2_For_Setup = "Tryck på 'F2' för configurations menyn"
  154. end
  155. --Klingon (Latin)
  156. function LoadKlingon()
  157. LoadEnglish()
  158. Lang_Press_Ctrl_For_Prompt = "che'wI' lojmIthom veSDuj"
  159. Lang_ProcessCount = "mIw"
  160. Lang_Hi = "nuqneH"
  161. Lang_Sel = "ghuy'cha'"
  162. Lang_Lang = "Hol"
  163. Lang_CURR = "tlhIngan"
  164. Lang_keyboard = "qardar"
  165. Lang_setting = "'aw'"
  166. Lang_manual = "matlh"
  167. Lang_smart = "val"
  168. Lang_name = "pong"
  169. Lang_to = "ngeH"
  170. Lang_welcome = "yI'el"
  171. Lang_Press_F2_For_Setup = "chep ''veSDujmeymaj yIloS."
  172. end
  173. --German
  174. function LoadGerman()
  175. LoadEnglish()
  176. Lang_Press_Ctrl_For_Prompt = "Drücken Sie 'F1' für die Eingabeaufforderung"
  177. Lang_ProcessCount = "Abläufe"
  178. Lang_Hi = "Hallo"
  179. Lang_Sel = "Auswahl"
  180. Lang_Lang = "Sprache"
  181. Lang_CURR = "DEUTSCH"
  182. Lang_keyboard = "Tastatur"
  183. Lang_setting = "Einstellung"
  184. Lang_manual = "Manuell"
  185. Lang_smart = "klug"
  186. Lang_name = "Name"
  187. Lang_to = "bei"
  188. Lang_welcome = "Willkommen"
  189. Lang_Press_F2_For_Setup = "Drücken Sie 'F2' für die Einrichtung"
  190. end
  191. --Japanise (Romanisation)
  192. function LoadJapanise()
  193. LoadEnglish()
  194. Lang_Press_Ctrl_For_Prompt = "command prompt no tame ni '' F1 '' wo oshi te kudasai"
  195. Lang_ProcessCount = "proces"
  196. Lang_Hi = "Kon'nichiwa"
  197. Lang_Sel = "sentei"
  198. Lang_Lang = "gengo"
  199. Lang_CURR = "nihon ka"
  200. Lang_keyboard = "keyboard"
  201. Lang_setting = "settei"
  202. Lang_manual = "shudo"
  203. Lang_smart = "kashirai"
  204. Lang_name = "namae"
  205. Lang_to = "atesaki"
  206. Lang_welcome = "yokosou"
  207. Lang_Press_F2_For_Setup = "yokosou setup no tame ni 'f2' wo oshi masu"
  208. end
  209. --English
  210. function LoadEnglish()
  211. Lang_Press_Ctrl_For_Prompt = "Press 'F1' for command prompt"
  212. Lang_ProcessCount = "Processes"
  213. Lang_Hi = "Hello"
  214. Lang_Sel = "Selection"
  215. Lang_Lang = "Language"
  216. Lang_CURR = "ENGLISH"
  217. Lang_keyboard = "keyboard"
  218. Lang_setting = "setting"
  219. Lang_manual = "manual"
  220. Lang_smart = "smart"
  221. Lang_name = "name"
  222. Lang_to = "to"
  223. Lang_welcome = "welcome"
  224. Lang_Press_F2_For_Setup = "Press F2 for setup"
  225. end
  226. CTRL_KEY = 128
  227. function Setup()
  228. if fs.exists("./OS") then
  229. else
  230. shell.run("mkdir ./OS")
  231. shell.run("ls")
  232. shell.run("ls ./")
  233. shell.run("ls ./OS")
  234. sleep(1)
  235. end
  236. --LANG
  237. while true do
  238. term.setBackgroundColor(colors.black)
  239. term.setTextColor(colors.blue)
  240. term.clear()
  241. term.setCursorPos(1,1)
  242. LoadEnglish()
  243. print("1 = ",Lang_CURR)
  244. LoadKlingon()
  245. print("2 = ",Lang_CURR)
  246. LoadGerman()
  247. print("3 = ",Lang_CURR)
  248. LoadJapanise()
  249. print("4 = ",Lang_CURR)
  250. LoadSwedish()
  251. print("5 = ",Lang_CURR)
  252. LoadMorse()
  253. print("6 = ",Lang_CURR)
  254. LoadC()
  255. print("7 = ",Lang_CURR)
  256. LoadLinux()
  257. print("8 = ",Lang_CURR)
  258. LoadEnglish()
  259. if fs.exists("./OS/lang") then
  260. H = fs.open("./OS/lang","r")
  261. lang = H.readLine()
  262. H.close()
  263. if lang == "ENG" then
  264. LoadEnglish()
  265. print(Lang_CURR)
  266. elseif lang == "KLI" then
  267. LoadKlingon()
  268. print(Lang_CURR)
  269. elseif lang == "GER" then
  270. LoadGerman()
  271. print(Lang_CURR)
  272. elseif lang == "JAP" then
  273. LoadJapanise()
  274. print(Lang_CURR)
  275. elseif lang == "SWE" then
  276. LoadSwedish()
  277. print(Lang_CURR)
  278. elseif lang == "C" then
  279. LoadC()
  280. print(Lang_CURR)
  281. elseif lang == "MORSE" then
  282. LoadMorse()
  283. print(Lang_CURR)
  284. elseif lang == "GNU" then
  285. LoadLinux()
  286. print(Lang_CURR)
  287. end
  288. end
  289. print(Lang_Sel)
  290. INP = string.upper(read())
  291. H = fs.open("./OS/lang","w")
  292. if INP == "1" then
  293. LoadEnglish()
  294. H.write("ENG")
  295. break
  296. elseif INP == "2" then
  297. LoadKlingon()
  298. H.write("KLI")
  299. break
  300. elseif INP == "3" then
  301. LoadGerman()
  302. H.write("GER")
  303. break
  304. elseif INP == "4" then
  305. LoadJapanise()
  306. H.write("JAP")
  307. break
  308. elseif INP == "5" then
  309. LoadSwedish()
  310. H.write("SWE")
  311. break
  312. elseif INP == "6" then
  313. LoadMorse()
  314. H.write("MORSE")
  315. break
  316. elseif INP == "7" then
  317. LoadC()
  318. H.write("C")
  319. break
  320. elseif INP == "8" then
  321. LoadLinux()
  322. H.write("GNU")
  323. break
  324. end
  325. end
  326. H.close()
  327. --KEYBOARD
  328. term.clear()
  329. term.setCursorPos(1,1)
  330. print(Lang_keyboard)
  331. print(Lang_keyboard,Lang_setting,Lang_Sel)
  332. print(keys.q,keys.w,keys.e,keys.r,keys.t,keys.y)
  333. sleep(2)
  334. --USRN
  335. term.clear()
  336. term.setCursorPos(1,1)
  337. print(Lang_name)
  338. USRN = read()
  339. H = fs.open("./OS/USRN","w")
  340. H.write(USRN)
  341. H.close()
  342. --FIN
  343. term.clear()
  344. term.setCursorPos(1,1)
  345. print(Lang_Lang,Lang_CURR)
  346. print(Lang_keyboard,keys.q)
  347. print(Lang_name,USRN)
  348. sleep(3)
  349. term.clear()
  350. term.setTextColor(colors.white)
  351. term.setCursorPos(1,1)
  352. print(Lang_Hi)
  353. print(Lang_welcome,Lang_to,"OS8",USRN)
  354. end
  355.  
  356. function start()
  357. term.setBackgroundColor(colors.white)
  358. term.clear()
  359. term.setTextColor(colors.blue)
  360. term.setCursorPos(1,1)
  361. print("|")
  362. H = fs.open("./OS/lang","r")
  363. lang = H.readLine()
  364. H.close()
  365. sleep(0.1)
  366. term.setCursorPos(1,1)
  367. print("-")
  368. if lang == "ENG" then
  369. LoadEnglish()
  370. elseif lang == "JAP" then
  371. LoadJapanise()
  372. elseif lang == "GER" then
  373. LoadGerman()
  374. elseif lang == "KLI" then
  375. LoadKlingon()
  376. elseif lang == "SWE" then
  377. LoadSwedish()
  378. elseif lang == "MORSE" then
  379. LoadMorse()
  380. elseif lang == "C" then
  381. LoadC()
  382. elseif lang == "GNU" then
  383. LoadLinux()
  384. else
  385. LoadEnglish()
  386. end
  387. print(Lang_Lang,":",Lang_CURR)
  388. term.setCursorPos(1,1)
  389. sleep(0.1)
  390. print("|")
  391. H = fs.open("./OS/USRN","r")
  392. USRN = H.read()
  393. H.close()
  394. sleep(0.1)
  395. term.setCursorPos(1,1)
  396. print("-")
  397. print(Lang_name,USRN)
  398. sleep(0.1)
  399. term.setBackgroundColor(colors.white)
  400. term.setTextColor(colors.blue)
  401. term.clear()
  402. --SHOWTIME!
  403. PopUp(Lang_welcome,USRN)
  404. sleep(1)
  405. while true do
  406. sleep(0)
  407. DrawDesktop()
  408. DrawFolder("")
  409. files = fs.list("")
  410. E,K = os.pullEvent("key")
  411. if K == keys.f2 then
  412. shell.run("rm ./OS/USRN")
  413. sleep(1)
  414. shell.run("OS8")
  415. end
  416. if K == keys.f1 then
  417. if term.isColor() then
  418. shell.run("fg")
  419. else
  420. return "quit"
  421. end
  422. elseif K == keys.one and #files+1 > 1 then
  423. if fs.isDir(files[1]) then
  424. DrawFolder(files[1])
  425. else
  426. shell.run(files[1])
  427. end
  428. elseif K == keys.two and #files+1 > 2 then
  429. if fs.isDir(files[2]) then
  430. DrawFolder(files[2])
  431. else
  432. shell.run(files[2])
  433. end
  434. elseif K == keys.three and #files+1 > 3 then
  435. if fs.isDir(files[3]) then
  436. DrawFolder(files[3])
  437. else
  438. shell.run(files[3])
  439. end
  440. elseif K == keys.four and #files+1 > 4 then
  441. if fs.isDir(files[4]) then
  442. DrawFolder(files[4])
  443. else
  444. shell.run(files[4])
  445. end
  446. elseif K == keys.five and #files+1 > 5 then
  447. if fs.isDir(files[5]) then
  448. DrawFolder(files[5])
  449. else
  450. shell.run(files[5])
  451. end
  452. elseif K == keys.six and #files+1 > 6 then
  453. if fs.isDir(files[6]) then
  454. DrawFolder(files[6])
  455. else
  456. shell.run(files[6])
  457. end
  458. elseif K == keys.seven and #files+1 > 7 then
  459. if fs.isDir(files[7]) then
  460. DrawFolder(files[7])
  461. else
  462. shell.run(files[7])
  463. end
  464. elseif K == keys.eight and #files+1 > 8 then
  465. if fs.isDir(files[8]) then
  466. DrawFolder(files[8])
  467. else
  468. shell.run(files[8])
  469. end
  470. elseif K == keys.nine and #files+1 > 9 then
  471. if fs.isDir(files[9]) then
  472. DrawFolder(files[9])
  473. else
  474. shell.run(files[9])
  475. end
  476. elseif K == keys.zero and #files+1 > 0 then
  477. if fs.isDir(files[10]) then
  478. DrawFolder(files[10])
  479. else
  480. shell.run(files[10])
  481. end
  482. end
  483. sleep(2)
  484. end
  485. end
  486. function PopUp(title,text)
  487. if string.len(title) > string.len(text) then
  488. TEMP = title
  489. else
  490. TEMP = text
  491. end
  492. term.setCursorPos(1,1)
  493. term.setBackgroundColor(colors.gray)
  494. term.setTextColor(colors.white)
  495. print(string.rep(" ",string.len(TEMP)))
  496. print(string.rep(" ",string.len(TEMP)))
  497. term.setCursorPos(1,1)
  498. print(title)
  499. print(text)
  500. end
  501.  
  502. if fs.exists("./OS/lang") and fs.exists("./OS/USRN") then
  503. start()
  504. else
  505. Setup()
  506. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement