PolskiWisnia

NextUI Setup

Jan 24th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.18 KB | None | 0 0
  1. local function s(...) return sleep(...) end
  2. local function w(...) return write(...) end
  3. local function p(...) return print(...) end
  4. local function tw(...) return term.write(...) end
  5. local function scp(...) return term.setCursorPos(...) end
  6. local function sbc(...) return term.setBackgroundColor(...) end
  7. local function stc(...) return term.setTextColor(...) end
  8. local function tc(...) return term.clear(...) end
  9. local function tcl(...) return term.clearLine(...) end
  10. local function r(...) return shell.run(...) end
  11. local function sp(...) return textutils.slowPrint(...) end
  12. local function sw(...) return textutils.slowWrite(...) end
  13. local function fse(...) return fs.exists(...) end
  14. local function pul(...) return paintutils.loadImage(...) end
  15. local function pud(...) return paintutils.drawImage(...) end
  16. local function pfb(...) return paintutils.drawFilledBox(...) end
  17. local function su(...) return os.shutdown(...) end
  18. local function re(...) return os.reboot(...) end
  19. local function pdp(...) return paintutils.drawPixel(...) end
  20. function eng()
  21. tc()
  22. sbc(colors.purple)
  23. tc()
  24. sbc(colors.purple)
  25. stc(colors.white)
  26. scp(1,1)
  27. p("NextUI Setup")
  28. scp(1,2)
  29. p("Please choose install language")
  30. scp(1,5)
  31. sbc(colors.white)
  32. stc(colors.black)
  33. p("X")
  34. sbc(colors.purple)
  35. stc(colors.white)
  36. scp(3,5)
  37. p("English")
  38. scp(1,7)
  39. sbc(colors.white)
  40. stc(colors.black)
  41. p(" ")
  42. sbc(colors.purple)
  43. stc(colors.white)
  44. scp(3,7)
  45. p("Polski")
  46. scp(46,19)
  47. sbc(colors.white)
  48. stc(colors.black)
  49. w("Next")
  50. local event, click, x, y = os.pullEvent("mouse_click")
  51. if x>0 and x<10 and y == 7 then polski() end
  52. if x>45 and x<51 and y == 19 then installeng() end
  53. end
  54.  
  55. function polski()
  56. tc()
  57. sbc(colors.purple)
  58. tc()
  59. sbc(colors.purple)
  60. stc(colors.white)
  61. scp(1,1)
  62. p("NextUI Setup")
  63. scp(1,2)
  64. p("Wybierz jezyk instalacji.")
  65. scp(1,5)
  66. sbc(colors.white)
  67. stc(colors.black)
  68. p(" ")
  69. sbc(colors.purple)
  70. stc(colors.white)
  71. scp(3,5)
  72. p("English")
  73. scp(1,7)
  74. sbc(colors.white)
  75. stc(colors.black)
  76. p("X")
  77. sbc(colors.purple)
  78. stc(colors.white)
  79. scp(3,7)
  80. p("Polski")
  81. scp(46,19)
  82. sbc(colors.white)
  83. stc(colors.black)
  84. w("Dalej")
  85. local event, click, x, y = os.pullEvent("mouse_click")
  86. if x>0 and x<10 and y == 5 then eng() end
  87. if x>45 and x<52 and y == 19 then installpol() end
  88. end
  89.  
  90. function installeng()
  91. term.clear()
  92.    term.setCursorPos(1,1)
  93.    print("Installing. Please wait!")
  94.    shell.run("rm startup")
  95.    term.setCursorPos(1,17)
  96.    shell.run("pastebin get bCbsGEb4 startup")
  97.    shell.run("mkdir os")
  98.    term.setCursorPos(1,17)
  99.    shell.run("pastebin get CvTWL3sz /os/.next")
  100.    term.setCursorPos(1,17)
  101.    shell.run("pastebin get u0urwgNc /os/.2048")
  102.    term.setCursorPos(1,17)
  103.    shell.run("pastebin get pzWSRqNF /os/.paint")
  104.    scp(1,17)
  105.    r("pastebin get KCNCwuj3 /os/.pulpit")
  106.    term.setCursorPos(1,17)
  107.    r("pastebin get vyAZc6tJ /os/.luaide")
  108.    term.setCursorPos(1,17)
  109.    r("pastebin get 0uMxiriG /os/.kol")
  110.    term.setCursorPos(1,17)
  111.    r("pastebin get ZV1RFXwz /os/.ver")
  112.    term.setCursorPos(1,17)
  113.    r("pastebin get NVzDaz4M /os/icon")
  114.    scp(1,17)
  115.    r("pastebin get iqNnH1vT /os/.update")
  116.    os.setComputerLabel("NextUI PC")
  117. tc()
  118. sbc(colors.purple)
  119. tc()
  120. sbc(colors.purple)
  121. scp(1,1)
  122. stc(colors.white)
  123. p("NextUI Configuration")
  124. p("Now let's configure your PC")
  125. p("Enter your username and password")
  126. w("Username: ")
  127. username = read()
  128. w("Password: ")
  129. password = read()
  130. local p = fs.open("/os/.log1", "w")
  131. p.write(username)
  132. p.close()
  133. local h = fs.open("/os/.log2", "w")
  134. h.writeLine(password)
  135. h.close()
  136. s(1)
  137. re()
  138. end
  139.  
  140. function installpol()
  141.    term.clear()
  142.    term.setCursorPos(1,1)
  143.    print("Instaluje....")
  144.    term.setCursorPos(20,19)
  145.    write("/startup")
  146.    shell.run("rm startup")
  147.    term.setCursorPos(1,17)
  148.    shell.run("pastebin get bCbsGEb4 startup")
  149.    term.setCursorPos(20,19)
  150.    write("/os/")
  151.    shell.run("mkdir os")
  152.    term.setCursorPos(20,19)
  153.    write("/os/.menu")
  154.    term.setCursorPos(1,17)
  155.    shell.run("pastebin get b18gdXZq /os/.next")
  156.    term.setCursorPos(20,19)
  157.    write("/os/.2048")
  158.    term.setCursorPos(1,17)
  159.    shell.run("pastebin get u0urwgNc /os/.2048")
  160.    term.setCursorPos(20,19)
  161.    write("/os/.paint")
  162.    term.setCursorPos(1,17)
  163.    shell.run("pastebin get pzWSRqNF /os/.paint")
  164.    scp(1,17)
  165.    shell.run("pastebin get KCNCwuj3 /os/.pulpit")
  166.    term.setCursorPos(20,19)
  167.    write("/os/.luaide")
  168.    term.setCursorPos(1,17)
  169.    shell.run("pastebin get vyAZc6tJ /os/.luaide")
  170.    r("pastebin get hckriUmW /os/.jez")
  171.    r("pastebin get 0uMxiriG /os/.kol")
  172.    term.setCursorPos(1,17)
  173.    shell.run("pastebin get ZV1RFXwz /os/.ver")
  174.    term.clear()
  175.    term.setCursorPos(20,19)
  176.    write("/os/icon")
  177.    term.setCursorPos(1,17)
  178.    shell.run("pastebin get NVzDaz4M /os/icon")
  179.    scp(1,17)
  180.    r("pastebin get m4t3fTXs /os/.update")
  181. tc()
  182. sbc(colors.purple)
  183. tc()
  184. sbc(colors.purple)
  185. scp(1,1)
  186. stc(colors.white)
  187. p("NextUI Konfiguracja")
  188. p("Teraz skonfigurujemy Twoj komputer")
  189. p("Wpisz swoja nazwe uzytkownika i haslo.")
  190. w("Nazwa uzytkownika: ")
  191. username = read()
  192. w("Haslo: ")
  193. password = read()
  194. local p = fs.open("/os/.log1", "w")
  195. p.write(username)
  196. p.close()
  197. local h = fs.open("/os/.log2", "w")
  198. h.writeLine(password)
  199. h.close()
  200. s(1)
  201. re()
  202. end
  203.  
  204. while true do
  205. eng()
  206. end
Add Comment
Please, Sign In to add comment