PolskiWisnia

nextAPI

Jul 21st, 2020
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 54.28 KB | None | 0 0
  1. -- nextAPI Development Tool --
  2. local function s(...) return sleep(...) end
  3. local function aw(...) return write(...) end
  4. local function p(...) return print(...) end
  5. local function tw(...) return term.write(...) end
  6. local function scp(...) return term.setCursorPos(...) end
  7. local function sbc(...) return term.setBackgroundColor(...) end
  8. local function stc(...) return term.setTextColor(...) end
  9. local function tc(...) return term.clear(...) end
  10. local function tcl(...) return term.clearLine(...) 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. local w, h = term.getSize()
  21.  
  22.  
  23. function apps()
  24. while true do
  25. sbc(colors.black)
  26. tc()
  27. sbc(colors.black)
  28. pfb(6, h, w, h, colors.blue)
  29. sbc(colors.green)
  30. stc(colors.white)
  31. scp(1,h)
  32. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black)  end
  33. aw("Start")
  34. pfb(1, 1, w, 1, colors.blue)
  35. pdp(w, 1, colors.red)
  36. pdp(w-1, h, colors.red)
  37. pdp(w-1, h, colors.orange)
  38. scp(1,1)
  39. sbc(colors.blue)
  40. stc(colors.white)
  41. p("Zarzadzanie aplikacjami")
  42. pfb(3, 3, 5, 3, colors.gray)
  43. pdp(3, 3, colors.lightGray)
  44. scp(6,3)
  45. stc(colors.white)
  46. sbc(colors.black)
  47. miejsce = math.ceil(fs.getFreeSpace("/")/1024)
  48. p("Dysk twardy   Wolne miejsce: ", miejsce, "KB")
  49. scp(1,6)
  50. p("Aplikacje:")
  51. scp(6,8)
  52. stc(colors.white)
  53. sbc(colors.black)
  54. if fs.exists("/nshop/") then rozmiar = math.ceil(getSize("/nshop/")/1024) else
  55. scp(1,7) sbc(colors.black) stc(colors.white) p("Brak zainstalowanych aplikacji") end
  56. scp(1,5)
  57. p("Laczny rozmiar aplikacji na dysku: ", rozmiar, "KB")
  58. if fs.exists("/nshop/.exp") then pfb(3, 8, 5, 8, colors.blue) scp(6,8) stc(colors.white) sbc(colors.black) p("Eksplorator") scp(1,8) stc(colors.white) sbc(colors.red) p("X") end
  59. if fs.exists("/nshop/.dg") then pfb(3, 10, 5, 10, colors.gray) scp(6,10) stc(colors.white) sbc(colors.black) p("DGStatistics") scp(1,10) stc(colors.white) sbc(colors.red) p("X") end
  60. if fs.exists("/nshop/.tm") then pfb(3, 12, 5, 12, colors.green) scp(6,12) stc(colors.white) sbc(colors.black) p("TimeMachine") scp(1,12) stc(colors.white) sbc(colors.red) p("X") end
  61. if fs.exists("/nshop/.calc") then pfb(3, 14, 5, 14, colors.cyan) scp(6,14) stc(colors.white) sbc(colors.black) p("Kalkulator") scp(1, 14) stc(colors.white) sbc(colors.red) p("X") end
  62. local event, click, x, y = os.pullEvent("mouse_click")
  63. if x>0 and x<6 and y == h then start() end
  64. if x == 1 and y == 8 then fs.delete("/nshop/.exp") s(1)  end
  65. if x == 1 and y == 10 then fs.delete("/nshop/.dg") s(1)  end
  66. if x == 1 and y == 12 then fs.delete("/nshop/.tm") s(1)  end
  67. if x == 1 and y == 14 then fs.delete("/nshop/.calc") s(1) end
  68. if x == w and y == 1 then nust() end
  69. end
  70. end
  71.  
  72.  
  73. function kolorw()
  74. scp(1,5)
  75. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  76. p("Obecny kolor wiodacy: ", colr)
  77. p("Wybierz nowy kolor wiodacy:")
  78. pdp(1, 7, colors.orange)
  79. pdp(2, 7, colors.lightBlue)
  80. pdp(3, 7, colors.yellow)
  81. pdp(4, 7, colors.lime)
  82. pdp(5, 7, colors.pink)
  83. pdp(6, 7, colors.gray)
  84. pdp(7, 7, colors.lightGray)
  85. pdp(8, 7, colors.purple)
  86. pdp(9, 7, colors.blue)
  87. pdp(10, 7, colors.brown)
  88. pdp(11, 7, colors.green)
  89. pdp(12, 7, colors.red)
  90. pdp(13, 7, colors.black)
  91. pdp(14, 7, colors.white)
  92. local event, click, x, y = os.pullEvent("mouse_click")
  93. if x == 1 and y == 7 then fs.delete("rm /os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.orange") colw.close() end
  94. if x == 2 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.lightBlue") colw.close() end
  95. if x == 3 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.yellow") colw.close() end
  96. if x == 4 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.lime") colw.close() end
  97. if x == 5 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.pink") colw.close() end
  98. if x == 6 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.gray") colw.close() end
  99. if x == 7 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.lightGray") colw.close() end
  100. if x == 8 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.purple") colw.close() end
  101. if x == 9 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.blue") colw.close() end
  102. if x == 10 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.brown") colw.close() end
  103. if x == 11 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.green") colw.close() end
  104. if x == 12 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.red") colw.close() end
  105. if x == 13 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.black") colw.close() end
  106. if x == 14 and y == 7 then fs.delete("/os/.kol") local colw = fs.open("/os/.kol", "w") colw.writeLine("colors.white") colw.close() end
  107. end
  108.  
  109. function deskust()
  110. while true do
  111. kolor()
  112. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  113. tc()
  114. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  115. pfb(1, 1, w, 1, colors.blue)
  116. scp(1,1)
  117. stc(colors.white)
  118. p("Ustawienia NextUI")
  119. pdp(w,1, colors.red)
  120. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  121.  scp(1,2)
  122.  p("Styl graficzny: Domyslny NextUI")
  123.  p("Brak dostepnych stylow")
  124.  p("Wybierz kolor wiodacy")
  125.  local event, click, x, y = os.pullEvent("mouse_click")
  126.  if x>0 and x<25 and y == 4 then kolorw() end
  127.  if x == w and y == 1 then nust() end
  128. end
  129. end
  130.  
  131.  
  132. function infust()
  133. while true do
  134. kolor()
  135. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  136. tc()
  137. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  138. pfb(1, 1, w, 1, colors.blue)
  139. scp(1,1)
  140. stc(colors.white)
  141. p("Ustawienia NextAPI")
  142. pdp(w,1, colors.red)
  143. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  144. scp(1,2)
  145. p("NextAPI Powered Software")
  146. p("Wersja systemu: nextAPI 1.0")
  147. zajete = math.ceil(getSize("/")/1024)
  148. wolne = math.ceil(fs.getFreeSpace("/")/1024)
  149. p("Wolne miejsce na dysku:", wolne, "KB")
  150. p("Obecna nazwa komputera: ", os.getComputerLabel())
  151. if pass == "" then log = "nie" else log = "tak" end
  152. p("Logowanie wlaczone: ", log)
  153. p("Rozdzielczosc ekranu: ", w, h)
  154. p("Wersja CraftOS: ", os.version())
  155. local event, click, x, y = os.pullEvent("mouse_click")
  156. if x == w and y == 1 then nust() end
  157. end
  158. end
  159.  
  160. function cmd()
  161. s(1)
  162. tc()
  163. sbc(colors.black)
  164. tc()
  165. sbc(colors.black)
  166. stc(colors.white)
  167. scp(1,1)
  168. p("MineCore Command Prompt")
  169. p("2018 Microcraft")
  170. p("Wpisz 'help', aby uzyskac pomoc")
  171. while true do
  172. write("./minecore/>")
  173. comm = read()
  174. if comm == "help" then
  175.  p("'ver' - wersja MineCore")
  176.  p("'next' - powrot do NextAPI")
  177.  p("'nextver' - wersja NextAPI")
  178.  p("'run' - uruchom plik")
  179.  p("'log' - zmiana hasla")
  180.  p("'reboot' - uruchom ponownie")
  181.  p("'shutdown' - wylacz komputer")
  182.  p("'craft' - powrot do CraftOS")
  183.  p("'update' - aktualizuj NextAPI")
  184.  p("'dir' - lista plikow w danym folderze")
  185.  p("'res' - rozdzielczosc ekranu")
  186.  p("'set' - Ustawienia NextAPI")
  187.  p("'app' - Aplikacje NextAPI")
  188.  p("'mon' - NextAPI Handoff Alpha")
  189.  p("'clock' - Zegar NextAPI Beta")
  190.  p("'setust'")
  191. end
  192. if comm == "reboot" then re() end
  193. if comm == "shutdown" then su() end
  194. if comm == "res" then p(w, h) end
  195. if comm == "set" then nust() end
  196. if comm == "app" then app() end
  197. if comm == "setust" then setust() end
  198. if comm == "mon" then bsodp() end
  199. if comm == "clock" then clock() end
  200. if comm == "ver" then
  201.  p("Microcraft MineCore 2.0 2020.")
  202.  p("Microcraft MineUI D 1.5 2018.")
  203. end
  204. if comm == "nextver" then
  205.  p("Microcraft NextAPI 1.0 2020.")
  206. end
  207. if comm == "next" then system() end
  208. end
  209. end
  210.  
  211. function setust()
  212. while true do
  213. kolor()
  214. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  215. tc()
  216. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  217. pfb(1, 1, w, 1, colors.blue)
  218. scp(1,1)
  219. stc(colors.white)
  220. p("Ustawienia NextUI")
  221. pdp(w,1, colors.red)
  222. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  223. p("Zmien nazwe komputera")
  224. p("Wiersz polecen")
  225. p("Zegar NextUI |BETA|")
  226. local event, click, x, y = os.pullEvent("mouse_click")
  227. if x>0 and x<20 and y == 2 then
  228.  scp(1,2)
  229.   write("Wpisz nowa nazwe: ")
  230.   nazwa = read()
  231.   os.setComputerLabel(nazwa)
  232.   setust()
  233. end
  234. if x>0 and x<20 and y == 3 then cmd() end
  235. if x>0 and x<20 and y == 4 then clock() end
  236. if x == w and y == 1 then nust() end
  237. end
  238. end
  239.  
  240.  
  241. function nust()
  242. while true do
  243. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  244. tc()
  245. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  246. pfb(1, h, w, h, colors.blue)
  247. scp(1,h)
  248. stc(colors.white)
  249. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  250. write("Start")
  251. pdp(w-1,h, colors.red)
  252. pdp(w,h, colors.orange)
  253. pfb(1, 1, w, 1, colors.blue)
  254. scp(1,1)
  255. p("Ustawienia NextUI")
  256. pdp(w,1, colors.red)
  257. pfb(3, 4, 13, 6, colors.orange)
  258. scp(3,5)
  259. stc(colors.white)
  260. p("Informacje")
  261. pfb(27, 4, 37, 6, colors.cyan)
  262. scp(27,5)
  263. stc(colors.white)
  264. p("Biurko")
  265. pfb(15, 4, 25, 6, colors.green)
  266. scp(15,5)
  267. stc(colors.white)
  268. p("Ustawienia")
  269. pfb(39, 4, 49, 6, colors.red)
  270. scp(39,5)
  271. stc(colors.white)
  272. p("Aplikacje")
  273. local event, click, x, y = os.pullEvent("mouse_click")
  274. if x == w and y == 1 then system() end
  275. if x>0 and x<6 and y == h then start() end
  276. if x>2 and x<14 and y>3 and y<7 then infust() end
  277. if x>14 and x<26 and y>3 and y<7 then setust() end
  278. if x>26 and x<38 and y>3 and y<7 then deskust() end
  279. if x>38 and x<50 and y>3 and y<7 then apps() end
  280. end
  281. end
  282.  
  283. if fs.exists("/os/.ver") then
  284. local wer = fs.open("/os/.ver", "r")
  285. ver = wer.readLine()
  286. wer.close()
  287. end
  288.  
  289. function res()
  290. if w<51 and h<19 then tc() p("NextUI wymaga monitora o rozdzielczosci 51x19 lub wiekszej. System nie moze dzialac na Twoim urzadzeniu. Rozdzielczosc Twojego monitora to:", w, h) elseif w == 51 and h == 19 then tryb = 1 elseif w>65 and h>25 then tryb = 2 end
  291. end
  292.  
  293. function kolor()
  294. local col = fs.open("/os/.kol", "r")
  295. colr = col.readLine()
  296. col.close()
  297. end
  298.  
  299. function ikony()
  300. while true do
  301. tc()
  302. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.green) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.white) elseif colr == "colors.black" then sbc(colors.black) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  303. tc()
  304. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.green) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.white) elseif colr == "colors.black" then sbc(colors.black) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  305. stc(colors.white)
  306. pfb(1, 1, w, 1, colors.gray)
  307. pdp(w, 1, colors.red)
  308. sbc(colors.gray)
  309. scp(1,1)
  310. p("Tworzenie ikon NextUI 2.0 Beta")
  311. scp(1,2)
  312. stc(colors.white)
  313. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  314. p("Witamy w kreatorze ikon. Wybierz miejsce na ikone:")
  315. if fs.exists("/os/iko/.ico1") then iko1 = "Zajete" else iko1 = "Wolne" end
  316. if fs.exists("/os/iko/.ico2") then iko2 = "Zajete" else iko2 = "Wolne" end
  317. if fs.exists("/os/iko/.ico3") then iko3 = "Zajete" else iko3 = "Wolne" end
  318. scp(1,6)
  319. p("Ikona 1: ", iko1)
  320. p("Ikona 2: ", iko2)
  321. p("Ikona 3: ", iko3)
  322. local event, click, x, y = os.pullEvent("mouse_click")
  323. if x == w and y == 1 then system() end
  324.  
  325. if x>0 and x<20 and y == 6 and iko1 == "Wolne" then
  326.  scp(1,10)
  327.  p("Wpisz sciezke skrotu: ")
  328.  write(".>")
  329.  sciezka = read()
  330.  p("Wpisz nazwe skrotu: ")
  331.  nazwa = read()
  332.  local iko1s = fs.open("/os/iko/.ico1", "w")
  333.  iko1s.writeLine(sciezka)
  334.  iko1s.close()
  335.  local iko1n = fs.open("/os/iko/.ico1n", "w")
  336.  iko1n.writeLine(nazwa)
  337.  iko1n.close()
  338. end
  339. if x>0 and x<20 and y == 8 and iko3 == "Wolne" then
  340.  scp(1,10)
  341.  p("Wpisz sciezke skrotu: ")
  342.  write(".>")
  343.  sciezka = read()
  344.  p("Wpisz nazwe skrotu: ")
  345.  nazwa = read()
  346.  local ikon3 = fs.open("/os/iko/.ico3", "w")
  347.  ikon3.writeLine(sciezka)
  348.  ikon3.close()
  349.  local ikon3n = fs.open("/os/iko/.ico3n", "w")
  350.  ikon3n.writeLine(nazwa)
  351.  ikon3n.close()
  352. end
  353. if x>0 and x<20 and y == 7 and iko2 == "Wolne" then
  354.  scp(1,10)
  355.  p("Wpisz sciezke skrotu: ")
  356.  write(".>")
  357.  sciezka = read()
  358.  p("Wpisz nazwe skrotu: ")
  359.  nazwa = read()
  360.  local ikon2 = fs.open("/os/iko/.ico2", "w")
  361.  ikon2.writeLine(sciezka)
  362.  ikon2.close()
  363.  local ikon2n = fs.open("/os/iko/.ico2n", "w")
  364.  ikon2n.writeLine(nazwa)
  365.  ikon2n.close()
  366. end
  367. if x>0 and x<20 and y == 6 and iko1 == "Zajete" then
  368.  fs.delete("/os/iko/.ico1")
  369.  fs.delete("/os/iko/.ico1n")
  370. end
  371. if x>0 and x<20 and y == 7 and iko2 == "Zajete" then
  372.  fs.delete("/os/iko/.ico2")
  373.  fs.delete("/os/iko/.ico2n")
  374. end
  375. if x>0 and x<20 and y == 8 and iko3 == "Zajete" then
  376.  fs.delete("/os/iko/.ico3")
  377.  fs.delete("/os/iko/.ico3n")
  378. end
  379. end
  380. end
  381.  
  382.  
  383. function start()
  384. pfb(1, h-5, 20, h-1, colors.black)
  385. scp(1, h-5)
  386. sbc(colors.white)
  387. stc(colors.black)
  388. p("NextUI 1.91 Start   ")
  389. sbc(colors.black)
  390. stc(colors.white)
  391. scp(1, h-4)
  392. p("nextStore 2.0       ")
  393. p("Powrot do CraftOS   ")
  394. p("Ustawienia          ")
  395. p("Ikony biurka        ")
  396. local event, click, x, y = os.pullEvent("mouse_click")
  397. if x>0 and x<21 and y == h-1 then ikony() end
  398. if x>0 and x<21 and y == h-2 then nust() end
  399. if x>0 and x<21 and y == h-3 then
  400.  tc()
  401.  s(1)
  402.  scp(1,1)
  403.  error("Opuszczono NextUI 1.91")
  404. end
  405. end
  406. function pulpit()
  407. sbc(colors.cyan)
  408. tc()
  409. sbc(colors.cyan)
  410. local obraz = pul("/os/.pulpit")
  411. pud(obraz, 5, 3)
  412. stc(colors.white)
  413. if colr == "colors.orange" then pfb(1, 1, w, 1, colors.orange) elseif colr == "colors.magneta" then pfb(1, 1, w, 1, colors.magneta) elseif colr == "colors.lightBlue" then pfb(1, 1, w, 1, colors.lightBlue) elseif colr == "colors.yellow" then pfb(1, 1, w, 1, colors.yellow) elseif colr == "colors.lime" then pfb(1, 1, w, 1, colors.lime) elseif colr == "colors.pink" then pfb(1, 1, w, 1, colors.pink) elseif colr == "colors.gray" then pfb(1, 1, w, 1, colors.gray) elseif colr == "colors.lightGray" then pfb(1, 1, w, 1, colors.lightGray) elseif colr == "colors.purple" then pfb(1, 1, w, 1, colors.purple) elseif colr == "colors.blue" then pfb(1, 1, w, 1, colors.blue) elseif colr == "colors.brown" then pfb(1, 1, w, 1, colors.brown) elseif colr == "colors.green" then pfb(1, 1, w, 1, colors.green) elseif colr == "colors.red" then pfb(1, 1, w, 1, colors.red) elseif colr == "colors.black" then pfb(1, 1, w, 1, colors.black) stc(colors.white) elseif colr == "colors.white" then pfb(1, 1, w, 1, colors.white) stc(colors.black) end
  414. if colr == "colors.white" then stc(colors.black) else stc(colors.white) end
  415. scp(1,1)
  416. p("NextUI 1.91 Summer Update")
  417. scp(1,h)
  418. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  419. write("Start")
  420. pfb(6, h, w, h, colors.blue)
  421. scp(w-12,h)
  422. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  423. write("Aplikacje")
  424. pdp(w, h, colors.red)
  425. pdp(w-1, h, colors.orange)
  426. end
  427.  
  428. function getSize(path)
  429.   local size = 0
  430.   for _, file in ipairs(fs.list(path)) do
  431.     if fs.isDir(fs.combine(path, file)) then
  432.       size = size + getSize(fs.combine(path, file))
  433.     else
  434.       size = size + fs.getSize(fs.combine(path, file))
  435.     end
  436.   end
  437.   return size
  438. end
  439.  
  440.  
  441. function mysz()
  442. local event, button, x, y = os.pullEvent("mouse_click")
  443. if x == w and y == h then su() end
  444. if x == w-1 and y == h then re() end
  445. if x>0 and x<6 and y == h and button == 1 then start() end
  446. if x>0 and x<6 and y == h and button == 2 then cmd() end
  447. if x<w-1 and x>w-13 and y == h then obraz22() end
  448. end
  449.  
  450.  
  451. function clock()
  452. while true do
  453. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  454. tc()
  455. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  456. pfb(1,1,w,1,colors.blue)
  457. scp(1,1)
  458. p("Zegar NextUI Beta")
  459. pdp(w,1,colors.red)
  460. scp(1,2)
  461. if fse("/os/.false") then
  462. clo = "false"
  463. elseif fse("/os/.true") then clo = "true"
  464. else
  465.  local op1 = fs.open("/os/.false", "w")
  466.  op1.writeLine("false")
  467.  op1.close()
  468.  clo = "false"
  469. end
  470. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  471. scp(1,2)
  472. p("Zmiany tutaj wprowadzone wymagaja ponownego uruchomienia, aby przyniosly oczekiwany efekt.")
  473. if clo == "false" then scp(1,5) sbc(colors.black) stc(colors.red) p("Wylaczony") elseif clo == "true" then scp(1,5) sbc(colors.black) stc(colors.green) p("Wlaczony") end
  474. local event, button, x, y = os.pullEvent("mouse_click")
  475. if x == w and y == 1 then setust() end
  476. if x>0 and x<20 and y == 5 and clo == "false" then
  477.  fs.delete("/os/.false")
  478.  local op2 = fs.open("/os/.true", "w")
  479.  op2.writeLine("true")
  480.  op2.close()
  481.  clock()
  482. end
  483. if x>0 and x<20 and y == 5 and clo == "true" then
  484.  fs.delete("/os/.true")
  485.  local op3 = fs.open("/os/.false", "w")
  486.  op3.writeLine("false")
  487.  op3.close()
  488.  clock()
  489. end
  490. end
  491. end
  492.  
  493. function godz()
  494. while true do
  495. scp(w-6,1)
  496. stc(colors.white)
  497. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  498. print( textutils.formatTime(os.time("local"), true ) )
  499. s(1)
  500. end
  501. end
  502.  
  503. function z1()
  504. if fse("/os/.false") then
  505. clo = "false"
  506. elseif fse("/os/.true") then clo = "true"
  507. else
  508.  local op1 = fs.open("/os/.false", "w")
  509.  op1.writeLine("false")
  510.  op1.close()
  511.  clo = "false"
  512. end
  513. end
  514.  
  515. function z2()
  516. if fse("/os/.false") then
  517. clo = "false"
  518. elseif fse("/os/.true") then clo = "true"
  519. else
  520.  local op1 = fs.open("/os/.false", "w")
  521.  op1.writeLine("false")
  522.  op1.close()
  523.  clo = "false"
  524. end
  525. end
  526.  
  527.  
  528. function sys1()
  529. while true do
  530. kolor()
  531. pulpit()
  532. parallel.waitForAny(godz, mysz)
  533. end
  534. end
  535.  
  536.  
  537. function sys2()
  538. while true do
  539. kolor()
  540. pulpit()
  541. mysz()
  542. end
  543. end
  544.  
  545. function clo3()
  546. z1()
  547. if clo == "true" then
  548. local function system(...) return sys1(...) end
  549. elseif clo == "false" or clo == nil then
  550. local function system(...) return sys2(...) end
  551. end
  552. p(clo)
  553. s(2)
  554. end
  555.  
  556. function system()
  557. z1()
  558. if clo == "true" then sys1()
  559. elseif clo == "false" then sys2()
  560. end
  561. end
  562.  
  563. function obraz22()
  564. while true do
  565. tc()
  566. sbc(colors.black)
  567. tc()
  568. sbc(colors.black)
  569. pfb(1,1,w,1,colors.blue)
  570. pfb(1,h,w,h,colors.blue)
  571. scp(1,h)
  572. if colr == "colors.orange" then sbc(colors.orange) elseif colr == "colors.magneta" then sbc(colors.magneta) elseif colr == "colors.lightBlue" then sbc(colors.lightBlue) elseif colr == "colors.yellow" then sbc(colors.yellow) elseif colr == "colors.lime" then sbc(colors.lime) elseif colr == "colors.pink" then sbc(colors.pink) elseif colr == "colors.gray" then sbc(colors.gray) elseif colr == "colors.lightGray" then sbc(colors.lightGray) elseif colr == "colors.purple" then sbc(colors.purple) elseif colr == "colors.blue" then sbc(colors.blue) elseif colr == "colors.brown" then sbc(colors.brown) elseif colr == "colors.green" then sbc(colors.green) elseif colr == "colors.red" then sbc(colors.red) elseif colr == "colors.black" then sbc(colors.black) stc(colors.white) elseif colr == "colors.white" then sbc(colors.white) stc(colors.black) end
  573. write("Start")
  574. scp(1,1)
  575. sbc(colors.blue)
  576. stc(colors.white)
  577. p("Aplikacje NextUI")
  578. scp(1,2)
  579. sbc(colors.black)
  580. pfb(16,2,16,h,colors.blue)
  581. pdp(w,h,colors.red)
  582. pdp(w-1,h,colors.orange)
  583. pdp(w,1,colors.red)
  584. local event, button, x, y = os.pullEvent("mouse_click")
  585. if x == w and y == 1 then system() end
  586. if x>0 and x<6 and y == h then start() end
  587. end
  588. end
Add Comment
Please, Sign In to add comment