Guest User

backup.rom

a guest
Aug 25th, 2017
1,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 152.70 KB | None | 0 0
  1. {
  2.   {
  3.     text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
  4. os.loadAPI(\"/System/API/context\")\
  5. os.loadAPI(\"/System/API/windows\")\
  6. os.loadAPI(\"/System/API/sysbar\")\
  7. os.loadAPI(\"/System/API/image\")\
  8. local xSize, ySize = term.getSize()\
  9. local xCenter, yCenter = math.floor(xSize/2), math.floor(ySize/2)\
  10. local run = true\
  11. local digits = {'0.png','1.png','2.png','3.png','4.png','5.png','6.png','7.png','8.png','9.png','dots.png'}\
  12. local comp = 0\
  13. if xSize > 30 then comp = 1 end\
  14. \
  15. local function clear(color)\
  16. \009term.setBackgroundColor(color)\
  17. \009term.clear()\
  18. end\
  19. \
  20. local function fadeIn(time)\
  21. for i=1,ySize-1 do\
  22.  paintutils.drawLine(1,i,xSize,i,mainColor)\
  23.  sleep(time)\
  24. end\
  25. end\
  26. \
  27. local function fadeOut(time)\
  28. for i=0,xSize do\
  29.  paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
  30.  paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
  31.  sleep(time)\
  32. end\
  33. \009term.setCursorPos(1,1)\
  34. \009term.setTextColor(colors.white)\
  35. end\
  36. \
  37. local function text(text,x,y)\
  38. \009term.setCursorPos(x,y)\
  39. \009term.write(text)\
  40. end\
  41. \
  42. local sysBar = function()\
  43. term.setTextColor(colors.black)\
  44. term.setBackgroundColor(colors.white)\
  45. sysbar.draw(colors.white,colors.black,noty,true,false,false)\
  46. end\
  47. \
  48. local formatTime = function(nTime)\
  49.    local nHour = math.floor(nTime)\
  50.    local nMinute = math.floor((nTime - nHour)*60)\
  51.    return nHour, nMinute\
  52. end\
  53. \
  54. local drawDots = function()\
  55. \009while true do\
  56. \009\009image.draw(xCenter,yCenter-3,'/System/clocks/'..digits[11])\
  57. \009\009sleep(0.5)\
  58. \009\009paintutils.drawFilledBox(xCenter,yCenter-3,xCenter+1,yCenter+3,style)\
  59. \009\009sleep(0.5)\
  60. \009end\
  61. end\
  62. \
  63. local globalClock = function(time)\
  64. \009while true do\
  65. \009\009local globalTime = os.time()\
  66. \009\009local hour, minute = formatTime(globalTime)\
  67. \009\009paintutils.drawFilledBox(xCenter-10,yCenter-3,xCenter-1,yCenter+3,style)\
  68. \009\009paintutils.drawFilledBox(xCenter+3,yCenter-3,xCenter+11,yCenter+3,style)\
  69. \009\009image.draw(xCenter-10,yCenter-3,'/System/clocks/'..digits[math.floor(hour/10)+1])\
  70. \009\009image.draw(xCenter-5,yCenter-3,'/System/clocks/'..digits[math.floor(hour%10)+1])\
  71. \009\009image.draw(xCenter+3,yCenter-3,'/System/clocks/'..digits[math.floor(minute/10)+1])\
  72. \009\009image.draw(xCenter+8,yCenter-3,'/System/clocks/'..digits[math.floor(minute%10)+1])\
  73. \009\009sleep(1)\
  74. \009end\
  75. end\
  76. \
  77. local function redraw()\
  78. clear(style)\
  79. sysBar()\
  80. end\
  81. \
  82. local function touch()\
  83. while true do\
  84.  --clock()\
  85.  event, side, x, y = os.pullEvent()\
  86.  if event == \"mouse_click\" then\
  87.   if sysbar.back(x,y) then\
  88.    break\
  89.   elseif sysbar.home(x,y) then\
  90.    home = true\
  91.    break\
  92.   end\
  93.  end\
  94. end\
  95. end\
  96. \
  97. redraw()\
  98. parallel.waitForAny(globalClock,touch,drawDots)\
  99. clear(colors.black)",
  100.     path = "//.ds/sys/Clock.apk/main",
  101.   },
  102.   {
  103.     text = "\\80 80|80|80 70/80\
  104. -80_f0_f0/f0 70-80\
  105. -80 00 70 70 70-80\
  106. /80 00|80|80 00\\80",
  107.     path = "//.ds/sys/Clock.apk/Resources/icon.png",
  108.   },
  109.   {
  110.     text = "shell.run(\"/System/prog/settings\")",
  111.     path = "//.ds/sys/Settings.apk/main",
  112.   },
  113.   {
  114.     text = "[80O80-80-80-80]80\
  115. [80-80-80-80O80]80\
  116. [80-80O80-80-80]80\
  117. C80o80n80f80i80g80",
  118.     path = "//.ds/sys/Settings.apk/Resources/icon.png",
  119.   },
  120.   {
  121.     text = "os.loadAPI(\"/System/API/image\")\
  122. os.loadAPI(\"/System/API/windows\")\
  123. os.loadAPI(\"/System/API/zip\")\
  124. local run = true\
  125. local xSize, ySize = term.getSize()\
  126. local obj = {}\
  127. local screen = 1\
  128. local maxScreen = 5\
  129. local instFolder = \"/.ds/\"..l_login..'/'\
  130. local objName = {}\
  131. local id = 0\
  132. local mods = \"\"\
  133. \
  134. local newObj = function(name,x1,y1,x2,y2)\
  135. obj[name] = {}\
  136. obj[name][\"x1\"] = x1\
  137. obj[name][\"y1\"] = y1\
  138. obj[name][\"x2\"] = x2\
  139. obj[name][\"y2\"] = y2\
  140. end\
  141. \
  142. local pastebin = function(paste,filename)\
  143. local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
  144. if file then\
  145.  file = file.readAll()\
  146.  h=fs.open(filename,\"w\")\
  147.  h.write(file)\
  148.  h.close()\
  149. else\
  150.  windows.error(\"Failed to connect to pastebin.com\")\
  151. end\
  152. end\
  153. \
  154. local clear = function(color)\
  155. term.setBackgroundColor(color)\
  156. term.clear()\
  157. term.setCursorPos(1,1)\
  158. end\
  159. \
  160. local usualText = function(string,xPos,yPos)\
  161. term.setCursorPos(xPos,yPos)\
  162. term.write(string)\
  163. end\
  164. \
  165. \
  166. local sysBar = function()\
  167. local time = textutils.formatTime(os.time(),true)\
  168. term.setTextColor(colors.lightGray)\
  169. term.setBackgroundColor(colors.white)\
  170. usualText(\"Store@\",1,1)\
  171. sysbar.draw(colors.white,colors.black,noty,true,false)\
  172. paintutils.drawLine(xSize,1,xSize,ySize,colors.gray)\
  173. paintutils.drawLine(xSize,(ySize/maxScreen*screen)-(ySize/maxScreen)+1,xSize,ySize/maxScreen*screen,colors.white)\
  174. term.setTextColor(colors.gray)\
  175. usualText(screen,xSize,(ySize/maxScreen*screen)-(ySize/maxScreen)+1)\
  176. end\
  177. \
  178. local app = function(name,x,y,info,by)\
  179. image.draw(x,y,\"/store-icons/\"..name..\".png\")\
  180. term.setBackgroundColor(colors.white)\
  181. term.setTextColor(colors.lime)\
  182. usualText(name,x+7,y)\
  183. term.setBackgroundColor(colors.white)\
  184. term.setTextColor(colors.black)\
  185. usualText(info,x+7,y+1)\
  186. term.setTextColor(colors.lightGray)\
  187. term.setBackgroundColor(colors.white)\
  188. usualText(\"By \",x+7,y+2)\
  189. term.write(by)\
  190. mods = \" Install \"\
  191. term.setTextColor(colors.white)\
  192. term.setBackgroundColor(colors.lime)\
  193. local files = fs.list(instFolder)\
  194. for i=1,#files do \
  195.  if files[i] == name..\".apk\" then\
  196.   mods=\" Update \"\
  197.   term.setTextColor(colors.lime)\
  198.   term.setBackgroundColor(colors.white)\
  199.  end\
  200. end\
  201. if name == 'Store@' then \
  202.  term.setTextColor(colors.lime)\
  203.  term.setBackgroundColor(colors.white)\
  204.  mods = ' Update '\
  205. end\
  206. usualText(mods,xSize-1-#mods,y+3)\
  207. newObj(name,xSize-1-#mods,y+3,xSize-2,y+3)\
  208. newObj(name..\".inf\",2,y,xSize-2,y+2)\
  209. id=id+1\
  210. objName[id] = name\
  211. end\
  212. \
  213. local delObj = function()\
  214. for i=1,(screen-1)*3 do\
  215.  obj[objName[i]][\"x1\"]=-1\
  216.  obj[objName[i]][\"y1\"]=-1\
  217.  obj[objName[i]][\"x2\"]=-1\
  218.  obj[objName[i]][\"y2\"]=-1\
  219. end\
  220. end\
  221. \
  222. local appinfo = function(name,by)\
  223. clear(colors.white)\
  224. sysBar()\
  225. image.draw(2,3,\"/store-icons/\"..name..\".png\")\
  226. term.setBackgroundColor(colors.white)\
  227. term.setTextColor(colors.lime)\
  228. usualText(name,9,3)\
  229. term.setTextColor(colors.lightGray)\
  230. usualText(\"By: \",9,4)\
  231. term.write(by)\
  232. mods = \" Install \"\
  233. term.setTextColor(colors.white)\
  234. term.setBackgroundColor(colors.lime)\
  235. local files = fs.list(instFolder)\
  236. for i=1,#files do \
  237.  if files[i] == name..\".apk\" then\
  238.   mods=\" Update \"\
  239.   term.setTextColor(colors.lime)\
  240.   term.setBackgroundColor(colors.white)\
  241.  end\
  242. end\
  243. usualText(mods,xSize-1-#mods,6)\
  244. newObj(name..\".inf\",xSize-1-#mods,5,xSize-2,5)\
  245. id=id+1\
  246. objName[id] = name..\".inf\"\
  247. end\
  248. \
  249. local redraw = function()\
  250. clear(colors.white)\
  251. sysBar()\
  252. if screen == 1 then\
  253.  id = 0\
  254.  delObj()\
  255.  app(\"Store@\",2,3,\"Apps Store\",\"-DECE-\")\
  256.  app(\"ImageViewer\",2,9,\"Image browser\",\"-DECE-\")\
  257.  app(\"FileBrowser\",2,15,\"File manager\",\"-DECE-\")\
  258. elseif screen == 2 then\
  259.  delObj()\
  260.  app(\"Photoshop\",2,3,\"Image editor\",\"ECS\")\
  261.  app(\"Ink\",2,9,\"Text editor\",\"OEED\",\" Install \")\
  262.  app(\"QuickShell\",2,15,\"Shell\",\"OEED\",\" Install \")\
  263. elseif screen == 3 then\
  264.  delObj()\
  265.  app(\"Maze3D\",2,3,\"3D game\",\"JESUSTHEKILLER\")\
  266.  app(\"NanoMaze\",2,9,\"Mazes in CC\",\"JESUSTHEKILLER\")\
  267.  app(\"Minesweeper\",2,15,\"Game\",\"GopherAtl\")\
  268. elseif screen == 4 then\
  269.  delObj()\
  270.  app(\"FlappyPixel\",2,3,\"Game\",\"Creator\")\
  271.  app(\"gtRemote\",2,9,\"Remote turtle\",\"Dog\")\
  272.  app(\"Udo\",2,15,\"Pocket Todo List\",\"Zambonie\")\
  273. elseif screen == 5 then\
  274.  delObj()\
  275.  app(\"PackageInstaller\",2,3,\"For custom apps\",\"-DECE-\")\
  276.  app(\"Backup\",2,9,\"Backup and restore\",\"-DECE-\")\
  277. end\
  278. end\
  279. \
  280. local inst = function(name,code,path)\
  281. shell.run(\"rm \"..path..name..\".apk\")\
  282. clear(colors.white)\
  283. term.setTextColor(colors.black)\
  284. usualText(\"Installing \"..name,2,ySize-6)\
  285. usualText(\"Please wait...\",2,ySize-5)\
  286. paintutils.drawLine(2,ySize-2,xSize-1,ySize-2,colors.lightGray)\
  287. paintutils.drawLine(2,ySize-2,2,ySize-2,colors.lime)\
  288. pastebin(code,path..name..\".apk/main\")\
  289. paintutils.drawLine(3,ySize-2,3+5,ySize-2,colors.lime)\
  290. shell.run(\"mkdir \"..path..name..\".apk/Resources\")\
  291. paintutils.drawLine(9,ySize-2,8+5,ySize-2,colors.lime)\
  292. sleep(0.5)\
  293. shell.run(\"copy /store-icons/\"..name..\".png \"..path..name..\".apk/Resources\")\
  294. paintutils.drawLine(14,ySize-2,14+5,ySize-2,colors.lime)\
  295. sleep(0.5)\
  296. shell.run(\"rename \"..path..name..\".apk/Resources/\"..name..\".png \"..path..name..\".apk/Resources/icon.png\")\
  297. paintutils.drawLine(20,ySize-2,25,ySize-2,colors.lime)\
  298. sleep(0.5)\
  299. clear(colors.white)\
  300. if noty ~= nil then\
  301.  noty[#noty+1]={[\"app\"]=name, [\"text\"]=name..\" installed\", [\"button\"]=\" Launch \", [\"ico\"]=string.char(25)}\
  302. else\
  303.  noty[1]={[\"app\"]=name, [\"text\"]=name..\" installed\", [\"button\"]=\" Launch \", [\"ico\"]=string.char(25)}\
  304. end\
  305. redraw()\
  306. end\
  307. \
  308. local running = function()\
  309. while run == true and l_login ~= '...' and l_login ~= nil and l_login ~= '' do\
  310.  event, side, x, y = os.pullEvent()\
  311. \
  312.  if event == \"mouse_scroll\" then\
  313.   if side == 1 then\
  314.    screen = screen+1\
  315.    if screen > maxScreen then\
  316.     screen = maxScreen\
  317.    else\
  318.     clear(colors.white)\
  319.     redraw()\
  320.    end\
  321.   elseif side == -1 then\
  322.    screen = screen-1\
  323.    if screen < 1 then\
  324.     screen = 1\
  325.    else\
  326.     clear(colors.white)\
  327.     redraw()\
  328.    end\
  329.   end\
  330.   \
  331.  elseif event == \"key\" then\
  332.   if side == 208 then\
  333.    screen = screen+1\
  334.    if screen > maxScreen then\
  335.     screen = maxScreen\
  336.    else\
  337.     clear(colors.white)\
  338.     redraw()\
  339.    end\
  340.   elseif side == 200 then\
  341.    screen = screen-1\
  342.    if screen < 1 then\
  343.     screen = 1\
  344.    else\
  345.     clear(colors.white)\
  346.     redraw()\
  347.    end\
  348.   end\
  349. \
  350.  elseif event == \"mouse_click\" then\
  351.   if sysbar.back(x,y) == true then\
  352.    term.clear()\
  353.    term.setCursorPos(1,1)\
  354.    run = false \
  355.   elseif sysbar.home(x,y) == true then\
  356.    term.clear()\
  357.    term.setCursorPos(1,1)\
  358. \009home = true\
  359.    run = false\
  360.   end\
  361.   if screen == 1 then\
  362.    if x>=obj[\"Store@\"][\"x1\"] and x<=obj[\"Store@\"][\"x2\"] and y>=obj[\"Store@\"][\"y1\"] and y<=obj[\"Store@\"][\"y2\"] and screen==1 then\
  363.     inst(\"Store@\",\"g8LMzmxa\",'/.ds/sys/')\
  364. \009 run = false\
  365. \009 break\
  366.    elseif x>=obj[\"ImageViewer\"][\"x1\"] and x<=obj[\"ImageViewer\"][\"x2\"] and y>=obj[\"ImageViewer\"][\"y1\"] and y<=obj[\"ImageViewer\"][\"y2\"] then\
  367.     inst(\"ImageViewer\",\"tYNEKygi\",instFolder)\
  368.    elseif x>=obj[\"FileBrowser\"][\"x1\"] and x<=obj[\"FileBrowser\"][\"x2\"] and y>=obj[\"FileBrowser\"][\"y1\"] and y<=obj[\"FileBrowser\"][\"y2\"] then\
  369.     inst(\"FileBrowser\",\"2Xms362b\",instFolder)\
  370.     pastebin(\"daqgga1q\",\"/icons.zip\")\
  371.     zip.unarchive('/icons.zip','/')\
  372.     shell.run('rm /icons.zip')\
  373.     pastebin(\"pDdRdBkj\",\"/.ds/\"..l_login..\"/FileBrowser.apk/Resources/reader\")\
  374.    end\
  375.   elseif screen == 2 then\
  376.    if x>=obj[\"QuickShell\"][\"x1\"] and x<=obj[\"QuickShell\"][\"x2\"] and y>=obj[\"QuickShell\"][\"y1\"] and y<=obj[\"QuickShell\"][\"y2\"] then\
  377.     inst(\"QuickShell\",\"wwVmBJax\",instFolder)\
  378.    elseif x>=obj[\"Ink\"][\"x1\"] and x<=obj[\"Ink\"][\"x2\"] and y>=obj[\"Ink\"][\"y1\"] and y<=obj[\"Ink\"][\"y2\"] then\
  379.     inst(\"Ink\",\"JxzXPv03\",instFolder)\
  380.    elseif x>=obj[\"Photoshop\"][\"x1\"] and x<=obj[\"Photoshop\"][\"x2\"] and y>=obj[\"Photoshop\"][\"y1\"] and y<=obj[\"Photoshop\"][\"y2\"] then\
  381.     inst(\"Photoshop\",\"tK3FSmf2\",instFolder)\
  382.    elseif x>=obj[\"Photoshop.inf\"][\"x1\"] and x<=obj[\"Photoshop.inf\"][\"x2\"] and y>=obj[\"Photoshop.inf\"][\"y1\"] and y<=obj[\"Photoshop.inf\"][\"y2\"] then\
  383.     appinfo(\"Photoshop\", \"ECS\")\
  384.    end\
  385.   elseif screen == 3 then\
  386.    if x>=obj[\"Maze3D\"][\"x1\"] and x<=obj[\"Maze3D\"][\"x2\"] and y>=obj[\"Maze3D\"][\"y1\"] and y<=obj[\"Maze3D\"][\"y2\"] then\
  387.     inst(\"Maze3D\",\"i7VkRaf6\",instFolder)\
  388.    elseif x>=obj[\"NanoMaze\"][\"x1\"] and x<=obj[\"NanoMaze\"][\"x2\"] and y>=obj[\"NanoMaze\"][\"y1\"] and y<=obj[\"NanoMaze\"][\"y2\"] then\
  389.     inst(\"NanoMaze\",\"m6WFB8D3\",instFolder)\
  390.    elseif x>=obj[\"Minesweeper\"][\"x1\"] and x<=obj[\"Minesweeper\"][\"x2\"] and y>=obj[\"Minesweeper\"][\"y1\"] and y<=obj[\"Minesweeper\"][\"y2\"] then\
  391.     inst(\"Minesweeper\",\"nsKrHTbN\",instFolder)\
  392.    end\
  393.   elseif screen == 4 then\
  394.    if x>=obj[\"FlappyPixel\"][\"x1\"] and x<=obj[\"FlappyPixel\"][\"x2\"] and y>=obj[\"FlappyPixel\"][\"y1\"] and y<=obj[\"FlappyPixel\"][\"y2\"] then\
  395.     inst(\"FlappyPixel\",\"4kqJKA42\",instFolder)\
  396.    elseif x>=obj[\"gtRemote\"][\"x1\"] and x<=obj[\"gtRemote\"][\"x2\"] and y>=obj[\"gtRemote\"][\"y1\"] and y<=obj[\"gtRemote\"][\"y2\"] then\
  397.     inst(\"gtRemote\",\"Cz31MiDJ\",instFolder)\
  398.     pastebin(\"XQQsRyLX\",\"/.ds/\"..l_login..\"/gtRemote.apk/Resources/app\")\
  399.    elseif x>=obj[\"Udo\"][\"x1\"] and x<=obj[\"Udo\"][\"x2\"] and y>=obj[\"Udo\"][\"y1\"] and y<=obj[\"Udo\"][\"y2\"] then\
  400.     inst(\"Udo\",\"LKguNrXk\",instFolder)\
  401.    end\
  402.   elseif screen == 5 then\
  403.    if x>=obj[\"PackageInstaller\"][\"x1\"] and x<=obj[\"PackageInstaller\"][\"x2\"] and y>=obj[\"PackageInstaller\"][\"y1\"] and y<=obj[\"PackageInstaller\"][\"y2\"] then\
  404.     inst(\"PackageInstaller\",\"vVeK5iuD\",instFolder)\
  405.    elseif x>=obj[\"Backup\"][\"x1\"] and x<=obj[\"Backup\"][\"x2\"] and y>=obj[\"Backup\"][\"y1\"] and y<=obj[\"Backup\"][\"y2\"] then\
  406.     inst(\"Backup\",\"U6nc5vK1\",instFolder)\
  407.    end\
  408. --   else\
  409. --    redraw()\
  410.   end\
  411.  end\
  412. end\
  413. end\
  414. \
  415. local start = function()\
  416. redraw()\
  417. running()\
  418. end\
  419. \
  420. local fadeX = function()\
  421. clear(colors.gray)\
  422. sleep(0.05)\
  423. clear(colors.lightGray)\
  424. sleep(0.05)\
  425. clear(colors.white)\
  426. end\
  427. \
  428. fadeX()\
  429. term.setTextColor(colors.black)\
  430. usualText(\"Loading...\",xSize-10,19)\
  431. pastebin(\"YAjRjaJM\",\"/store-icons.zip\")\
  432. zip.unarchive(\"/store-icons.zip\",\"/\")\
  433. if l_login == '...' or l_login == nil or l_login == '' then\
  434. \009pastebin(\"AH3k8DMa\",\"ver\")\
  435. \009shell.run('ver')\
  436. end\
  437. start()\
  438. fadeX()\
  439. shell.run(\"rm /store-icons\")\
  440. shell.run(\"rm /store-icons.zip\")\
  441. clear(colors.black)",
  442.     path = "//.ds/sys/Store@.apk/main",
  443.   },
  444.   {
  445.     text = "###=70=70=70=70###\
  446. _70_70_70_70_70_70\
  447. Se0t10o50r30eb0@a0\
  448. -70-70-70-70-70-70",
  449.     path = "//.ds/sys/Store@.apk/Resources/icon.png",
  450.   },
  451.   {
  452.     text = "mainColor = colors.lightGray\
  453. mainTextCol = colors.gray\
  454. mainSwitchCol = colors.lightBlue\
  455. \
  456. os.loadAPI(\"/System/API/image\")\
  457. os.loadAPI(\"/System/API/windows\")\
  458. os.loadAPI(\"/System/API/zip\")\
  459. os.loadAPI(\"/System/API/sysbar\")\
  460. os.loadAPI(\"/System/API/contexts\")\
  461. \
  462. osLogo = '| '..string.char(7)..' ^ '..string.char(7)..' |'\
  463. osName = 'VedroidOS'\
  464. osexit = false\
  465. home = false\
  466. wallp = false\
  467. local xSize, ySize = term.getSize()\
  468. local centerX = math.floor(xSize/2)\
  469. local centerY = math.floor(ySize/2)\
  470. local comp = 0\
  471. if xSize > 30 then comp = 1 end\
  472. appHistory = {}\
  473. version = \"5.5.5\"\
  474. noty = {}\
  475. wifi = \"off\"\
  476. log = false\
  477. local appH = {}\
  478. local aph = \"0\"\
  479. local run = true\
  480. local obj = {}\
  481. local screen = 1\
  482. local maxScreen = 1\
  483. local deskS = 1\
  484. local maxDeskS = 1\
  485. local topM = \"0\"\
  486. local background = colors.lightBlue\
  487. local xp = 3\
  488. local yp = 3 - comp\
  489. local wallpapers = \"wallp.png\"\
  490. local notyPos = 1\
  491. local set = false\
  492. if style == nil then style = colors.lightBlue end\
  493. if colored == nil then colored = false end\
  494. local files = {}\
  495. local Napp = 0\
  496. local appMenu = false\
  497. local desk = {}\
  498. local editMode = false\
  499. local sear = nil\
  500. local addMode = false\
  501. local adds = 0\
  502. local draw = true\
  503. \
  504. function getColors()\
  505. \009return mainColor, mainTextCol, mainSwitchCol\
  506. end\
  507. \
  508. function os.run( _tEnv, _sPath, ... )\
  509.    local tArgs = { ... }\
  510.    local tEnv = _tEnv\
  511.    setmetatable( tEnv, { __index = _G } )\
  512.    local fnFile, err = loadfile( _sPath, tEnv )\
  513.    if fnFile then\
  514.        local ok, err = pcall( function()\
  515.            fnFile( table.unpack( tArgs ) )\
  516.        end )\
  517.        if not ok then\
  518.            if err and err ~= \"\" then\
  519.                printError( err )\
  520.            end\
  521.            return err\
  522.        end\
  523.        return nil\
  524.    end\
  525.    if err and err ~= \"\" then\
  526.        printError( err )\
  527.    end\
  528.    return err\
  529. end\
  530. \
  531. local function refreshFiles()\
  532. \009local sys = fs.list('/.ds/sys')\
  533. \009local filis = {}\
  534. \009for i=1,#sys do\
  535. \009\009filis[i] = 'sys/'..sys[i]\
  536. \009end\
  537. \009if l_login ~= '...' and l_login~='$test' then\
  538. \009\009local file = fs.list('/.ds/'..l_login)\
  539. \009\009if file ~= nil then\
  540. \009\009\009for i=#sys+1,#file+#sys do\
  541. \009\009\009\009filis[i] = l_login..'/'..file[i-#sys]\
  542. \009\009\009end\
  543. \009\009end\
  544. \009end\
  545. \009return filis\
  546. end\
  547. \
  548. local function saveDesk(table)\
  549. \009local file = fs.open('/System/desks/'..l_login,\"w\")\
  550. \009file.write(textutils.serialize(table))\
  551. \009file.close()\
  552. end\
  553. \
  554. local function refreshDesk()\
  555. \009local function load(name)\
  556. \009\009local file = fs.open(name,\"r\")\
  557. \009\009local data = file.readAll()\
  558. \009\009file.close()\
  559. \009\009return textutils.unserialize(data)\
  560. \009end\
  561. \009desk = load('/System/desks/'..l_login)\
  562. \009if editMode == false then\
  563. \009\009maxDeskS = #desk\
  564. \009end\
  565. end\
  566. \
  567. local newObj = function(name,x1,y1,x2,y2)\
  568. obj[name] = {}\
  569. obj[name][\"x1\"] = x1\
  570. obj[name][\"y1\"] = y1\
  571. obj[name][\"x2\"] = x2\
  572. obj[name][\"y2\"] = y2\
  573. end\
  574. \
  575. local pastebin = function(paste,filename)\
  576. \009local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
  577. \009if file then\
  578. \009\009file = file.readAll()\
  579. \009\009h=fs.open(filename,\"w\")\
  580. \009\009h.write(file)\
  581. \009\009h.close()\
  582. \009\009return true\
  583. \009else\
  584. \009\009windows.error(\"Unable to connect to the Internet\")\
  585. \009\009return false\
  586. \009end\
  587. end\
  588. \
  589. local clear = function(color)\
  590. \009term.setBackgroundColor(color)\
  591. \009term.clear()\
  592. \009term.setCursorPos(1,1)\
  593. end\
  594. \
  595. local usualText = function(string,xPos,yPos)\
  596. \009term.setCursorPos(xPos,yPos)\
  597. \009term.write(string)\
  598. end\
  599. \
  600. local fadeX = function()\
  601. clear(colors.gray)\
  602. sleep(0.05)\
  603. clear(colors.lightGray)\
  604. sleep(0.05)\
  605. clear(colors.lightBlue)\
  606. sleep(0.05)\
  607. end\
  608. \
  609. local drawBox = function(x1,y1,x2,y2,color1,color2,text)\
  610. \009term.setTextColor(color2)\
  611. \009term.setBackgroundColor(color1)\
  612. \009if text == nil then\
  613. \009\009text = \" \"\
  614. \009end\
  615. \009for i=x1, x2 do\
  616. \009\009for ii=y1, y2 do\
  617. \009\009\009usualText(text,i,ii)\
  618. \009\009end\
  619. \009end\
  620. end\
  621. \
  622. local app = function(name,ico,x,y)\
  623. \009image.draw(x,y,ico,6,4)\
  624. \009newObj(name,x,y,x+5,y+3)\
  625. end \
  626. \
  627. local drawn = function(app,text,button,y)\
  628. \009for i=0,3 do\
  629. \009\009paintutils.drawLine(xSize-25,y+i,xSize,y+i,colors.lightGray)\
  630. \009end\
  631. \009if app == 'Settings' or app == 'Store@' then \
  632. \009 image.draw(xSize-25,y,\"/.ds/sys/\"..app..\".apk/Resources/icon.png\",6,4)\
  633. \009else\
  634. \009 image.draw(xSize-25,y,\"/.ds/\"..l_login..'/'..app..\".apk/Resources/icon.png\",6,4)\
  635. \009end\
  636. \009term.setBackgroundColor(colors.lightGray)\
  637. \009term.setTextColor(colors.gray)\
  638. \009usualText(\"x\",xSize,y)\
  639. \009usualText(button,xSize-#button+1, y+3)\
  640. \009term.setTextColor(colors.white)\
  641. \009usualText(text,xSize-26+8,y+1)\
  642. \009newObj(app,xSize,y,xSize,y)\
  643. end\
  644. \
  645. local getStyle = function()\
  646. shell.run(\"style\")\
  647. end\
  648. \
  649. local shutAnimation = function()\
  650. \009fadeX()\
  651. \009clear(colors.white)\
  652. \009term.setTextColor(colors.lime)\
  653. \009usualText(osLogo,centerX-math.floor(#osLogo/2),centerY+1)\
  654. \009sleep(0.3)\
  655. \009usualText(osLogo,centerX-math.floor(#osLogo/2)-3,centerY+1)\
  656. \009term.setTextColor(colors.lightGray)\
  657. \009usualText('Goodbye',centerX-math.floor(#osLogo/2)+6,centerY+1)\
  658. \009sleep(0.5)\
  659. end\
  660. \
  661. local nativeReboot = os.reboot\
  662. os.reboot = function()\
  663. \009shutAnimation()\
  664. \009nativeReboot()\
  665. \009while true do\
  666.        coroutine.yield()\
  667.    end\
  668. end\
  669. \
  670. local nativeShutdown = os.shutdown\
  671. os.shutdown = function()\
  672. \009shutAnimation()\
  673. \009nativeShutdown()\
  674.    while true do\
  675.        coroutine.yield()\
  676.    end\
  677. end\
  678. \
  679. local topMenu = function()\
  680. \009local time = textutils.formatTime(os.time(),true)\
  681. \009files = refreshFiles()\
  682. \009for i=1,#files do\
  683. \009\009newObj(files[i],-1,-1,-1,-1)\
  684. \009end\
  685. \009if comp == 0 then\
  686. \009\009if noty ~= nil then\
  687. \009\009\009for i=1,#noty do\
  688. \009\009\009\009drawn(noty[i][\"app\"],noty[i][\"text\"],noty[i][\"button\"],4*i+notyPos)\
  689. \009\009\009end\
  690. \009\009end\
  691. \009\009paintutils.drawLine(0,2,xSize,2,colors.gray)\
  692. \009\009term.setTextColor(colors.lightGray)\
  693. \009\009for i=1,4 do\
  694. \009\009\009paintutils.drawLine(0,i,xSize,i,colors.gray)\
  695. \009\009\009term.setTextColor(colors.white)\
  696. \009\009end\
  697. \009\009usualText(time,xSize-#time,1)\
  698. \009\009usualText(\"Settings\",2,3)\
  699. \009\009term.setTextColor(colors.lightGray)\
  700. \009\009usualText(string.char(31),11,3)\
  701. \009\009usualText(l_login,xSize-#l_login,3)\
  702. \009\009term.setTextColor(colors.white)\
  703. \009\009paintutils.drawLine(0,ySize,xSize,ySize,style)\
  704. \009\009usualText(\"^^\",xSize/2,ySize)\
  705. \009\009if #noty ~= 0 then\
  706. \009\009\009usualText(\"Clear\",xSize-4,ySize)\
  707. \009\009end\
  708. \009\009newObj(\"sett\",2,3,9,3)\
  709. \009\009if set==true then\
  710. \009\009\009for I=4,11 do\
  711. \009\009\009\009paintutils.drawLine(1,I,11,I,colors.white)\
  712. \009\009\009end\
  713. \009\009\009term.setTextColor(colors.gray)\
  714. \009\009\009usualText(\" \"..string.char(30),10,3)\
  715. \009\009\009usualText(\"Apps\",2,5)\
  716. \009\009\009usualText(\"Customize\",2,6)\
  717. \009\009\009usualText(\"Security\",2,7)\
  718. \009\009\009usualText(\"Storage\",2,8)\
  719. \009\009\009usualText(\"Update\",2,9)\
  720. \009\009\009usualText(\"About\",2,10)\
  721. \009\009end\
  722. \009else\
  723. \009\009if noty ~= nil then\
  724. \009\009\009for i=1,#noty do\
  725. \009\009\009\009drawn(noty[i][\"app\"],noty[i][\"text\"],noty[i][\"button\"],ySize-4*i-notyPos-1)\
  726. \009\009\009end\
  727. \009\009end\
  728. \009\009term.setTextColor(colors.lightGray)\
  729. \009\009for i=0,2 do\
  730. \009\009\009paintutils.drawLine(xSize-25,ySize-i,xSize,ySize-i,colors.gray)\
  731. \009\009end\
  732. \009\009term.setTextColor(colors.white)\
  733. \009\009usualText(time,xSize-#time-1,ySize)\
  734. \009\009usualText(\"Settings\",xSize-24,ySize-1)\
  735. \009\009term.setTextColor(colors.lightGray)\
  736. \009\009usualText(string.char(30),xSize-15,ySize-1)\
  737. \009\009usualText(l_login,xSize-#l_login,ySize-1)\
  738. \009\009newObj(\"sett\",xSize-24,ySize-1,xSize-17,ySize-1)\
  739. \009\009if set==true then\
  740. \009\009\009for I=2,9 do\
  741. \009\009\009\009paintutils.drawLine(xSize-25,ySize-I,xSize-15,ySize-I,colors.white)\
  742. \009\009\009end\
  743. \009\009\009term.setTextColor(colors.gray)\
  744. \009\009\009usualText(\" \"..string.char(31),xSize-16,ySize-1)\
  745. \009\009\009usualText(\"Apps\",xSize-24,ySize-8)\
  746. \009\009\009usualText(\"Customize\",xSize-24,ySize-7)\
  747. \009\009\009usualText(\"Security\",xSize-24,ySize-6)\
  748. \009\009\009usualText(\"Storage\",xSize-24,ySize-5)\
  749. \009\009\009usualText(\"Update\",xSize-24,ySize-4)\
  750. \009\009\009usualText(\"About\",xSize-24,ySize-3)\
  751. \009\009end\
  752. \009end\
  753. end\
  754. \
  755. local sysBar = function()\
  756. \009while true do\
  757. \009\009local noti = #noty\
  758. \009\009if draw and topM == \"0\" then\
  759. \009\009\009sysbar.draw(style,colors.white,noty,false,true)\
  760. \009\009end\
  761. \009\009if topM == \"1\" then\
  762. \009\009\009term.setTextColor(colors.white)\
  763. \009\009\009term.setBackgroundColor(colors.gray)\
  764. \009\009\009local time = textutils.formatTime(os.time(),true)\
  765. \009\009\009if comp == 0 then\
  766. \009\009\009\009usualText(time,xSize-#time,1)\
  767. \009\009\009else\
  768. \009\009\009\009usualText(time,xSize-#time-1,ySize)\
  769. \009\009\009end\
  770. \009\009end\
  771. \009\009sleep(1)\
  772. \009\009if noti < #noty then\
  773. \009\009\009local b = term.current()\
  774. \009\009\009local n = window.create(term.current(),xSize-25,1+(ySize-6)*comp+comp,26,4)\
  775. \009\009\009term.redirect(n)\
  776. \009\009\009clear(colors.lightGray)\
  777. \009\009\009if noty[#noty][\"app\"] == 'Settings' or noty[#noty][\"app\"] == 'Store@' then \
  778. \009\009\009\009image.draw(11,1,\"/.ds/sys/\"..noty[#noty][\"app\"]..\".apk/Resources/icon.png\",6,4)\
  779. \009\009\009else\
  780. \009\009\009\009image.draw(1,1,\"/.ds/\"..l_login..'/'..noty[#noty][\"app\"]..\".apk/Resources/icon.png\",6,4)\
  781. \009\009\009end\
  782. \009\009\009term.setBackgroundColor(colors.lightGray)\
  783. \009\009\009term.setTextColor(colors.white)\
  784. \009\009\009usualText(noty[#noty][\"text\"],8,2)\
  785. \009\009\009newObj(noty[#noty][\"app\"],25,1,25,1)\
  786. \009\009\009term.redirect(b)\
  787. \009\009\009sleep(1)\
  788. \009\009\009n.setVisible(false)\
  789. \009\009\009n.redraw()\
  790. \009\009\009n = nil\
  791. \009\009end\
  792. \009end\
  793. end\
  794. \
  795. local appHis = function()\
  796. clear(style)\
  797. sysBar()\
  798. if appHistory == {} then usualText(\"No recent apps\",xCenter-7,yCenter) end\
  799. usualText(\"App History\",1,1)\
  800. files = refreshFiles()\
  801.  for i=1,#files do\
  802.   newObj(files[i],-1,-1,-1,-1)\
  803.  end\
  804. term.setTextColor(colors.black)\
  805. term.setBackgroundColor(colors.white)\
  806. for i=1,#appHistory do\
  807.  if appHistory[i] == appHistory[i+1] then\
  808.   for ii=i,#appHistory do\
  809.    appHistory[ii] = appHistory[ii+1]\
  810.   end\
  811.  end\
  812. end\
  813. for i=1,#appHistory do\
  814.  paintutils.drawLine(1,i*2+1,xSize,i*2+1,colors.white)\
  815.  usualText(\"x\",xSize,i*2+1)\
  816.  usualText(appHistory[i],1,i*2+1)\
  817.  usualText(\"     \",#appHistory[i]-3,i*2+1)\
  818.  newObj(appHistory[i],1,i*2+1,#appHistory[i],i*2+1)\
  819. end\
  820. end\
  821. \
  822. local function redraw()\
  823. \009if l_login ~= '...' and (l_login == nil or l_login == '') then\
  824. \009\009pastebin(\"AH3k8DMa\",\"ver\")\
  825. \009\009shell.run('ver')\
  826. \009end\
  827. \009if colored == 1 then\
  828. \009\009mainColor = style\
  829. \009\009mainSwitchCol = style\
  830. \009\009mainTextCol = colors.white\
  831. \009else\
  832. \009\009mainColor = colors.lightGray\
  833. \009\009mainSwitchCol = colors.lightBlue\
  834. \009\009mainTextCol = colors.gray\
  835. \009end\
  836. \009set=false\
  837. \009clear(style)\
  838. \009wallp = false\
  839. \009local file = fs.list(\"/System\")\
  840. \009for i=1,#file do\
  841. \009\009if file[i] == wallpapers then\
  842. \009\009\009wallp = true\
  843. \009\009end\
  844. \009end\
  845. \009\009\
  846. \009if wallp then\
  847. \009\009image.draw(1,2-comp,\"/System/\"..wallpapers)\
  848. \009end\
  849. \009\
  850. \009newObj(\"sett\",-2,-2,-2,-2)\
  851. \009\
  852. \009if appMenu then\
  853. \009\
  854. \009\009paintutils.drawLine(3,2-comp,xSize-2,2-comp,colors.white)\
  855. \
  856. \009\009for i=1,maxScreen do\
  857. \009\009\009term.setTextColor(colors.lightGray)\
  858. \009\009\009usualText(string.char(7),xSize+i-maxScreen-4,2-comp)\
  859. \009\009\009term.setTextColor(style)\
  860. \009\009\009usualText(string.char(7),xSize+screen-maxScreen-4,2-comp) \
  861. \009\009end\
  862. \009\009usualText(string.char(30),xSize-2,2-comp)\
  863. \009\009\
  864. \009\009drawBox(3,3-comp,xSize-2,math.floor(ySize/(6-comp))*6-comp,colors.white,style,string.char(127))\
  865. \009\009if sear == nil then\
  866. \009\009\009files = refreshFiles()\
  867. \009\009end\
  868. \009\009maxScreen = 1 + math.floor(#files/(math.floor(xSize/8)*math.floor((ySize)/(6-comp))))\
  869. \009\009xp=3\
  870. \009\009yp=4 - comp\
  871. \009\009Napp = (screen-1)*(math.floor(xSize/8)*math.floor((ySize)/(6-comp)))+1\
  872. \
  873. \009\009for i=1,math.floor(ySize/(6-comp)) do\
  874. \009\009\009for ii=1,math.floor(xSize/(8)) do\
  875. \009\009\009\009if files[Napp] ~= nil then\
  876. \009\009\009\009\009if fs.exists(\"/.ds/\"..files[Napp]..\"/Resources/icon.png\") then\
  877. \009\009\009\009\009\009app(files[Napp],\"/.ds/\"..files[Napp]..\"/Resources/icon.png\",xp,yp)\
  878. \009\009\009\009\009else\
  879. \009\009\009\009\009\009app(files[Napp],\"/System/noico.png\",xp,yp)\
  880. \009\009\009\009\009end\
  881. \009\009\009\009\009if addMode == true then\
  882. \009\009\009\009\009\009usualText('+',xp,yp)\
  883. \009\009\009\009\009end\
  884. \009\009\009\009\009Napp = Napp + 1\
  885. \009\009\009\009\009xp = xp + 8\
  886. \009\009\009\009else\
  887. \009\009\009\009\009break\
  888. \009\009\009\009end\
  889. \009\009\009end\
  890. \009\009\009yp = yp + 5\
  891. \009\009\009xp = 3\
  892. \009\009end\
  893. \009else\
  894. \009\009addMode = false\
  895. \009\009adds = 0\
  896. \009\009sear = nil\
  897. \009\009if  l_login~='$test' then\
  898. \009\009\009refreshDesk()\
  899. \009\009\009if desk[deskS] ~= nil then\
  900. \009\009\009\009for i=1,#desk[deskS] do\
  901. \009\009\009\009\009if desk[deskS][i] ~= nil then\
  902. \009\009\009\009\009\009if fs.exists(\"/.ds/\"..desk[deskS][i]['name']..\"/Resources/icon.png\") then\
  903. \009\009\009\009\009\009\009app(desk[deskS][i]['name'],\"/.ds/\"..desk[deskS][i]['name']..\"/Resources/icon.png\",desk[deskS][i]['x'],desk[deskS][i]['y'])\
  904. \009\009\009\009\009\009else\
  905. \009\009\009\009\009\009\009if fs.exists(\"/.ds/\"..desk[deskS][i]['name']) then\
  906. \009\009\009\009\009\009\009\009app(desk[deskS][i]['name'],\"/System/noico.png\",desk[deskS][i]['x'],desk[deskS][i]['y'])\
  907. \009\009\009\009\009\009\009else\
  908. \009\009\009\009\009\009\009\009for ii=i,#desk[deskS]-1 do\
  909. \009\009\009\009\009\009\009\009\009desk[deskS][ii]=desk[deskS][ii+1]\
  910. \009\009\009\009\009\009\009\009end\
  911. \009\009\009\009\009\009\009\009desk[deskS][#desk[deskS]] = nil\
  912. \009\009\009\009\009\009\009\009saveDesk(desk)\
  913. \009\009\009\009\009\009\009\009refreshDesk()\
  914. \009\009\009\009\009\009\009\009redraw()\
  915. \009\009\009\009\009\009\009\009break\
  916. \009\009\009\009\009\009\009end\
  917. \009\009\009\009\009\009end\
  918. \009\009\009\009\009end\
  919. \009\009\009\009end\
  920. \009\009\009end\
  921. \009\009end\
  922. \009\009paintutils.drawLine(3,2-comp,xSize-2,2-comp,colors.white)\
  923. \009\009term.setTextColor(colors.lightGray)\
  924. \009\009usualText(string.char(31),xSize-2,2-comp)\
  925. \009\009for i=1,maxDeskS do\
  926. \009\009\009term.setTextColor(colors.lightGray)\
  927. \009\009\009usualText(string.char(7),xSize+i-maxDeskS-4,2-comp)\
  928. \009\009\009term.setTextColor(style)\
  929. \009\009\009usualText(string.char(7),xSize+deskS-maxDeskS-4,2-comp) \
  930. \009\009end\
  931. \009end\
  932. \009term.setTextColor(colors.lightGray)\
  933. \009term.setBackgroundColor(colors.white)\
  934. \009if editMode == false then\
  935. \009\009if sear then\
  936. \009\009\009usualText(sear,4,2-comp)\
  937. \009\009else\
  938. \009\009\009usualText('Search',4,2-comp)\
  939. \009\009end\
  940. \009else\
  941. \009\009usualText('Apply',4,2-comp)\
  942. \009\009usualText('+',xSize-2,2-comp)\
  943. \009\009term.setTextColor(colors.red)\
  944. \009\009if maxDeskS > 0 then\
  945. \009\009\009usualText('x',xSize-maxDeskS-5,2-comp)\
  946. \009\009end\
  947. \009\009if deskS > 1 then\
  948. \009\009\009drawBox(1,3-comp,1,ySize-2,style,colors.white,string.char(127))\
  949. \009\009end\
  950. \009\009drawBox(xSize,3-comp,xSize,ySize-2,style,colors.white,string.char(127))\
  951. \009end\
  952. end\
  953. \
  954. function runApp(app)\
  955. \009local error = shell.run(app)\
  956. \009term.redirect(term.native())\
  957. \009if error ~= nil then\
  958. \009\009redraw()\
  959. \009\009windows.error(error)\
  960. \009end\
  961. end\
  962. \
  963. os.pullEvent = function()\
  964. \009local event, side, x, y = os.pullEventRaw()\
  965. \009if event ~= \"terminate\" then\
  966. \009\009return event, side, x, y\
  967. \009end\
  968. end\
  969. \
  970. local running = function()\
  971. while run == true and osexit == false do\
  972.  if home == true then\
  973.   home = false\
  974.  end\
  975.  \
  976.  if l_login ~= '...' and (l_login == nil or l_login == '') then\
  977. \009pastebin(\"AH3k8DMa\",\"ver\")\
  978. \009shell.run('ver')\
  979.  end\
  980.  \
  981.  event, side, x, y = os.pullEvent()\
  982.  \
  983.  if event == \"mouse_scroll\" then\
  984.   if side == 1 then\
  985.    if topM==\"0\" then\
  986.     if appMenu == true then\
  987.      screen = screen+1\
  988.      if screen > maxScreen then\
  989.       screen = maxScreen\
  990.      else\
  991.       clear(colors.lightBlue)\
  992.       redraw()\
  993.      end\
  994. \009 else\
  995. \009  deskS = deskS+1\
  996.      if deskS > maxDeskS then\
  997.       deskS = maxDeskS\
  998.      else\
  999.       clear(colors.lightBlue)\
  1000.       redraw()\
  1001.      end\
  1002. \009 end\
  1003.    elseif topM==\"1\" and #noty*4+4+notyPos-comp*2>ySize then\
  1004.     notyPos=notyPos-1\
  1005.     topMenu()\
  1006.    end\
  1007.   elseif side == -1 then\
  1008.    if topM==\"0\" then\
  1009.     if appMenu == true then\
  1010.      screen = screen-1\
  1011.      if screen < 1 then\
  1012.       screen = 1\
  1013.      else\
  1014.       clear(colors.lightBlue)\
  1015.       redraw()\
  1016.      end\
  1017. \009 else\
  1018. \009  deskS = deskS-1\
  1019.      if deskS < 1 then\
  1020.       deskS = 1\
  1021.      else\
  1022.       clear(colors.lightBlue)\
  1023.       redraw()\
  1024.      end\
  1025. \009 end\
  1026.    elseif topM==\"1\" and #noty*4+5>ySize and notyPos<1 then\
  1027.     notyPos=notyPos+1\
  1028.     topMenu()\
  1029.    end\
  1030.   end\
  1031. \
  1032.  elseif event == \"key\" then \
  1033.   if side == 205 and topM==\"0\" then\
  1034.    if appMenu == true then\
  1035.     screen = screen+1\
  1036.     if screen > maxScreen then\
  1037.      screen = maxScreen\
  1038.     else\
  1039.      clear(colors.lightBlue)\
  1040.      redraw()\
  1041.     end\
  1042. \009else\
  1043. \009 deskS = deskS+1\
  1044.     if deskS > maxDeskS then\
  1045.      deskS = maxDeskS\
  1046.     else\
  1047.      clear(colors.lightBlue)\
  1048.      redraw()\
  1049.     end\
  1050. \009end\
  1051.   elseif side == 203 and topM==\"0\" then\
  1052.    if appMenu == true then\
  1053.     screen = screen-1\
  1054.     if screen < 1 then\
  1055.      screen = 1\
  1056.     else\
  1057.      clear(colors.lightBlue)\
  1058.      redraw()\
  1059.     end\
  1060. \009else\
  1061. \009 deskS = deskS-1\
  1062.     if deskS < 1 then\
  1063.      deskS = 1\
  1064.     else\
  1065.      clear(colors.lightBlue)\
  1066.      redraw()\
  1067.     end\
  1068. \009end\
  1069.   end\
  1070. \
  1071.  elseif event == \"mouse_click\" then\
  1072.   draw = false\
  1073.   if sysbar.notifyCheck(x,y) and topM == \"0\" then\
  1074.    topM = \"1\"\
  1075.    topMenu()\
  1076.   elseif (sysbar.back(x,y) or (x>=3 and x <=9 and y == 2-comp)) and editMode and topM == '0' then\
  1077. \009editMode = false\
  1078. \009redraw()\
  1079.   elseif sysbar.back(x,y) and editMode == false and topM == '0' then\
  1080.    if sear then\
  1081.     sear = nil\
  1082. \009elseif addMode == true then\
  1083. \009 addMode = false\
  1084. \009elseif appMenu then\
  1085. \009 appMenu = false\
  1086. \009end\
  1087. \009redraw()\
  1088.   elseif x>=xSize-3 and x<=xSize-2 and editMode and y == 2-comp then\
  1089.    maxDeskS = maxDeskS + 1\
  1090. \009desk[maxDeskS] = {}\
  1091. \009deskS = maxDeskS\
  1092. \009saveDesk(desk)\
  1093. \009redraw()\
  1094.   elseif x==xSize-maxDeskS-5 and editMode and y == 2-comp then\
  1095. \009if deskS < maxDeskS then\
  1096. \009 for i=deskS,maxDeskS do\
  1097. \009  desk[i]=desk[i+1]\
  1098. \009 end\
  1099. \009end\
  1100. \009desk[maxDeskS] = nil\
  1101. \009maxDeskS = maxDeskS - 1\
  1102. \009if deskS>maxDeskS then\
  1103. \009 deskS = deskS-1\
  1104. \009end\
  1105. \009saveDesk(desk)\
  1106. \009redraw()\
  1107.   elseif sysbar.home(x,y) and topM == '0' then\
  1108. \009editMode = false\
  1109. \009deskS = 1\
  1110. \009appMenu = false\
  1111. \009sear = nil\
  1112. \009redraw()\
  1113.   elseif editMode == true then\
  1114.    local select = 0\
  1115. \009local bx = 0\
  1116. \009local by = 0\
  1117.    refreshDesk()\
  1118. \009if #desk > 0 then\
  1119. \009 for i=1,#desk[deskS] do\
  1120. \009  if x>=obj[desk[deskS][i]['name']][\"x1\"] and x<=obj[desk[deskS][i]['name']][\"x2\"] and y>=obj[desk[deskS][i]['name']][\"y1\"] and y<=obj[desk[deskS][i]['name']][\"y2\"] then\
  1121. \009   select = i\
  1122. \009   bx = desk[deskS][select]['x']\
  1123. \009   by = desk[deskS][select]['y']\
  1124. \009  end\
  1125. \009 end\
  1126. \009end\
  1127. \009if select ~= 0 then\
  1128. \009 while true do\
  1129. \009  local eve, si, xt, yt = os.pullEvent()\
  1130. \009  if eve == \"mouse_drag\" then\
  1131. \009   if yt>=3 and yt<=ySize-6+comp then\
  1132. \009    desk[deskS][select]['x']=xt\
  1133. \009    desk[deskS][select]['y']=yt\
  1134. \009\009if xt>=xSize-1 then\
  1135. \009     deskS = deskS+1\
  1136.         if deskS > maxDeskS then\
  1137. \009\009  maxDeskS = maxDeskS + 1\
  1138.          deskS = maxDeskS\
  1139. \009\009  desk[maxDeskS] = {}\
  1140. \009\009  desk[deskS-1][select]['x']=4\
  1141. \009\009  desk[deskS][#desk[deskS]+1] = desk[deskS-1][select]\
  1142. \009\009  desk[deskS-1][select] = nil\
  1143. \009\009  saveDesk(desk)\
  1144. \009\009  redraw()\
  1145. \009\009  break\
  1146.         else\
  1147. \009\009  desk[deskS-1][select]['x']=3\
  1148. \009\009  desk[deskS][#desk[deskS]+1] = desk[deskS-1][select]\
  1149. \009\009  desk[deskS-1][select] = nil\
  1150.          clear(colors.lightBlue)\
  1151. \009\009  select = #desk[deskS]\
  1152. \009\009  saveDesk(desk)\
  1153. \009\009  redraw()\
  1154. \009\009  break\
  1155.         end\
  1156. \009\009elseif xt<=2 then\
  1157. \009\009 deskS = deskS-1\
  1158.         if deskS < 1 then\
  1159.          deskS = 1\
  1160.         else\
  1161. \009\009  desk[deskS+1][select]['x']=math.floor((xSize/8)*8-8)\
  1162. \009\009  desk[deskS][#desk[deskS]+1] = desk[deskS+1][select]\
  1163. \009\009  desk[deskS+1][select] = nil\
  1164.          clear(colors.lightBlue)\
  1165. \009\009  select = #desk[deskS]\
  1166. \009\009  saveDesk(desk)\
  1167. \009\009  redraw()\
  1168. \009\009  break\
  1169.         end\
  1170. \009\009end\
  1171. \009\009saveDesk(desk)\
  1172. \009    redraw()\
  1173. \009   end\
  1174. \009  elseif eve == \"mouse_scroll\" then\
  1175.       if si == 1 then\
  1176. \009    deskS = deskS+1\
  1177.        if deskS > maxDeskS then\
  1178.         deskS = maxDeskS\
  1179.        else\
  1180. \009\009 desk[deskS][#desk[deskS]+1] = desk[deskS-1][select]\
  1181. \009\009 saveDesk(desk)\
  1182. \009\009 select = #desk[deskS]\
  1183.         clear(colors.lightBlue)\
  1184.         redraw()\
  1185.        end\
  1186.       elseif si == -1 then\
  1187. \009    deskS = deskS-1\
  1188.        if deskS < 1 then\
  1189.         deskS = 1\
  1190.        else\
  1191. \009\009 desk[deskS][#desk[deskS]+1] = desk[deskS+1][select]\
  1192. \009\009 saveDesk(desk)\
  1193. \009\009 select = #desk[deskS]\
  1194.         clear(colors.lightBlue)\
  1195.         redraw()\
  1196.        end\
  1197. \009   end\
  1198. \009  elseif eve == \"mouse_up\" then\
  1199. \009   for i=1,math.floor(xSize/8) do\
  1200. \009\009if (xt-(i*8-5) > 0 and xt-(i*8-5) < 7) or (xt-(i*8-5) < 0 and xt-(i*8-5) > -7) then\
  1201. \009\009 desk[deskS][select]['x']=i*8-5\
  1202. \009\009end\
  1203. \009   end\
  1204. \009   for i=1,math.floor(ySize/6) do\
  1205. \009\009if (yt-(i*5-(6-comp*4)) > 0 and yt-(i*5-(6-comp*4)) < 5) or (yt-(i*5-(6-comp*4)) < 0 and yt-(i*5-(6-comp*4)) > -5) then\
  1206. \009\009 desk[deskS][select]['y']=i*5-(6-comp*4)\
  1207. \009\009end\
  1208. \009   end\
  1209. \009   for i=1,#desk[deskS] do\
  1210. \009    if desk[deskS][select]['x']==desk[deskS][i]['x'] and desk[deskS][select]['y']==desk[deskS][i]['y'] and i~=select then\
  1211. \009\009 desk[deskS][i]['x'] = bx\
  1212. \009\009 desk[deskS][i]['y'] = by\
  1213. \009\009end\
  1214. \009   end\
  1215. \009   saveDesk(desk)\
  1216. \009   redraw()\
  1217. \009   select = 0\
  1218. \009   break\
  1219. \009  end\
  1220. \009 end\
  1221. \009end\
  1222.   elseif x==xSize and y==ySize and topM == '0' then\
  1223.    term.setBackgroundColor(colors.gray)\
  1224.    term.setTextColor(colors.lightGray)\
  1225.    usualText(\"|\",xSize,ySize)\
  1226.    term.setTextColor(colors.white)\
  1227. \009local budka = ''\
  1228. \009if appMenu == true then\
  1229. \009 local a = \"Add to desktop\"\
  1230. \009 if addMode then a = \"Apply\" end\
  1231. \009 budka = contexts.main(x,y-1,a,\"Shutdown\",\"Reboot\",\"Wallpapers\")\
  1232. \009else\
  1233. \009 budka = contexts.main(x,y-1,\"Edit desktop\",\"Shutdown\",\"Reboot\",\"Wallpapers\")\
  1234. \009end\
  1235.    if budka == \"Shutdown\" then\
  1236. \009 os.shutdown()\
  1237. \009elseif budka == \"Reboot\" then\
  1238. \009 os.reboot()\
  1239. \009elseif budka == \"Wallpapers\" then\
  1240. \009 redraw()\
  1241. \009 files = refreshFiles()\
  1242. \009 local find = false\
  1243.      for i=1,#files do if files[i]==l_login..\"/ImageViewer.apk\" then find = true end end\
  1244. \009 if find then\
  1245. \009  shell.run(\"/.ds/\"..l_login..\"/ImageViewer.apk/main\")\
  1246. \009 else\
  1247. \009  local but = windows.select({\"ImageViewer not found\"},{\"Install it?\"},{\"Yes\",colors.lightBlue,colors.white},{\"No\",colors.gray,colors.white})\
  1248. \009  if but == 'Yes' then\
  1249. \009   shell.run(\"/.ds/sys/Store@.apk/main\")\
  1250. \009  end\
  1251. \009  redraw()\
  1252. \009 end\
  1253.     redraw() \
  1254.     topM=\"0\"\
  1255. \009elseif budka == \"Add to desktop\" and l_login~='$test' then\
  1256. \009 addMode = true\
  1257. \009 redraw()\
  1258. \009elseif budka == \"Apply\" then\
  1259. \009 addMode = false\
  1260. \009 redraw()\
  1261. \009elseif budka == \"Edit desktop\" and l_login~='$test' then\
  1262. \009 editMode = true\
  1263. \009 redraw()\
  1264. \009elseif budka == nil then\
  1265. \009 redraw()\
  1266. \009end\
  1267.   elseif x>=obj[\"sett\"][\"x1\"] and x<=obj[\"sett\"][\"x2\"] and y>=obj[\"sett\"][\"y1\"] and y<=obj[\"sett\"][\"y2\"] and topM == \"1\" then\
  1268.    topM = \"0\"\
  1269.    shell.run(\"/System/prog/settings\")\
  1270.    redraw()\
  1271.   elseif x>=xSize-#l_login and ((y==3 and comp == 0 ) or (y==ySize-1 and comp == 1))and topM==\"1\" then\
  1272.    log = false\
  1273.    l_login = \"...\"\
  1274.    shell.run(\"/ver\")\
  1275.    topM=\"0\"\
  1276. \009files = refreshFiles()\
  1277.    redraw()\
  1278.   elseif (((x>=10 and x<=11 and y==3) and comp == 0) or ((x>=xSize-16 and x<=xSize-15 and y==ySize-1) and comp == 1)) and topM==\"1\" and set==false then\
  1279.    set=true\
  1280.    topMenu()\
  1281.   elseif topM==\"1\" and set==true then\
  1282.    if ((y==5 and comp == 0) or (y==ySize-8 and comp == 1)) and ((x<=11 and comp == 0) or (x<=xSize-15 and x>=xSize-25 and comp == 1)) then\
  1283. \009\009topM = '0'\
  1284. \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
  1285. \009\009shell.run(\"/System/prog/applications\")\
  1286. \009\009redraw()\
  1287.    elseif ((y==6 and comp == 0) or (y==ySize-7 and comp == 1)) and ((x<=11 and comp == 0) or (x<=xSize-15 and x>=xSize-25 and comp == 1)) then\
  1288. \009\009topM = '0'\
  1289. \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
  1290. \009\009shell.run(\"/System/prog/style\")\
  1291. \009\009redraw()\
  1292.    elseif ((y==7 and comp == 0) or (y==ySize-6 and comp == 1)) and ((x<=11 and comp == 0) or (x<=xSize-15 and x>=xSize-25 and comp == 1)) then\
  1293. \009\009topM = '0'\
  1294. \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
  1295. \009\009shell.run(\"/System/prog/security\")\
  1296. \009\009redraw()\
  1297.    elseif ((y==8 and comp == 0) or (y==ySize-5 and comp == 1)) and ((x<=11 and comp == 0) or (x<=xSize-15 and x>=xSize-25 and comp == 1)) then\
  1298. \009\009topM = '0'\
  1299. \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
  1300. \009\009shell.run(\"/System/prog/storage\")\
  1301. \009\009redraw()\
  1302.    elseif ((y==9 and comp == 0) or (y==ySize-4 and comp == 1)) and ((x<=11 and comp == 0) or (x<=xSize-15 and x>=xSize-25 and comp == 1)) then\
  1303. \009\009topM = '0'\
  1304. \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
  1305. \009\009shell.run(\"/System/prog/update\")\
  1306. \009\009redraw()\
  1307.    elseif ((y==10 and comp == 0) or (y==ySize-3 and comp == 1)) and ((x<=11 and comp == 0) or (x<=xSize-15 and x>=xSize-25 and comp == 1)) then\
  1308. \009\009topM = '0'\
  1309. \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
  1310. \009\009shell.run(\"/System/prog/about\")\
  1311. \009\009redraw()\
  1312.    else\
  1313. \009\009redraw()\
  1314. \009\009topM=\"1\"\
  1315. \009\009topMenu()\
  1316.    end\
  1317.    if ((y>=5 or y<=10) and comp == 0) or ((y>=ySize-2 or y<=ySize-10) and comp == 1) and x<=11 then\
  1318.     topM=\"0\"\
  1319.     redraw()\
  1320.    end\
  1321.   elseif x>=xSize-4 and x<=xSize and y==ySize and topM==\"1\" then\
  1322.    noty = {}\
  1323.    redraw()\
  1324.    topM=\"0\"\
  1325.   elseif x>=1 and x<=xSize and y==ySize and topM==\"1\" then\
  1326.    redraw()\
  1327.    topM = \"0\"\
  1328.    notyPos=1\
  1329.   elseif x>=3 and x<=xSize-4 and y==2-comp and topM==\"0\" then\
  1330.    if appMenu then\
  1331. \009\009screen = 1\
  1332. \009\009sear = nil\
  1333. \009\009sear = sysbar.search(\"*\",false,true)\
  1334. \009\009if sear then\
  1335. \009\009\009local file = refreshFiles()\
  1336. \009\009\009files = {}\
  1337. \009\009\009local ii=1\
  1338. \009\009\009for i=1,#file do\
  1339. \009\009\009\009if (string.find(file[i],sear) ~= nil) and (string.find(file[i],sear) < #file[i]-3) then\
  1340. \009\009\009\009\009files[ii]=file[i]\
  1341. \009\009\009\009\009ii=ii+1\
  1342. \009\009\009\009end\
  1343. \009\009\009end\
  1344. \009\009end\
  1345. \009else\
  1346. \009\009local op = sysbar.search(\"*\",true)\
  1347. \009\009if op~=nil and fs.isDir(op)==false then\
  1348. \009\009\009shell.run(op)\
  1349. \009\009end\
  1350. \009end\
  1351. \009redraw()\
  1352.   elseif x==xSize-2 and y==2-comp then\
  1353.    if appMenu == true then\
  1354. \009 appMenu = false\
  1355. \009 redraw()\
  1356. \009else\
  1357. \009 appMenu = true\
  1358. \009 redraw()\
  1359. \009end\
  1360.   else\
  1361.    if side == 1 then\
  1362. \009 if appMenu then\
  1363.      for i=(screen-1)*(math.floor(xSize/8)*math.floor((ySize)/(6-comp)))+1,Napp-1 do\
  1364.       if x>=obj[files[i]][\"x1\"] and x<=obj[files[i]][\"x2\"] and y>=obj[files[i]][\"y1\"] and y<=obj[files[i]][\"y2\"] then\
  1365.        if appHistory ~= nil then\
  1366.         appHistory[#appHistory+1]=files[i]\
  1367.        else\
  1368.         appHistory[1]=files[i]\
  1369.        end\
  1370.        for ii=1,#files do\
  1371.         newObj(files[ii],-1,-1,-1,-1)\
  1372.        end\
  1373. \009\009if addMode == true then\
  1374. \009\009 if #desk < 1 then\
  1375. \009\009  desk[1] = {}\
  1376. \009\009  deskS = 1\
  1377. \009\009 end\
  1378. \009\009 desk[deskS][#desk[deskS]+1] = {}\
  1379. \009\009 desk[deskS][#desk[deskS]]['name']=files[i]\
  1380. \009\009 desk[deskS][#desk[deskS]]['x']=3+adds\
  1381. \009\009 desk[deskS][#desk[deskS]]['y']=ySize-6\
  1382. \009\009 adds = adds + 2\
  1383. \009\009 saveDesk(desk)\
  1384. \009\009 if math.floor(adds/2) > math.floor(xSize/8)-1 then\
  1385. \009\009  adds = 0\
  1386. \009\009  appMenu = false\
  1387. \009\009  addMode = false\
  1388. \009\009 end\
  1389. \009\009 redraw()\
  1390. \009\009else\
  1391. \009\009 topM=\"0\"\
  1392. \009\009 screen = 1\
  1393. \009\009 appMenu = false\
  1394. \009\009 clear(colors.black)\
  1395.         runApp(\"/.ds/\"..files[i]..\"/main\")\
  1396. \009\009 break\
  1397. \009\009end\
  1398.       end\
  1399.      end\
  1400. \009  redraw()\
  1401. \009 elseif appMenu == false and #desk > 0 and l_login~='$test' then\
  1402. \009  refreshDesk()\
  1403. \009  for i=1,#desk[deskS] do\
  1404. \009   if x>=obj[desk[deskS][i]['name']][\"x1\"] and x<=obj[desk[deskS][i]['name']][\"x2\"] and y>=obj[desk[deskS][i]['name']][\"y1\"] and y<=obj[desk[deskS][i]['name']][\"y2\"] then\
  1405.        clear(colors.black)\
  1406.        if appHistory ~= nil then\
  1407.         appHistory[#appHistory+1]=desk[deskS][i]['name']\
  1408.        else\
  1409.         appHistory[1]=desk[deskS][i]['name']\
  1410.        end\
  1411.        topM=\"0\"\
  1412. \009\009clear(colors.black)\
  1413.        runApp(\"/.ds/\"..desk[deskS][i]['name']..\"/main\")\
  1414. \009\009break\
  1415.       end\
  1416. \009  end\
  1417. \009  redraw()\
  1418.     end\
  1419.     for i=1,#noty do\
  1420.      if x>=xSize-#noty[i][\"button\"]+1 and x<=xSize-1 and ((y==4*i+notyPos+3 and comp == 0) or (y==ySize-(4*i+notyPos)+2 and comp == 1)) and topM == \"1\" then\
  1421.       clear(colors.black)\
  1422. \009   topM=\"0\"\
  1423. \009   if noty[i][\"app\"] == 'Settings' or noty[i][\"app\"] == 'Store@' then\
  1424. \009    shell.run(\"/.ds/sys/\"..noty[i][\"app\"]..\".apk/main\")\
  1425. \009   else\
  1426.        shell.run(\"/.ds/\"..l_login..\"/\"..noty[i][\"app\"]..\".apk/main\")\
  1427. \009   end\
  1428.       if noty[i+1] ~= nil then\
  1429.        for i=i,#noty do\
  1430.         noty[i] = noty[i+1]\
  1431.        end\
  1432.       else\
  1433.        noty[i] = nil\
  1434.       end\
  1435.       redraw()\
  1436.       break\
  1437.      elseif x==xSize and ((y==4*i+notyPos and comp == 0) or (y==ySize-(4*i+notyPos+1) and comp == 1)) and topM == \"1\" then\
  1438.       if noty[i+1] ~= nil then\
  1439.        for i=i,#noty do\
  1440.         noty[i] = noty[i+1]\
  1441.        end\
  1442.       else\
  1443.        noty[i] = nil\
  1444.       end\
  1445.       if notyPos<-3 then\
  1446.        notyPos=notyPos+4\
  1447.       else\
  1448.        notyPos=1\
  1449.        redraw()\
  1450.       end\
  1451.       topMenu()\
  1452.       break\
  1453.      end\
  1454.     end\
  1455.     for i=1,#appHistory do\
  1456.      if x==xSize and y==i*2+1 and aph == \"1\" then\
  1457.       if appHistory[i+1] ~= nil then\
  1458.        for ii=i,#appHistory do\
  1459.         appHistory[ii] = appHistory[ii+1]\
  1460.        end\
  1461.       else\
  1462.        appHistory[i] = nil\
  1463.       end\
  1464.       appHis()\
  1465.       break\
  1466.      end\
  1467.     end\
  1468.    end\
  1469.   end\
  1470.   draw = true\
  1471.  end\
  1472.  sysbar.draw(style,colors.white,noty,false,true)\
  1473.  if topM == \"1\" then\
  1474.   topMenu()\
  1475.  end\
  1476. end\
  1477. end\
  1478. \
  1479. local start = function()\
  1480. redraw()\
  1481. running()\
  1482. end\
  1483. \
  1484. fadeX()\
  1485. clear(colors.white)\
  1486. term.setTextColor(colors.lightGray)\
  1487. usualText('Vedroid',centerX-4,centerY-1)\
  1488. term.setTextColor(colors.lime)\
  1489. usualText('OS',centerX+3,centerY-1)\
  1490. usualText(osLogo,centerX-math.floor(#osLogo/2),centerY+6)\
  1491. usualText(\".\",centerX,ySize-1)\
  1492. local web = pastebin(\"AH3k8DMa\",\"ver\")\
  1493. if not web then\
  1494. \009term.setBackgroundColor(colors.white)\
  1495. end\
  1496. sleep(0.1)\
  1497. usualText(\"..\",centerX,ySize-1)\
  1498. sleep(0.1)\
  1499. usualText(\"...\",centerX-1,ySize-1)\
  1500. sleep(0.1)\
  1501. shell.run(\"ver\")\
  1502. if l_login == '...' then l_login = '$test' end\
  1503. local f = fs.list('/.ds')\
  1504. local find = false\
  1505. if #f ~= nil then\
  1506. \009for i=1, #f do\
  1507. \009\009if f[i] ~= nil and f[i] == l_login then find = true end\
  1508. \009end\
  1509. end\
  1510. if find == false and l_login ~= '...' then\
  1511. \009shell.run('mkdir /.ds/'..l_login)\
  1512. else\
  1513. \009shell.run(\"/System/accounts/\"..l_login)\
  1514. end\
  1515. find = false\
  1516. local f = fs.list('/System/desks')\
  1517. for i=1, #f do\
  1518. \009if f[i] == l_login then find = true end\
  1519. end\
  1520. if find == false then\
  1521. \009shell.run('mkdir /System/desks')\
  1522. \009local desk = {}\
  1523. \009desk[1] = {}\
  1524. \009desk[1][1] = {}\
  1525. \009desk[1][1]['name']='sys/Store@.apk'\
  1526. \009desk[1][1]['x']=3\
  1527. \009desk[1][1]['y']=ySize-6\
  1528. \009local file = fs.open('/System/desks/'..l_login,\"w\")\
  1529. \009file.write(textutils.serialize(desk))\
  1530. \009file.close()\
  1531. end\
  1532. f = nil\
  1533. find = nil\
  1534. \
  1535. clear(colors.white)\
  1536. local workPath = \"/.ds/\"..l_login\
  1537. parallel.waitForAny(sysBar,start)\
  1538. fadeX()\
  1539. clear(colors.black)",
  1540.     path = "//startup",
  1541.   },
  1542.   {
  1543.     text = " 70 70 70 70 70 70 70 70\
  1544. 70C70h70a70n70g70e70 70\
  1545. 70 70 70 70 70 70 70 70\
  1546. 70 70I70m70a70g70e70 70\
  1547. 70 70 70 70 70 70 70 70",
  1548.     path = "//System/acc.png",
  1549.   },
  1550.   {
  1551.     text = "{...}",
  1552.     path = "//System/accounts/accs.back",
  1553.   },
  1554.   {
  1555.     text = "local xSize, ySize = term.getSize()\
  1556. local comp = false\
  1557. \
  1558. local usualText = function(string,xPos,yPos)\
  1559. \009term.setCursorPos(xPos,yPos)\
  1560. \009term.write(string)\
  1561. end\
  1562. \
  1563. function main(...)\
  1564. \009local waitFor = true\
  1565. \009local x = arg[1]\
  1566. \009local y = arg[2]\
  1567. \009local maxLenth = 3\
  1568. \009local output = nil\
  1569. \009for i=3,#arg do\
  1570. \009\009if #arg[i] > maxLenth then\
  1571. \009\009\009maxLenth = #arg[i]\
  1572. \009\009end\
  1573. \009end\
  1574. \009maxLenth = maxLenth + 1\
  1575. \009local xend = x+maxLenth\
  1576. \009local yend = y+#arg-1\
  1577. \009if x+maxLenth > xSize then\
  1578. \009\009xend = x\
  1579. \009\009x = x-maxLenth\
  1580. \009end\
  1581. \009if y+#arg > ySize then\
  1582. \009\009yend = y\
  1583. \009\009y = y-#arg+1\
  1584. \009end\
  1585. \009paintutils.drawFilledBox(x,y,xend,yend,colors.gray)\
  1586. \009term.setTextColor(colors.white)\
  1587. \009for i=3,#arg do\
  1588. \009\009usualText(arg[i],x+math.floor((maxLenth-1)/2)-math.floor(#arg[i]/2)+1,y+i-2)\
  1589. \009end\
  1590. \009while waitFor do\
  1591. \009\009event, side, xp, yp = os.pullEvent()\
  1592. \009\009if event == 'mouse_click' then \
  1593. \009\009\009for i=1,#arg-2 do\
  1594. \009\009\009\009if xp >= x and xp <= xend and yp >= y and yp <= yend then\
  1595. \009\009\009\009\009if yp == y+i then\
  1596. \009\009\009\009\009\009paintutils.drawFilledBox(x,y+i,xend,y+i,colors.lightGray)\
  1597. \009\009\009\009\009\009usualText(arg[i+2],x+math.floor((maxLenth-1)/2)-math.floor(#arg[i+2]/2)+1,y+i)\
  1598. \009\009\009\009\009\009sleep(0.1)\
  1599. \009\009\009\009\009\009output = arg[i+2]\
  1600. \009\009\009\009\009end\
  1601. \009\009\009\009end\
  1602. \009\009\009end\
  1603. \009\009\009return output\
  1604. \009\009end\
  1605. \009end\
  1606. end",
  1607.     path = "//System/API/contexts",
  1608.   },
  1609.   {
  1610.     text = "function draw(startX,startY,image,cutX,cutY)\
  1611. \009local Colors = {\
  1612. \009\009[\"0\"] = 1,\
  1613. \009\009[\"1\"] = 2,\
  1614. \009\009[\"2\"] = 4,\
  1615. \009\009[\"3\"] = 8,\
  1616. \009\009[\"4\"] = 16,\
  1617. \009\009[\"5\"] = 32,\
  1618. \009\009[\"6\"] = 64,\
  1619. \009\009[\"7\"] = 128,\
  1620. \009\009[\"8\"] = 256,\
  1621. \009\009[\"9\"] = 512,\
  1622. \009\009[\"a\"] = 1024,\
  1623. \009\009[\"b\"] = 2048,\
  1624. \009\009[\"c\"] = 4096,\
  1625. \009\009[\"d\"] = 8192,\
  1626. \009\009[\"e\"] = 16384,\
  1627. \009\009[\"f\"] = 32768\
  1628. \009}\
  1629. \009local Pixels = {}\
  1630. \009\
  1631. \009local function convert(mode,color)\
  1632. \009\009if mode == \"from cc\" then\
  1633. \009\009\009for key,value in pairs(Colors) do\
  1634. \009\009\009\009if color == value then\
  1635. \009\009\009\009\009return key\
  1636. \009\009\009\009end\
  1637. \009\009\009end\
  1638. \009\009else\
  1639. \009\009\009if color == \"#\" then\
  1640. \009\009\009\009return \"0\"\
  1641. \009\009\009else\
  1642. \009\009\009\009return Colors[color]\
  1643. \009\009\009end\
  1644. \009\009end\
  1645. \009end\
  1646. \
  1647. \009local function load(path)\
  1648. \009\009local file = fs.open(path,\"r\")\
  1649. \009\009local lineCounter = 1\
  1650. \009\009while true do\
  1651. \009\009\009local line = file.readLine()\
  1652. \009\009\009Pixels[lineCounter]={}\
  1653. \009\009\009if line ~= nil then\
  1654. \009\009\009\009for i=1,#line,3 do\
  1655. \009\009\009\009\009Pixels[lineCounter][(i+2)/3]={[\"symbol\"] = string.sub(line,i,i),[\"textColor\"] = convert(\"to cc\",string.sub(line,i+1,i+1)),[\"backColor\"] = convert(\"to cc\",string.sub(line,i+2,i+2))}\
  1656. \009\009\009\009end\
  1657. \009\009\009\009lineCounter = lineCounter + 1\
  1658. \009\009\009else\
  1659. \009\009\009\009break\
  1660. \009\009\009end\
  1661. \009\009end\
  1662. \009\009file.close()\
  1663. \009end\
  1664. \
  1665. \009load(image)\
  1666. \009\
  1667. \009if cutX == nil or cutY == nil then\
  1668. \009\009cutX = #Pixels[1]\
  1669. \009\009cutY = #Pixels-1\
  1670. \009else\
  1671. \009\009if cutY >= #Pixels then cutY = #Pixels-1 end\
  1672. \009\009if cutX > #Pixels[1] then cutX = #Pixels[1] end\
  1673. \009end\
  1674. \009\
  1675. \009local function LT()\
  1676. \009\009for y=1,math.floor(cutY/2) do\
  1677. \009\009\009for x=1,math.floor(cutX/2) do\
  1678. \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" then\
  1679. \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
  1680. \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
  1681. \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
  1682. \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
  1683. \009\009\009\009end\
  1684. \009\009\009end\
  1685. \009\009end\
  1686. \009end\
  1687. \009\
  1688. \009local function LD()\
  1689. \009\009for y=math.floor(cutY/2)+1,cutY do\
  1690. \009\009\009for x=1,math.floor(cutX/2) do\
  1691. \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" then\
  1692. \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
  1693. \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
  1694. \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
  1695. \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
  1696. \009\009\009\009end\
  1697. \009\009\009end\
  1698. \009\009end\
  1699. \009end\
  1700. \009\
  1701. \009local function RT()\
  1702. \009\009for y=1,math.floor(cutY/2) do\
  1703. \009\009\009for x=math.floor(cutX/2)+1,cutX do\
  1704. \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" then\
  1705. \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
  1706. \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
  1707. \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
  1708. \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
  1709. \009\009\009\009end\
  1710. \009\009\009end\
  1711. \009\009end\
  1712. \009end\009\
  1713. \009\
  1714. \009local function RD()\
  1715. \009\009for y=math.floor(cutY/2)+1,cutY do\
  1716. \009\009\009for x=math.floor(cutX/2)+1,cutX do\
  1717. \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" and Pixels[y][x][\"symbol\"] ~= \"\" then\
  1718. \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
  1719. \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
  1720. \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
  1721. \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
  1722. \009\009\009\009end\
  1723. \009\009\009end\
  1724. \009\009end\
  1725. \009end\
  1726. \009\009\
  1727. \009parallel.waitForAll(LT,RT,LD,RD)\
  1728. end",
  1729.     path = "//System/API/image",
  1730.   },
  1731.   {
  1732.     text = "local xSize, ySize = term.getSize()\
  1733. local comp = false\
  1734. os.loadAPI('/System/API/windows')\
  1735. \
  1736. local usualText = function(string,xPos,yPos)\
  1737. \009term.setCursorPos(xPos,yPos)\
  1738. \009term.write(string)\
  1739. end\
  1740. \
  1741. function draw(color,textColor,noty,inapp,settings,timer)\
  1742. \009local time = ''\
  1743. \009if timer ~= false then\
  1744. \009\009time = textutils.formatTime(os.time(),true)\
  1745. \009end\
  1746. \009\009\
  1747. \009local obj = {}\
  1748. \009if xSize > 30 then comp = true end\
  1749. \009\
  1750. \009if comp == false then\
  1751. \009\009term.setTextColor(textColor)\
  1752. \009\009if inapp == false then\
  1753. \009\009\009paintutils.drawLine(0,1,xSize,1,color)\
  1754. \009\009\009usualText(time,xSize-#time,1)\
  1755. \009\009\009if noty~=nil then\
  1756. \009\009\009\009for i=1,#noty do\
  1757. \009\009\009\009\009if noty[i][\"ico\"] ~= nil then\
  1758. \009\009\009\009\009\009usualText(noty[i][\"ico\"],i,1)\
  1759. \009\009\009\009\009else\
  1760. \009\009\009\009\009\009usualText(\"+\",i,1)\
  1761. \009\009\009\009\009end\
  1762. \009\009\009\009end\
  1763. \009\009\009end\009\
  1764. \009\009end\
  1765. \009\009paintutils.drawLine(0,ySize,xSize,ySize,color)\
  1766. \009\009usualText(\"()\",xSize/2,ySize)\
  1767. \009\009usualText(\"<<\",xSize/2-4,ySize)\
  1768. \009\009usualText(\"[]\",xSize/2+4,ySize)\
  1769. \009\009if settings == true then\
  1770. \009\009\009usualText(\"|\",xSize,ySize)\
  1771. \009\009end\
  1772. \009elseif comp == true then\
  1773. \009\009paintutils.drawLine(0,ySize,xSize,ySize,color)\
  1774. \009\009term.setTextColor(textColor)\
  1775. \009\009usualText(time,xSize-#time-1,ySize)\
  1776. \009\009usualText(\"()\",5,ySize)\
  1777. \009\009usualText(\"<<\",2,ySize)\
  1778. \009\009usualText(\"[]\",8,ySize)\
  1779. \009\009if settings == true then\
  1780. \009\009\009usualText(\"|\",xSize,ySize)\
  1781. \009\009end\
  1782. \009\009if noty~=nil then\
  1783. \009\009\009for i=1,#noty do\
  1784. \009\009\009\009if noty[i][\"ico\"] ~= nil then\
  1785. \009\009\009\009\009usualText(noty[i][\"ico\"],xSize-2-i-#time,ySize)\
  1786. \009\009\009\009else\
  1787. \009\009\009\009\009usualText(\"+\",xSize-2-i-#time,ySize)\
  1788. \009\009\009\009end\
  1789. \009\009\009end\
  1790. \009\009end\
  1791. \009end\
  1792. end\
  1793. \
  1794. function back(x,y)\
  1795. \009if xSize > 30 then comp = true end\
  1796. \009if comp == false then\
  1797. \009\009if (x >= math.floor(xSize/2)-4 and x <= math.floor(xSize/2)-3) and y==ySize then\
  1798. \009\009\009term.setBackgroundColor(colors.lightGray)\
  1799. \009\009\009term.setTextColor(colors.white)\
  1800. \009\009\009usualText(\" << \",xSize/2-5,ySize)\
  1801. \009\009\009sleep(0.1)\
  1802. \009\009\009return true\
  1803. \009\009else\
  1804. \009\009\009return false\
  1805. \009\009end\
  1806. \009elseif comp == true then\
  1807. \009\009if (x == 2 or x == 3) and y==ySize then\
  1808. \009\009\009term.setBackgroundColor(colors.lightGray)\
  1809. \009\009\009term.setTextColor(colors.white)\
  1810. \009\009\009usualText(\" << \",1,ySize)\
  1811. \009\009\009sleep(0.1)\
  1812. \009\009\009return true\
  1813. \009\009else\
  1814. \009\009\009return false\
  1815. \009\009end\
  1816. \009end\
  1817. end\
  1818. \
  1819. function home(x,y)\
  1820. \009if xSize > 30 then comp = true end\
  1821. \009if comp == false then\
  1822. \009\009if (x >= math.floor(xSize/2) and x <= math.floor(xSize/2)+1) and y==ySize then\
  1823. \009\009\009term.setBackgroundColor(colors.lightGray)\
  1824. \009\009\009term.setTextColor(colors.white)\
  1825. \009\009\009usualText(\" () \",xSize/2-1,ySize)\
  1826. \009\009\009sleep(0.1)\
  1827. \009\009\009home = true\
  1828. \009\009\009return true\
  1829. \009\009else\
  1830. \009\009\009return false\
  1831. \009\009end\
  1832. \009elseif comp == true then\
  1833. \009\009if (x == 5 or x == 6) and y==ySize then\
  1834. \009\009\009term.setBackgroundColor(colors.lightGray)\
  1835. \009\009\009term.setTextColor(colors.white)\
  1836. \009\009\009usualText(\" () \",4,ySize)\
  1837. \009\009\009sleep(0.1)\
  1838. \009\009\009home = true\
  1839. \009\009\009return true\
  1840. \009\009else\
  1841. \009\009\009return false\
  1842. \009\009end\
  1843. \009end\
  1844. end\
  1845. \
  1846. function recents(x,y)\
  1847. \009if xSize > 30 then comp = true end\
  1848. \009if comp == false then\
  1849. \009\009if (x >= math.floor(xSize/2)+4 and x <= math.floor(xSize/2)+5) and y==ySize then\
  1850. \009\009\009term.setBackgroundColor(colors.lightGray)\
  1851. \009\009\009term.setTextColor(colors.white)\
  1852. \009\009\009usualText(\" [] \",xSize/2+3,ySize)\
  1853. \009\009\009sleep(0.1)\
  1854. \009\009\009return true\
  1855. \009\009else\
  1856. \009\009\009return false\
  1857. \009\009end\
  1858. \009elseif comp == true then\
  1859. \009\009if (x == 8 or x == 9) and y==ySize then\
  1860. \009\009\009term.setBackgroundColor(colors.lightGray)\
  1861. \009\009\009term.setTextColor(colors.white)\
  1862. \009\009\009usualText(\" [] \",7,ySize)\
  1863. \009\009\009sleep(0.1)\
  1864. \009\009\009return true\
  1865. \009\009else\
  1866. \009\009\009return false\
  1867. \009\009end\
  1868. \009end\
  1869. end\
  1870. \
  1871. function notifyCheck(x,y)\
  1872. \009local time = textutils.formatTime(os.time(),true)\
  1873. \009if xSize > 30 then comp = true end\
  1874. \009if comp == false then\
  1875. \009\009if y==1 then\
  1876. \009\009\009return true\
  1877. \009\009else\
  1878. \009\009\009return false\
  1879. \009\009end\
  1880. \009elseif comp == true then\
  1881. \009\009if (x > 9 and x < xSize-#time-1) and y==ySize then\
  1882. \009\009\009return true\
  1883. \009\009else\
  1884. \009\009\009return false\
  1885. \009\009end\
  1886. \009end\
  1887. end\
  1888. \
  1889. function header(text,textColor,backColor)\
  1890. \009paintutils.drawLine(1,1,xSize,1,backColor)\
  1891. \009paintutils.drawLine(1,2,xSize,2,backColor)\
  1892. \009term.setTextColor(textColor)\
  1893. \009usualText(text,1,1)\
  1894. end\
  1895. \
  1896. function switch(y, pos, color)\
  1897. \009if pos == nil then\
  1898. \009\009pos = false\
  1899. \009end\
  1900. \009if color == nil then\
  1901. \009\009color = colors.lightBlue\
  1902. \009end\
  1903. \009paintutils.drawLine(xSize-7,y,xSize-2,y,colors.gray)\
  1904. \009if pos==true or pos==1 then\
  1905. \009\009paintutils.drawLine(xSize-4,y,xSize-2,y,color)\
  1906. \009else\
  1907. \009\009paintutils.drawLine(xSize-7,y,xSize-5,y,colors.lightGray)\
  1908. \009end\
  1909. end\
  1910. \
  1911. function scrollBar(count, size, pos, sizeStep, color2, color1)\
  1912. \009local lenthScroll = 0\
  1913. \009local posScroll = 0\
  1914. \009local lenthPage = 0\
  1915. \009local step = 0\
  1916. \009if color1 == nil then\
  1917. \009\009color1 = colors.white\
  1918. \009end\
  1919. \009if color2 == nil then\
  1920. \009\009color2 = colors.lightGray\
  1921. \009end\
  1922. \009paintutils.drawLine(xSize,3,xSize,ySize-1,color2)\
  1923. \009if count>0 then\
  1924. \009\009if count*size > ySize-3 then\
  1925. \009\009\009lenthPage = count*size\
  1926. \009\009\009lenthScroll = math.floor((ySize-3)/(lenthPage/(ySize-3)))\
  1927. \009\009\009step = ((ySize-4)-lenthScroll)/math.floor((lenthPage-(ySize-4))/sizeStep)\
  1928. \009\009\009\
  1929. \009\009else\
  1930. \009\009\009step = 0\
  1931. \009\009\009lenthScroll = ySize-3\
  1932. \009\009end\
  1933. \009else \
  1934. \009\009lenthScroll = ySize-3\
  1935. \009end\
  1936. \009paintutils.drawLine(xSize,3-pos,xSize,3+lenthScroll-pos,color1)\
  1937. \009return step\
  1938. end\
  1939. \
  1940. function search(path, expand, input)\
  1941. \009if path == nil then path = \"\" end\
  1942. \009local waitFor = true\
  1943. \009local output = nil\
  1944. \009term.setTextColor(colors.black)\
  1945. \009if xSize > 30 then comp = 1 else comp = 0 end\
  1946. \009paintutils.drawLine(3,2-comp,xSize-2,2-comp,colors.white)\
  1947. \009paintutils.drawLine(3,3-comp,xSize-2,3-comp,colors.white)\
  1948. \009paintutils.drawLine(3,4-comp,xSize-2,4-comp,colors.white)\
  1949. \009term.setCursorPos(4,3-comp)\
  1950. \009local keyWord = read()\
  1951. \009if input == false or input == nil then\
  1952. \009\009local result = {}\
  1953. \009\009if keyWord ~= \"\" then\
  1954. \009\009\009result = fs.find(path..keyWord..\"*\")\
  1955. \009\009end\
  1956. \009\009if expand == true then\
  1957. \009\009\009if result ~= nil then\
  1958. \009\009\009\009local i = 1\
  1959. \009\009\009\009while result[i] ~= nil do\
  1960. \009\009\009\009\009if fs.isDir(result[i]) == true then\
  1961. \009\009\009\009\009\009for ii=i,#result-1 do\
  1962. \009\009\009\009\009\009\009result[ii] = result[ii+1]\
  1963. \009\009\009\009\009\009end\
  1964. \009\009\009\009\009\009result[#result] = nil\
  1965. \009\009\009\009\009end\
  1966. \009\009\009\009\009i = i +1\
  1967. \009\009\009\009end\
  1968. \009\009\009\009term.setTextColor(colors.white)\
  1969. \009\009\009\009paintutils.drawLine(3,5-comp,xSize-2,5-comp,colors.lightGray)\
  1970. \009\009\009\009for i=1,#result do\
  1971. \009\009\009\009\009paintutils.drawLine(3,5-comp+i,xSize-2,5-comp+i,colors.lightGray)\
  1972. \009\009\009\009\009usualText(result[i],5,5-comp+i)\
  1973. \009\009\009\009\009paintutils.drawLine(3,6-comp+i,xSize-2,6-comp+i,colors.lightGray)\
  1974. \009\009\009\009end\
  1975. \009\009\009end\
  1976. \009\009\009while waitFor==true and keyWord~=\"\" do\
  1977. \009\009\009\009local event, side, xp, yp = os.pullEvent()\
  1978. \009\009\009\009if event == 'mouse_click' then \
  1979. \009\009\009\009\009for i=1,#result do\
  1980. \009\009\009\009\009\009if xp >= 3 and xp <= xSize-2 and yp==i+5-comp then\
  1981. \009\009\009\009\009\009\009output = result[i]\
  1982. \009\009\009\009\009\009end\
  1983. \009\009\009\009\009end\
  1984. \009\009\009\009\009waitFor = false\
  1985. \009\009\009\009\009comp = false\
  1986. \009\009\009\009\009return output\
  1987. \009\009\009\009end\
  1988. \009\009\009end\
  1989. \009\009else\
  1990. \009\009\009comp = false\
  1991. \009\009\009return result\
  1992. \009\009end\
  1993. \009else\
  1994. \009\009comp = false\
  1995. \009\009return keyWord\
  1996. \009end\
  1997. end",
  1998.     path = "//System/API/sysbar",
  1999.   },
  2000.   {
  2001.     text = "local xSize,ySize = term.getSize()\
  2002. local centerX,centerY = math.floor(xSize/2),math.floor(ySize/2)\
  2003. \
  2004. function findPeripheral(whatToFind)\
  2005.  local PeriList = peripheral.getNames()\
  2006.  for i=1,#PeriList do\
  2007.    if peripheral.getType(PeriList[i]) == whatToFind then\
  2008.      return PeriList[i]\
  2009.    end\
  2010.  end\
  2011. end\
  2012. \
  2013. function findWirelessModem()\
  2014. \009local periList = peripheral.getNames()\
  2015. \009for i=1,#periList do\
  2016. \009\009if peripheral.getType(periList[i]) == \"modem\" then\
  2017. \009\009\009local govno = peripheral.wrap(periList[i])\
  2018. \009\009\009if govno.isWireless() then\
  2019. \009\009\009\009return periList[i]\
  2020. \009\009\009end\
  2021. \009\009end\
  2022. \009end\
  2023. end\
  2024. \
  2025. function clickedAtArea(x,y,sx,sy,ex,ey)\
  2026.    if (x >= sx) and (x <= ex) and (y >= sy) and (y <= ey) then return true end    \
  2027.    return false\
  2028. end\
  2029. \
  2030. function toboolean(s)\
  2031. \009if s == \"true\" then\
  2032. \009\009return true\
  2033. \009else\
  2034. \009\009return false\
  2035. \009end\
  2036. end\
  2037. \
  2038. function colorText(x,y,text,textColor)\
  2039. \009term.setTextColor(textColor)\
  2040. \009term.setCursorPos(x,y)\
  2041. \009term.write(text)\
  2042. end\
  2043. \
  2044. function colorTextWithBack(x,y,text,textColor,backColor)\
  2045. \009term.setTextColor(textColor)\
  2046. \009term.setBackgroundColor(backColor)\
  2047. \009term.setCursorPos(x,y)\
  2048. \009term.write(text)\
  2049. end\
  2050. \
  2051. function usualText(x,y,text)\
  2052. \009term.setCursorPos(x,y)\
  2053. \009term.write(text)\
  2054. end\
  2055. \
  2056. function centerText(how,coord,text,textColor,backColor)\
  2057. \009term.setTextColor(textColor)\
  2058. \009term.setBackgroundColor(backColor)\
  2059. \009if how == \"xy\" then\
  2060. \009\009term.setCursorPos(math.floor(xSize/2-#text/2),math.floor(ySize/2))\
  2061. \009elseif how == \"x\" then\
  2062. \009\009term.setCursorPos(math.floor(xSize/2-#text/2),coord)\
  2063. \009elseif how == \"y\" then\
  2064. \009\009term.setCursorPos(coord,math.floor(ySize/2))\
  2065. \009end\
  2066. \009term.write(text)\
  2067. end\
  2068. \
  2069. function square(x1,y1,width,height,color)\
  2070. \009local string = string.rep(\" \",width)\
  2071. \009term.setBackgroundColor(color)\
  2072. \009for y=y1,(y1+height-1) do\
  2073. \009\009usualText(x1,y,string)\
  2074. \009end\
  2075. end\
  2076. \
  2077. function circle(cx, cy, radius, char, backColor, textColor)\
  2078. \009local x = radius\
  2079.    local y = 0\
  2080.    local radiusError = 1 - x\
  2081.    term.setTextColor(textColor)\
  2082.    term.setBackgroundColor(backColor)\
  2083.    while (x >= y) do\
  2084.        usualText(x + cx, y + cy, char)\
  2085.        usualText(y + cx, x + cy, char)\
  2086.        usualText(-x + cx, y + cy, char)\
  2087.        usualText(-y + cx, x + cy, char)\
  2088.        usualText(-x + cx, -y + cy, char)\
  2089.        usualText(-y + cx, -x + cy, char)\
  2090.        usualText(x + cx, -y + cy, char)\
  2091.        usualText(y + cx, -x + cy, char)\
  2092.        y = y + 1\
  2093.        if (radiusError < 0) then\
  2094.            radiusError = radiusError + (2 * y + 1)\
  2095.        else\
  2096.            x = x - 1\
  2097.            radiusError = radiusError + (2 * (y - x + 1))\
  2098.        end\
  2099.    end\
  2100. end\
  2101. \
  2102. function clearScreen(color)\
  2103. \009term.setBackgroundColor(color)\
  2104. \009term.clear()\
  2105. end\
  2106. \
  2107. function fadeIn(time)\
  2108. \009clearScreen(colors.gray)\
  2109. \009sleep(time)\
  2110. \009clearScreen(colors.lightGray)\
  2111. \009sleep(time)\
  2112. \009clearScreen(colors.white)\
  2113. \009sleep(time)\
  2114. end\
  2115. \
  2116. function fadeOut(time)\
  2117. \009clearScreen(colors.lightGray)\
  2118. \009sleep(time)\
  2119. \009clearScreen(colors.gray)\
  2120. \009sleep(time)\
  2121. \009clearScreen(colors.black)\
  2122. \009sleep(time)\
  2123. \009term.setCursorPos(1,1)\
  2124. \009term.setTextColor(colors.white)\
  2125. end\
  2126. \
  2127. function emptyWindow(xStart,yStart,xWindowSize,yWindowSize,title)\
  2128. \009--DRAW WINDOW\
  2129. \009square(xStart+1,yStart,xWindowSize,1,colors.white)\
  2130. \009colorText(math.floor(xStart+xWindowSize/2-#title/2),yStart,title,colors.gray)\
  2131. \
  2132. \009square(xStart+1,yStart+1,xWindowSize,yWindowSize-1,colors.white)\
  2133. end\
  2134. \
  2135. function sampleWindow(xStart,yStart,xWindowSize,yWindowSize)\
  2136. \009square(xStart+1,yStart,xWindowSize,yWindowSize,colors.white)\
  2137. end\
  2138. \
  2139. function stringLimit(mode,text,size,noDots)\
  2140. \009if string.len(text)<=size then return text end\
  2141. \009if mode == \"start\" then\
  2142. \009\009if noDots then\
  2143. \009\009\009return string.sub(text,#text-size+1,-1)\
  2144. \009\009else\
  2145. \009\009\009return \"...\"..string.sub(text,#text-size+4,-1)\
  2146. \009\009end\
  2147. \009else\
  2148. \009\009if noDots then\
  2149. \009\009\009return string.sub(text,1,size)\
  2150. \009\009else\
  2151. \009\009\009return string.sub(text,1,size-3)..\"...\"\
  2152. \009\009end\
  2153. \009end\
  2154. end\
  2155. \
  2156. function getFileFormat(path)\
  2157. \009local name = fs.getName(path)\
  2158. \009local starting,ending = string.find(name,\"(.)%.[%d%w]*$\")\
  2159. \009if starting == nil then\
  2160. \009\009return nil\
  2161. \009else\
  2162. \009\009return string.sub(name,starting+1,-1)\
  2163. \009end\
  2164. end\
  2165. \
  2166. function isFileHidden(path)\
  2167. \009local name = fs.getName(path)\
  2168. \009local starting,ending = string.find(name,\"^%.(.*)$\")\
  2169. \009if starting == nil then\
  2170. \009\009return false\
  2171. \009else\
  2172. \009\009return true\
  2173. \009end\
  2174. end\
  2175. \
  2176. function hideFileFormat(path)\
  2177. \009local name = fs.getName(path)\
  2178. \009local fileFormat = getFileFormat(name)\
  2179. \009if fileFormat == nil then\
  2180. \009\009return name\
  2181. \009else\
  2182. \009\009return string.sub(name,1,#name-#fileFormat)\
  2183. \009end\
  2184. end\
  2185. \
  2186. function getFileSize(path)\
  2187. \009local allFilesSize = 0\
  2188. \009if fs.isDir(path) then\
  2189. \009\009local fileList = fs.list(path)\
  2190. \009\009for i=1,#fileList do\
  2191. \009\009\009allFilesSize = allFilesSize + getFileSize(path..\"/\"..fileList[i])\
  2192. \009\009end\
  2193. \009else\
  2194. \009\009allFilesSize = allFilesSize + fs.getSize(path)\
  2195. \009end\
  2196. \009return allFilesSize\
  2197. end\
  2198. \
  2199. function getFileType(path)\
  2200. \009local fileTypes = {\
  2201. \009\009[\".png\"] = \"Image\",\
  2202. \009\009[\".cfg\"] = \"Config\",\
  2203. \009\009[\".zip\"] = \"Archive\",\
  2204. \009\009[\".app\"] = \"Application\",\
  2205. \009}\
  2206. \
  2207. \009local currentFileType = nil\
  2208. \
  2209. \009local fileFormat = getFileFormat(path)\
  2210. \009if fileFormat == nil then\
  2211. \009\009if fs.isDir(path) then\
  2212. \009\009\009currentFileType = \"Folder\"\
  2213. \009\009else\
  2214. \009\009\009currentFileType = \"Lua script\"\
  2215. \009\009end\
  2216. \009else\
  2217. \009\009currentFileType = fileTypes[fileFormat] or fileFormat\
  2218. \009end\
  2219. \009\
  2220. \009return currentFileType\
  2221. end\
  2222. \
  2223. function reorganizeFilesAndFolders(workPath,massivSudaPihay,showHiddenFiles,showSystemFolders)\
  2224. \009local reorganizedMassiv = {}\
  2225. \009local function doGovno(i)\
  2226. \009\009if showHiddenFiles then\
  2227. \009\009\009reorganizedMassiv[#reorganizedMassiv+1] = massivSudaPihay[i]\
  2228. \009\009else\
  2229. \009\009\009if not windows.isFileHidden(workPath..\"/\"..massivSudaPihay[i]) then\
  2230. \009\009\009\009reorganizedMassiv[#reorganizedMassiv+1] = massivSudaPihay[i]\
  2231. \009\009\009end\
  2232. \009\009end\
  2233. \009end\
  2234. \009local filePath = nil\
  2235. \009for i=1,#massivSudaPihay do\
  2236. \009\009filePath = workPath..\"/\"..massivSudaPihay[i]\
  2237. \009\009if fs.isDir(filePath) and windows.getFileFormat(filePath) ~= \".app\" then\
  2238. \009\009\009if showSystemFolders then\
  2239. \009\009\009\009doGovno(i)\
  2240. \009\009\009else\
  2241. \009\009\009\009if massivSudaPihay[i] ~= \"rom\" and massivSudaPihay[i] ~= \"System\" then\
  2242. \009\009\009\009\009--windows.attention({\"massiv[i] = \"..massivSudaPihay[i]},{\"heh\"})\
  2243. \009\009\009\009\009doGovno(i)\
  2244. \009\009\009\009end\
  2245. \009\009\009end\
  2246. \009\009end\
  2247. \009end\
  2248. \009for i=1,#massivSudaPihay do\
  2249. \009\009filePath = workPath..\"/\"..massivSudaPihay[i]\
  2250. \009\009if not fs.isDir(filePath) and massivSudaPihay[i] ~= \"OS\" or fs.isDir(filePath) and windows.getFileFormat(filePath) == \".app\" then\
  2251. \009\009\009doGovno(i)\
  2252. \009\009end\
  2253. \009end\
  2254. \009return reorganizedMassiv\
  2255. end\
  2256. \
  2257. function drawOSIcon(xIconPos,yIconPos,workPath,name,fileFormat)\
  2258. \009if not fs.isDir(workPath..\"/\"..name) then\
  2259. \009\009if fileFormat == \".png\" then\
  2260. \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/image.png\")\
  2261. \009\009elseif fileFormat == \".cfg\" then\
  2262. \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/config.png\")\
  2263. \009\009elseif fileFormat == \".zip\" then\
  2264. \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/zip.png\")\
  2265. \009\009else\
  2266. \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/default.png\")\
  2267. \009\009end\
  2268. \009else\
  2269. \009\009local iconPath = workPath..\"/\"..name..\"/Resources/icon.png\"\
  2270. \009\009if fileFormat == \".app\" and fs.exists(iconPath) then\
  2271. \009\009\009image.draw(xIconPos,yIconPos,iconPath)\
  2272. \009\009elseif string.sub(name,1,4)==\"disk\" then\
  2273. \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/disk.png\")\
  2274. \009\009else\
  2275. \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/folder.png\")\
  2276. \009\009end\
  2277. \009end\
  2278. end\
  2279. \
  2280. local function correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
  2281. \009if xStart == \"auto\" then\
  2282. \009\009xStart = math.floor(xSize/2 - xWindowSize/2)\
  2283.                xStart = xStart+1\
  2284. \009end\
  2285. \009if yStart == \"auto\" then\
  2286. \009\009yStart = math.floor(ySize/2 - yWindowSize/2)\
  2287. \009end\
  2288. \009return xStart,yStart\
  2289. end\
  2290. \
  2291. function button(x,y,xOffset,yOffset,text,textColor,backColor)\
  2292. \009local width = xOffset*2+#text\
  2293. \009local height = yOffset*2+1\
  2294. \009x,y = correctStartCoords(x,y,width,height)\
  2295. \009square(x,y,width,height,backColor)\
  2296. \009colorText(x+xOffset,y+yOffset,text,textColor)\
  2297. \009return x,y,x+width-1,y+height-1\
  2298. end\
  2299. \
  2300. local function drawProgressBar(xStart,yStart,width,height,frontColor,backColor,percent)\
  2301. \009local doneSize = math.ceil(percent/100*width)\
  2302. \
  2303. \009square(xStart,yStart,width,height,backColor)\
  2304. \009square(xStart,yStart,doneSize,height,frontColor)\
  2305. end\
  2306. \
  2307. function scrollBar(xStart,yStart,height,countOfAllElements,currentElement,backColor,frontColor)\
  2308. \009local percent = 1/countOfAllElements\
  2309. \009local sizeOfScrollBar = math.ceil(percent * height)\
  2310. \009local displayBarFrom = math.floor(yStart + height*((currentElement-1)/countOfAllElements))\
  2311. \
  2312. \009for i=yStart,(yStart+height-1) do\
  2313. \009\009paintutils.drawPixel(xStart,i,backColor)\
  2314. \009end\
  2315. \
  2316. \009for i=displayBarFrom,(displayBarFrom+sizeOfScrollBar-1) do\
  2317. \009\009paintutils.drawPixel(xStart,i,frontColor)\
  2318. \009end\
  2319. end\
  2320. \
  2321. function searchInAllFiles(path,whatToFind)\
  2322. \
  2323. \009local function poiskSovpadeniya(name)\
  2324. \009\009local starting,ending = string.find(string.lower(name),string.lower(whatToFind))\
  2325. \009\009if starting == nil then\
  2326. \009\009\009return false\
  2327. \009\009else\
  2328. \009\009\009return true\
  2329. \009\009end\
  2330. \009end\
  2331. \
  2332. \009local searchMassiv = {}\
  2333. \
  2334. \009local function createFileMassiv(path,whatToFind)\
  2335. \009\009local fileList = fs.list(path)\
  2336. \009\009for i=1,#fileList do\
  2337. \009\009\009if fs.isDir(path..\"/\"..fileList[i]) then\
  2338. \009\009\009\009if poiskSovpadeniya(fileList[i]) then\
  2339. \009\009\009\009\009searchMassiv[#searchMassiv+1] = {[\"path\"]=path,[\"name\"]=fileList[i],[\"isDir\"]=true,[\"fileSize\"]=getFileSize(path..\"/\"..fileList[i]),[\"fileType\"]=getFileType(path..\"/\"..fileList[i]),[\"fileFormat\"]=getFileFormat(path..\"/\"..fileList[i])}\
  2340. \009\009\009\009end\
  2341. \009\009\009\009createFileMassiv(path..\"/\"..fileList[i],whatToFind)\
  2342. \009\009\009else\
  2343. \009\009\009\009if poiskSovpadeniya(fileList[i]) then\
  2344. \009\009\009\009\009searchMassiv[#searchMassiv+1] = {[\"path\"]=path,[\"name\"]=fileList[i],[\"isDir\"]=false,[\"fileSize\"]=getFileSize(path..\"/\"..fileList[i]),[\"fileType\"]=getFileType(path..\"/\"..fileList[i]),[\"fileFormat\"]=getFileFormat(path..\"/\"..fileList[i])}\
  2345. \009\009\009\009end\
  2346. \009\009\009end\
  2347. \009\009end\
  2348. \009end\
  2349. \009createFileMassiv(path,whatToFind)\
  2350. \009return searchMassiv\
  2351. \
  2352. end\
  2353. \
  2354. local colorCodes = {\
  2355. \009{[\"code\"] = \"&0\", [\"color\"] = 1},\
  2356. \009{[\"code\"] = \"&1\", [\"color\"] = 2},\
  2357. \009{[\"code\"] = \"&2\", [\"color\"] = 4},\
  2358. \009{[\"code\"] = \"&3\", [\"color\"] = 8},\
  2359. \009{[\"code\"] = \"&4\", [\"color\"] = 16},\
  2360. \009{[\"code\"] = \"&5\", [\"color\"] = 32},\
  2361. \009{[\"code\"] = \"&6\", [\"color\"] = 64},\
  2362. \009{[\"code\"] = \"&7\", [\"color\"] = 128},\
  2363. \009{[\"code\"] = \"&8\", [\"color\"] = 256},\
  2364. \009{[\"code\"] = \"&9\", [\"color\"] = 512},\
  2365. \009{[\"code\"] = \"&a\", [\"color\"] = 1024},\
  2366. \009{[\"code\"] = \"&b\", [\"color\"] = 2048},\
  2367. \009{[\"code\"] = \"&c\", [\"color\"] = 4096},\
  2368. \009{[\"code\"] = \"&d\", [\"color\"] = 8192},\
  2369. \009{[\"code\"] = \"&e\", [\"color\"] = 16384},\
  2370. \009{[\"code\"] = \"&f\", [\"color\"] = 32768},\
  2371. }\
  2372. \
  2373. function foramattedText(text)\
  2374. \009local color = colors.white\
  2375. \009term.setTextColor(color)\
  2376. \009local sText = #text\
  2377. \009local searchFrom = 1\
  2378. \
  2379. \009local exit = false\
  2380. \009while true do\
  2381. \009\009if exit then break end\
  2382. \009\009local founded = false\
  2383. \009\009local s,e = string.find(text,\"&\",searchFrom)\
  2384. \009\009if s then\
  2385. \009\009\009local code = string.sub(text,s,s+1)\
  2386. \009\009\009for i=1,16 do\
  2387. \009\009\009\009if code == colorCodes[i][\"code\"] then\
  2388. \
  2389. \009\009\009\009\009local cyka = string.sub(text,searchFrom,s-1)\
  2390. \009\009\009\009\009term.write(cyka)\
  2391. \
  2392. \009\009\009\009\009color = colorCodes[i][\"color\"]\
  2393. \009\009\009\009\009term.setTextColor(color)\
  2394. \
  2395. \009\009\009\009\009founded = true\
  2396. \009\009\009\009\009searchFrom = searchFrom + #cyka + 2\
  2397. \009\009\009\009\009break\
  2398. \009\009\009\009end\
  2399. \009\009\009end\
  2400. \009\009end\
  2401. \009\009\
  2402. \009\009if not founded then\
  2403. \009\009\009term.write(string.sub(text,searchFrom,-1))\
  2404. \009\009\009exit = true\
  2405. \009\009end\
  2406. \009end\
  2407. end\
  2408. \
  2409. ---------------------------------------------------------------------------------------------------------------\
  2410. \
  2411. function error(text1)\
  2412. \009\
  2413. \009local title = \"Error\"\
  2414. \009local limit = xSize - 11\
  2415. \009local sizeOfText1 = #text1\
  2416. \
  2417. \009local parsedErr = {}\
  2418. \009for i=1,(math.ceil(sizeOfText1/limit)) do\
  2419. \009\009parsedErr[#parsedErr+1] = string.sub(text1,i*limit+1-limit,i*limit)\
  2420. \009end\
  2421. \
  2422. \009local theLongestElement = #title\
  2423. \009for i=1,#parsedErr do\
  2424. \009\009local size = #parsedErr[i]\
  2425. \009\009if size > theLongestElement then theLongestElement = size end\
  2426. \009end\
  2427. \009\
  2428. \009local xWindowSize = 9 + theLongestElement + 2\
  2429. \009local yWindowSize = 2 + 1 + 1 + #parsedErr + 3\
  2430. \009local xStart = math.floor(xSize/2-xWindowSize/2)\
  2431. \009local yStart = math.floor(ySize/2-yWindowSize/2)\
  2432. \009\
  2433. \009emptyWindow(0,yStart,xSize,yWindowSize,\" \")\
  2434. \
  2435. \009--DRAW ICON\
  2436. \009paintutils.drawPixel(xStart+4,yStart+2,colors.red)\
  2437. \009paintutils.drawPixel(xStart+3,yStart+3,colors.red)\
  2438. \009paintutils.drawPixel(xStart+4,yStart+3,colors.red)\
  2439. \009paintutils.drawPixel(xStart+5,yStart+3,colors.red)\
  2440. \009paintutils.drawPixel(xStart+2,yStart+4,colors.red)\
  2441. \009paintutils.drawPixel(xStart+3,yStart+4,colors.red)\
  2442. \009paintutils.drawPixel(xStart+4,yStart+4,colors.red)\
  2443. \009paintutils.drawPixel(xStart+5,yStart+4,colors.red)\
  2444. \009\
  2445. \009paintutils.drawPixel(xStart+6,yStart+4,colors.red)\
  2446. \009colorText(xStart+4,yStart+3,\"!\",colors.white)\
  2447. \009\
  2448. \009--ERROR TEXT\
  2449. \009term.setBackgroundColor(colors.white)\
  2450. \
  2451. \009colorText(xStart+9,yStart+2,title,colors.gray)\
  2452. \
  2453. \009for i=1,#parsedErr do\
  2454. \009\009colorText(xStart+9,yStart+3+i,parsedErr[i],colors.lightGray)\
  2455. \009end\
  2456. \
  2457. \009--BUTTON\
  2458. \009local function drawButton(color,color2)\
  2459. \009\009for x=(xStart+xWindowSize-8),(xStart+xWindowSize-3) do\
  2460. \009\009\009paintutils.drawPixel(x,yStart+yWindowSize-2,color)\
  2461. \009\009end\
  2462. \009\009colorText(xStart+xWindowSize-6,yStart+yWindowSize-2,\"OK\",color2)\
  2463. \009end\
  2464. \009drawButton(colors.lightBlue,colors.black)\
  2465. \009\
  2466. \009while true do\
  2467. \009\009local event,side,x,y = os.pullEvent()\
  2468. \009\009if event == \"mouse_click\" then\
  2469. \009\009\009if x>=xStart+xWindowSize-8 and x<=xStart+xWindowSize-3 and y == yStart+yWindowSize-2 then\
  2470. \009\009\009\009drawButton(colors.blue,colors.white)\
  2471. \009\009\009\009sleep(0.2)\
  2472. \009\009\009\009break\
  2473. \009\009\009end\
  2474. \009\009elseif event == \"key\" then\
  2475. \009\009\009if side == 28 then\
  2476. \009\009\009\009drawButton(colors.blue,colors.white)\
  2477. \009\009\009\009sleep(0.2)\
  2478. \009\009\009\009break\
  2479. \009\009\009end\
  2480. \009\009end\
  2481. \009end\
  2482. end\
  2483. \
  2484. ---------------------------------------------------------------------------------------------------------------\
  2485. \
  2486. function attention(text1,text2)\
  2487. \
  2488. \009local sizeOfText1 = #text1\
  2489. \009local sizeOfText2 = #text2\
  2490. \
  2491. \009local theLongestElement = 0\
  2492. \009for i=1,sizeOfText1 do\
  2493. \009\009if #text1[i] > theLongestElement then theLongestElement = #text1[i] end\
  2494. \009end\
  2495. \009for i=1,sizeOfText2 do\
  2496. \009\009if #text2[i] > theLongestElement then theLongestElement = #text2[i] end\
  2497. \009end\
  2498. \
  2499. \009local xWindowSize = 9 + theLongestElement + 2\
  2500. \009local yWindowSize = 2 + sizeOfText1 + 1 + sizeOfText2 + 3\
  2501. \009local xStart = math.floor(xSize/2-xWindowSize/2)\
  2502. \009local yStart = math.floor(ySize/2-yWindowSize/2)\
  2503. \009\
  2504. \009emptyWindow(0,yStart,xSize,yWindowSize,\" \")\
  2505. \
  2506. \009--DRAW ICON\
  2507. \009paintutils.drawPixel(xStart+4,yStart+2,colors.yellow)\
  2508. \009paintutils.drawPixel(xStart+3,yStart+3,colors.yellow)\
  2509. \009paintutils.drawPixel(xStart+4,yStart+3,colors.yellow)\
  2510. \009paintutils.drawPixel(xStart+5,yStart+3,colors.yellow)\
  2511. \009paintutils.drawPixel(xStart+2,yStart+4,colors.yellow)\
  2512. \009paintutils.drawPixel(xStart+3,yStart+4,colors.yellow)\
  2513. \009paintutils.drawPixel(xStart+4,yStart+4,colors.yellow)\
  2514. \009paintutils.drawPixel(xStart+5,yStart+4,colors.yellow)\
  2515. \009paintutils.drawPixel(xStart+6,yStart+4,colors.yellow)\
  2516. \009colorText(xStart+4,yStart+3,\"!\",colors.white)\
  2517. \009\
  2518. \009--ERROR TEXT\
  2519. \009term.setBackgroundColor(colors.white)\
  2520. \009for i=1,sizeOfText1 do\
  2521. \009\009colorText(xStart+9,yStart+1+i,text1[i],colors.gray)\
  2522. \009end\
  2523. \009for i=1,sizeOfText2 do\
  2524. \009\009colorText(xStart+9,yStart+3+i,text2[i],colors.lightGray)\
  2525. \009end\
  2526. \
  2527. \009--BUTTON\
  2528. \009local function drawButton(color,color2)\
  2529. \009\009for x=(xStart+xWindowSize-8),(xStart+xWindowSize-3) do\
  2530. \009\009\009paintutils.drawPixel(x,yStart+yWindowSize-2,color)\
  2531. \009\009end\
  2532. \009\009colorText(xStart+xWindowSize-6,yStart+yWindowSize-2,\"OK\",color2)\
  2533. \009end\
  2534. \009drawButton(colors.lightBlue,colors.black)\
  2535. \009\
  2536. \009while true do\
  2537. \009\009local event,side,x,y = os.pullEvent()\
  2538. \009\009if event == \"mouse_click\" then\
  2539. \009\009\009if x>=xStart+xWindowSize-8 and x<=xStart+xWindowSize-3 and y == yStart+yWindowSize-2 then\
  2540. \009\009\009\009drawButton(colors.blue,colors.white)\
  2541. \009\009\009\009sleep(0.2)\
  2542. \009\009\009\009break\
  2543. \009\009\009end\
  2544. \009\009elseif event == \"key\" then\
  2545. \009\009\009if side == 28 then\
  2546. \009\009\009\009drawButton(colors.blue,colors.white)\
  2547. \009\009\009\009sleep(0.2)\
  2548. \009\009\009\009break\
  2549. \009\009\009end\
  2550. \009\009end\
  2551. \009end\
  2552. end\
  2553. \
  2554. ---------------------------------------------------------------------------------------------------------------\
  2555. \
  2556. function input(...)\
  2557. \009\
  2558. \009local xStart = arg[1]\
  2559. \009local yStart = arg[2]\
  2560. \009local title = arg[3]\
  2561. \009local sizeOfInputRow = arg[4]\
  2562. \
  2563. \009local sizeOfText1 = #arg-4\
  2564. \
  2565. \009local Inputs = {}\
  2566. \
  2567. \009local allowToPressOk = true\
  2568. \
  2569. \009local inputCounter = 1\
  2570. \
  2571. \009local theLongestElement = 0\
  2572. \009for i=1,sizeOfText1 do\
  2573. \009\009if #arg[i+4][1] > theLongestElement then theLongestElement = #arg[i+4][1] end\
  2574. \009end\
  2575. \
  2576. \009local xWindowSize = 2 + theLongestElement + 1 + sizeOfInputRow + 2\
  2577. \009local yWindowSize = 2 + sizeOfText1 * 2 + 1 + 1\
  2578. \
  2579. \009xStart, yStart = correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
  2580. \
  2581. \009for i=1,sizeOfText1 do\
  2582. \009\009Inputs[i]=arg[i+4][2]\
  2583. \009end\
  2584. \
  2585. \009local Objects = {}\
  2586. \009local function newObj(class,name,x1,y1,width,height)\
  2587. \009\009Objects[class] = Objects[class] or {}\
  2588. \009\009Objects[class][name] = {}\
  2589. \009\009Objects[class][name][\"x1\"]=x1\
  2590. \009\009Objects[class][name][\"y1\"]=y1\
  2591. \009\009Objects[class][name][\"x2\"]=x1+width-1\
  2592. \009\009Objects[class][name][\"y2\"]=y1+height-1\
  2593. \009end\
  2594. \
  2595. \009emptyWindow(0,yStart,xSize,yWindowSize,title)\
  2596. \
  2597. \009--BUTTON\
  2598. \009local function drawButton(color,color2)\
  2599. \009\009for x=(xStart+xWindowSize-8),(xStart+xWindowSize-3) do\
  2600. \009\009\009paintutils.drawPixel(x,yStart+yWindowSize-2,color)\
  2601. \009\009end\
  2602. \009\009colorText(xStart+xWindowSize-6,yStart+yWindowSize-2,\"OK\",color2)\
  2603. \009end\
  2604. \009\
  2605. \009local function drawInputs()\
  2606. \009\009for i=1,sizeOfText1 do\
  2607. \009\009\009local xPosOfInput = xStart+xWindowSize - 2 - sizeOfInputRow\
  2608. \009\009\009local yPosOfInput = yStart+i*2\
  2609. \
  2610. \009\009\009local inputArgument = arg[i+4]\
  2611. \
  2612. \009\009\009term.setBackgroundColor(colors.white)\
  2613. \009\009\009if inputCounter == i then\
  2614. \009\009\009\009colorText(xStart+2,yPosOfInput,inputArgument[1],colors.gray)\
  2615. \009\009\009else\
  2616. \009\009\009\009colorText(xStart+2,yPosOfInput,inputArgument[1],colors.lightGray)\
  2617. \009\009\009end\
  2618. \
  2619. \009\009\009square(xPosOfInput,yPosOfInput,sizeOfInputRow,1,colors.lightGray)\
  2620. \009\009\009newObj(\"inputs\",i,xPosOfInput,yPosOfInput,sizeOfInputRow,1)\
  2621. \
  2622. \009\009\009if Inputs[i] ~= nil then\
  2623. \009\009\009\009if inputArgument[3] == nil then\
  2624. \009\009\009\009\009colorText(xPosOfInput,yPosOfInput,stringLimit(\"start\",Inputs[i],sizeOfInputRow),colors.black)\
  2625. \009\009\009\009else\
  2626. \009\009\009\009\009colorText(xPosOfInput,yPosOfInput,stringLimit(\"start\",string.rep(\"*\",#Inputs[i]),sizeOfInputRow),colors.black)\
  2627. \009\009\009\009end\
  2628. \009\009\009end\
  2629. \009\009\009\
  2630. \009\009\009if inputCounter > sizeOfText1 then allowToPressOk = true end\
  2631. \009\009end\
  2632. \
  2633. \009\009if allowToPressOk then\
  2634. \009\009\009drawButton(colors.lightBlue,colors.black)\
  2635. \009\009else\
  2636. \009\009\009drawButton(colors.lightGray,colors.black)\
  2637. \009\009end\
  2638. \009end\
  2639. \
  2640. \009drawInputs()\
  2641. \009\
  2642. \009local currentInput = \"\"\
  2643. \
  2644. \009while true do\
  2645. \009\009if Inputs[inputCounter] ~= nil then currentInput = Inputs[inputCounter] end\
  2646. \
  2647. \009\009term.setCursorBlink(false)\
  2648. \009\009drawInputs(inputCounter)\
  2649. \009\009term.setCursorBlink(true)\
  2650. \
  2651. \009\009if #currentInput < sizeOfInputRow and inputCounter <= sizeOfText1 then\
  2652. \009\009\009term.setCursorPos(xStart+xWindowSize-2-sizeOfInputRow+#currentInput,yStart+inputCounter*2)\
  2653. \009\009elseif #currentInput >= sizeOfInputRow and inputCounter <= sizeOfText1 then\
  2654. \009\009\009term.setCursorPos(xStart+xWindowSize-3,yStart+inputCounter*2)\
  2655. \009\009else\
  2656. \009\009\009term.setCursorBlink(false)\
  2657. \009\009end\
  2658. \
  2659. \009\009local event,side,x,y = os.pullEvent()\
  2660. \009\009if event == \"key\" then\
  2661. \009\009\009if side == 28 then\
  2662. \009\009\009\009if currentInput ~= \"\" then\
  2663. \009\009\009\009\009currentInput = \"\"\
  2664. \009\009\009\009else\
  2665. \009\009\009\009\009Inputs[inputCounter] = currentInput\009\
  2666. \009\009\009\009end\
  2667. \
  2668. \009\009\009\009if inputCounter < sizeOfText1 then\
  2669. \009\009\009\009\009inputCounter = inputCounter + 1\
  2670. \009\009\009\009else\
  2671. \009\009\009\009\009term.setCursorBlink(false)\
  2672. \009\009\009\009\009drawButton(colors.blue,colors.white)\
  2673. \009\009\009\009\009sleep(0.2)\
  2674. \009\009\009\009\009return Inputs\
  2675. \009\009\009\009end\
  2676. \009\009\009elseif side == 14 then\
  2677. \009\009\009\009currentInput = string.sub(currentInput,1,-2)\
  2678. \009\009\009\009Inputs[inputCounter] = currentInput\
  2679. \009\009\009elseif side == 200 then\
  2680. \009\009\009\009inputCounter = inputCounter - 1\
  2681. \009\009\009\009if inputCounter < 1 then inputCounter = 1 end\
  2682. \009\009\009elseif side == 208 then\
  2683. \009\009\009\009inputCounter = inputCounter + 1\
  2684. \009\009\009\009if inputCounter > #Inputs then inputCounter = #Inputs end\
  2685. \009\009\009end\
  2686. \009\009elseif event == \"mouse_click\" then\
  2687. \009\009\009term.setCursorBlink(false)\
  2688. \009\009\009if x>=xStart+xWindowSize-8 and x<=xStart+xWindowSize-3 and y == yStart+yWindowSize-2 and allowToPressOk == true then\
  2689. \009\009\009\009drawButton(colors.blue,colors.white)\
  2690. \009\009\009\009sleep(0.2)\
  2691. \009\009\009\009return Inputs\
  2692. \009\009\009end\
  2693. \009\009\009for key,val in pairs(Objects[\"inputs\"]) do\
  2694. \009\009\009\009if x>=Objects[\"inputs\"][key][\"x1\"] and x<=Objects[\"inputs\"][key][\"x2\"] and y==Objects[\"inputs\"][key][\"y1\"] then\
  2695. \009\009\009\009\009inputCounter = key\
  2696. \009\009\009\009\009break\
  2697. \009\009\009\009end\
  2698. \009\009\009end\
  2699. \009\009elseif event == \"char\" then\
  2700. \009\009\009currentInput = currentInput..side\
  2701. \009\009\009Inputs[inputCounter] = currentInput\
  2702. \009\009elseif event == \"paste\" then\
  2703. \009\009\009currentInput = currentInput..side\
  2704. \009\009\009Inputs[inputCounter] = currentInput\
  2705. \009\009end\
  2706. \009end\
  2707. end\
  2708. \
  2709. ---------------------------------------------------------------------------------------------------------------------\
  2710. \
  2711. function tv(speed)\
  2712. \009term.setBackgroundColor(colors.black)\
  2713. \009for i=1,centerY do\
  2714. \009\009term.setCursorPos(1,i)\
  2715. \009\009term.clearLine()\
  2716. \009\009term.setCursorPos(1,ySize-i+1)\
  2717. \009\009term.clearLine()\
  2718. \009\009sleep(speed)\
  2719. \009end\
  2720. \009for i=1,centerX do\
  2721. \009\009paintutils.drawPixel(i,centerY+1,colors.black)\
  2722. \009\009paintutils.drawPixel(xSize-i+1,centerY+1,colors.black)\
  2723. \009\009sleep(speed)\
  2724. \009end\
  2725. \009sleep(0.2)\
  2726. \009clearScreen(colors.black)\
  2727. \009term.setTextColor(colors.white)\
  2728. \009term.setCursorPos(1,1)\
  2729. end\
  2730. \
  2731. ---------------------------------------------------------------------------------------------------------------------\
  2732. \
  2733. function select(...)\
  2734. \
  2735. \009local Objects = {}\
  2736. \009local function newObj(class,name,x1,y1,width,height)\
  2737. \009\009--if not Objects[class] then Objects[class] = {} end\
  2738. \009\009Objects[class] = Objects[class] or {}\
  2739. \009\009Objects[class][name] = {}\
  2740. \009\009Objects[class][name][\"x1\"]=x1\
  2741. \009\009Objects[class][name][\"y1\"]=y1\
  2742. \009\009Objects[class][name][\"x2\"]=x1+width-1\
  2743. \009\009Objects[class][name][\"y2\"]=y1+height-1\
  2744. \009end\
  2745. \
  2746. \009local function drawButton(x,y,name,textColor,backColor)\
  2747. \009\009local sizeOfButton = 2+#name+2\
  2748. \009\009square(x,y,sizeOfButton,1,backColor)\
  2749. \009\009colorText(x+2,y,name,textColor)\
  2750. \009\009newObj(\"buttons\",name,x,y,sizeOfButton,1)\
  2751. \009end\
  2752. \
  2753. \009local text1 = arg[1]\
  2754. \009local text2 = arg[2]\
  2755. \
  2756. \009local sizeOfText1 = #text1\
  2757. \009local sizeOfText2 = #text2\
  2758. \009local hereIsOnlyOneElement = false\
  2759. \009if sizeOfText1 == 0 then hereIsOnlyOneElement = true end\
  2760. \
  2761. \009local theLongestElement = 0\
  2762. \009for i=1,sizeOfText1 do\
  2763. \009\009if #text1[i] > theLongestElement then theLongestElement = #text1[i] end\
  2764. \009end\
  2765. \009for i=1,sizeOfText2 do\
  2766. \009\009if #text2[i] > theLongestElement then theLongestElement = #text2[i] end\
  2767. \009end\
  2768. \
  2769. \009local countOfButtons = #arg-2\
  2770. \009local sizeOfAllButtons = 0\
  2771. \009for i=1,countOfButtons do\
  2772. \009\009sizeOfAllButtons = sizeOfAllButtons + 2+#arg[2+i][1]+2 + 1\
  2773. \009end\
  2774. \009sizeOfAllButtons = sizeOfAllButtons - 1\
  2775. \009if sizeOfAllButtons>theLongestElement then theLongestElement=sizeOfAllButtons end\
  2776. \
  2777. \009local xWindowSize = 2 + theLongestElement + 2\
  2778. \009local yWindowSize = nil\
  2779. \009if hereIsOnlyOneElement then\
  2780. \009\009yWindowSize = 2 + sizeOfText2 + 3\
  2781. \009else\
  2782. \009\009yWindowSize = 2 + sizeOfText1 + 1 + sizeOfText2 + 3\
  2783. \009end\
  2784. \
  2785. \009local xStart = math.floor(xSize/2-xWindowSize/2)\
  2786. \009local yStart = math.floor(ySize/2-yWindowSize/2)\
  2787. \009\
  2788. \009sampleWindow(0,yStart,xSize,yWindowSize,\" \")\
  2789. \
  2790. \009--TEXTS\
  2791. \009term.setBackgroundColor(colors.white)\
  2792. \009for i=1,sizeOfText1 do\
  2793. \009\009colorText(xStart+3,yStart+1+i,text1[i],colors.gray)\
  2794. \009end\
  2795. \009for i=1,sizeOfText2 do\
  2796. \009\009if hereIsOnlyOneElement then\
  2797. \009\009\009colorText(xStart+3,yStart+1+sizeOfText1+i,text2[i],colors.lightGray)\
  2798. \009\009else\
  2799. \009\009\009colorText(xStart+3,yStart+2+sizeOfText1+i,text2[i],colors.lightGray)\
  2800. \009\009end\
  2801. \009end\
  2802. \
  2803. \009local xStartForButtons = xStart+xWindowSize-1 - sizeOfAllButtons - 1\
  2804. \009local yStartForButtons = yStart+yWindowSize-2\
  2805. \009for i=1,countOfButtons do\
  2806. \009\009local text = arg[2+i][1]\
  2807. \009\009local textColor = tonumber(arg[2+i][3])\
  2808. \009\009local backColor = tonumber(arg[2+i][2])\
  2809. \
  2810. \009\009drawButton(xStartForButtons+1,yStartForButtons,text,textColor,backColor)\
  2811. \009\009xStartForButtons = xStartForButtons + 2+#arg[2+i][1]+2+1\
  2812. \009end\
  2813. \
  2814. \009while true do\
  2815. \009\009local event,side,x,y = os.pullEvent()\
  2816. \009\009if event == \"mouse_click\" then\
  2817. \009\009\009for key,val in pairs(Objects[\"buttons\"]) do\
  2818. \009\009\009\009if x>=Objects[\"buttons\"][key][\"x1\"] and x<=Objects[\"buttons\"][key][\"x2\"] and y==Objects[\"buttons\"][key][\"y1\"] then\
  2819. \009\009\009\009\009drawButton(Objects[\"buttons\"][key][\"x1\"],Objects[\"buttons\"][key][\"y1\"],key,colors.white,colors.blue)\
  2820. \009\009\009\009\009sleep(0.2)\
  2821. \009\009\009\009\009return key\
  2822. \009\009\009\009end\
  2823. \009\009\009end\
  2824. \009\009end\
  2825. \009end\
  2826. end\
  2827. \
  2828. ---------------------------------------------------------------------------------------------------------------------\
  2829. \
  2830. function aboutFile(x,y,xWindowSize,path)\
  2831. \009os.loadAPI(\"System/API/image\")\
  2832. \
  2833. \009local name = fs.getName(path)\
  2834. \009local limitOfText = xWindowSize - 2\
  2835. \009local yWindowSize = 16\
  2836. \
  2837. \009local Objects = {}\
  2838. \009local function newObj(class,name,x1,y1,width,height)\
  2839. \009\009Objects[class] = Objects[class] or {}\
  2840. \009\009Objects[class][name] = {}\
  2841. \009\009Objects[class][name][\"x1\"]=x1\
  2842. \009\009Objects[class][name][\"y1\"]=y1\
  2843. \009\009Objects[class][name][\"x2\"]=x1+width-1\
  2844. \009\009Objects[class][name][\"y2\"]=y1+height-1\
  2845. \009end\
  2846. \
  2847. \009local function drawButton(x,y,name,textColor,backColor)\
  2848. \009\009local sizeOfButton = 2+#name+2\
  2849. \009\009square(x,y,sizeOfButton,1,backColor)\
  2850. \009\009colorText(x+2,y,name,textColor)\
  2851. \009\009newObj(\"buttons\",name,x,y,sizeOfButton,1)\
  2852. \009end\
  2853. \
  2854. \
  2855. \009local info = {}\
  2856. \
  2857. \009info[\"fileFormat\"] = getFileFormat(path)\
  2858. \
  2859. \009info[\"fileType\"] = getFileType(path)\
  2860. \
  2861. \009info[\"fileSize\"] = math.ceil(getFileSize(path)/1024)..\"KB\"\
  2862. \
  2863. \009info[\"readOnly\"] = tostring(fs.isReadOnly(path))\
  2864. \009\
  2865. \009if y+yWindowSize - 1  >= ySize then y = y - (y+yWindowSize - 1 - ySize) - 1 end\
  2866. \009if x+xWindowSize - 1  >= xSize then x = x - (x+xWindowSize - 1 - xSize) - 1 end\
  2867. \
  2868. \009emptyWindow(x,y,xWindowSize,yWindowSize,\"Properties\")\
  2869. \
  2870. \009drawOSIcon(x+1,y+2,path,name,info[\"fileFormat\"])\
  2871. \
  2872. \009square(x,y+7,xWindowSize,1,colors.lightGray)\
  2873. \009colorText(x+1,y+7,\"Info\",colors.white)\
  2874. \
  2875. \009term.setBackgroundColor(colors.white)\
  2876. \009colorText(x+8,y+3,stringLimit(\"start\",name,xWindowSize-9),colors.gray)\
  2877. \009colorText(x+8,y+4,info[\"fileSize\"],colors.lightGray)\
  2878. \
  2879. \009local textStart = y+9\
  2880. \009colorText(x+1,textStart,\"Type:\",colors.gray)\
  2881. \009usualText(x+1,textStart+1,\"Size:\",colors.gray)\
  2882. \009usualText(x+1,textStart+2,\"Path:\",colors.gray)\
  2883. \009usualText(x+1,textStart+3,\"Read only:\",colors.gray)\
  2884. \
  2885. \009colorText(x+7,textStart,info[\"fileType\"],colors.lightGray)\
  2886. \009usualText(x+7,textStart+1,info[\"fileSize\"])\
  2887. \009usualText(x+7,textStart+2,stringLimit(\"start\",path,xWindowSize-8))\
  2888. \009usualText(x+12,textStart+3,info[\"readOnly\"])\
  2889. \
  2890. \009drawButton(x+xWindowSize-11,y+yWindowSize-2,\"Close\",colors.black,colors.lightBlue)\
  2891. \
  2892. \009while true do\
  2893. \009\009local event,side,x,y = os.pullEvent()\
  2894. \009\009if event == \"mouse_click\" then\
  2895. \009\009\009for key,val in pairs(Objects[\"buttons\"]) do\
  2896. \009\009\009\009if x>=Objects[\"buttons\"][key][\"x1\"] and x<=Objects[\"buttons\"][key][\"x2\"] and y==Objects[\"buttons\"][key][\"y1\"] then\
  2897. \009\009\009\009\009drawButton(Objects[\"buttons\"][key][\"x1\"],Objects[\"buttons\"][key][\"y1\"],key,colors.white,colors.blue)\
  2898. \009\009\009\009\009sleep(0.2)\
  2899. \009\009\009\009\009return key\
  2900. \009\009\009\009end\
  2901. \009\009\009end\
  2902. \009\009end\
  2903. \009end\
  2904. end\
  2905. \
  2906. ---------------------------------------------------------------------------------------------------------------------\
  2907. \
  2908. function progressBar(xStart,yStart,xWindowSize,title,text,speed)\
  2909. \009if xWindowSize < 4+#text then\
  2910. \009\009xWindowSize = 4+#text\
  2911. \009end\
  2912. \
  2913. \009local yWindowSize = 6\
  2914. \009local sizeOfProgressBar = xWindowSize - 4\
  2915. \
  2916. \009xStart,yStart = correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
  2917. \
  2918. \009emptyWindow(xStart,yStart,xWindowSize,yWindowSize,title)\
  2919. \
  2920. \009term.setBackgroundColor(colors.white)\
  2921. \009colorText(math.floor(xStart+(xWindowSize/2-#text/2)),yStart+2,text,colors.gray)\
  2922. \
  2923. \009local xProgressBarPos = xStart+2\
  2924. \009local yProgressBarPos = yStart+4\
  2925. \009drawProgressBar(xProgressBarPos,yProgressBarPos,sizeOfProgressBar,1,colors.lightBlue,colors.lightGray,0)\
  2926. \009sleep(0)\
  2927. \009for i=1,100,speed do\
  2928. \009\009drawProgressBar(xProgressBarPos,yProgressBarPos,sizeOfProgressBar,1,colors.lightBlue,colors.lightGray,i)\
  2929. \009\009sleep(0)\
  2930. \009end\
  2931. \009drawProgressBar(xProgressBarPos,yProgressBarPos,sizeOfProgressBar,1,colors.lightBlue,colors.lightGray,100)\
  2932. end\
  2933. \
  2934. ---------------------------------------------------------------------------------------------------------------------\
  2935. \
  2936. function search(xStart,yStart,xWindowSize,limitOfElements,searchText)\
  2937. \
  2938. \009os.loadAPI(\"System/API/image\")\
  2939. \
  2940. \009local searchList = {}\
  2941. \
  2942. \009local sizeOfOneElement = 5\
  2943. \009local yWindowSize = 4 + sizeOfOneElement*limitOfElements\
  2944. \009local sizeOfSearchBar = xWindowSize - #searchText - 3\
  2945. \009local xStartOfSearchBar = xStart + 2 + #searchText\
  2946. \009local yStartOfSearchBar = yStart + 1\
  2947. \009local limitOfAllText = xWindowSize - 10\
  2948. \009local xWindowEnd = xStart + xWindowSize - 1\
  2949. \009local yWindowEnd = yStart + yWindowSize - 1\
  2950. \
  2951. \009local fromElement = 1\
  2952. \009local searchInput = \"\"\
  2953. \
  2954. \009local Objects = {}\
  2955. \009local function newObj(class,name,x1,y1,width,height,fileType,fileSize,path,fileName,fileFormat)\
  2956. \009\009Objects[class] = Objects[class] or {}\
  2957. \009\009Objects[class][name] = {}\
  2958. \009\009Objects[class][name][\"x1\"]=x1\
  2959. \009\009Objects[class][name][\"y1\"]=y1\
  2960. \009\009Objects[class][name][\"x2\"]=x1+width-1\
  2961. \009\009Objects[class][name][\"y2\"]=y1+height-1\
  2962. \009\009Objects[class][name][\"fileType\"]=fileType\
  2963. \009\009Objects[class][name][\"fileSize\"]=fileSize\
  2964. \009\009Objects[class][name][\"path\"]=path\
  2965. \009\009Objects[class][name][\"fileName\"]=fileName\
  2966. \009\009Objects[class][name][\"fileFormat\"]=fileFormat\
  2967. \009end\
  2968. \
  2969. \009local function drawConcretnoIcon(xStart,yStart,path,name,fileType,fileSize,backColor,fileFormat)\
  2970. \009\009drawOSIcon(xStart,yStart,path,name,fileFormat)\
  2971. \009\009term.setBackgroundColor(backColor)\
  2972. \009\009colorText(xStart+8,yStart,stringLimit(\"end\",name,limitOfAllText),colors.gray)\
  2973. \009\009colorText(xStart+8,yStart+1,stringLimit(\"start\",path,limitOfAllText),colors.lightGray)\
  2974. \009\009colorText(xStart+8,yStart+2,stringLimit(\"start\",\"Type: \"..fileType,limitOfAllText),colors.lightGray)\
  2975. \009\009colorText(xStart+8,yStart+3,stringLimit(\"start\",\"Size: \"..math.ceil(fileSize/1024)..\"KB\",limitOfAllText),colors.lightGray)\
  2976. \
  2977. \009\009newObj(\"icon\",path..\"/\"..name,xStart,yStart,xWindowSize,4,fileType,fileSize,path,name,fileFormat)\
  2978. \009end\
  2979. \
  2980. \009local function drawSearches(fromElement)\
  2981. \009\009Objects = {}\
  2982. \009\009newObj(\"icon\",\"cykaBlyad\",-5,-5,1,1,\"hehe\",5)\009\009\
  2983. \
  2984. \009\009square(xStart,yStart+3,xWindowSize-1,yWindowSize-3,colors.white)\
  2985. \
  2986. \009\009if #searchList == 0 then\
  2987. \009\009\009colorText(xStart+1,yStart+4,\"No mathes found.\",colors.lightGray)\
  2988. \009\009else\
  2989. \009\009\009local iconCounter = 1\
  2990. \009\009\009for i=fromElement,#searchList do\
  2991. \009\009\009\009local yIconPos = yStart+4 + iconCounter*sizeOfOneElement - sizeOfOneElement\
  2992. \009\009\009\009\
  2993. \009\009\009\009drawConcretnoIcon(xStart+1,yIconPos,searchList[i][\"path\"],searchList[i][\"name\"],searchList[i][\"fileType\"],searchList[i][\"fileSize\"],colors.white,searchList[i][\"fileFormat\"])\
  2994. \
  2995. \009\009\009\009iconCounter = iconCounter + 1\
  2996. \009\009\009\009if iconCounter > limitOfElements then break end\
  2997. \009\009\009end\
  2998. \009\009end\
  2999. \
  3000. \009\009scrollBar(xWindowEnd,yStart+3,yWindowSize-3,#searchList,fromElement,colors.lightGray,colors.lightBlue)\
  3001. \009end\
  3002. \
  3003. \009local function textOnSearchBar()\
  3004. \009\009term.setBackgroundColor(colors.white)\
  3005. \009\009usualText(xStartOfSearchBar,yStartOfSearchBar,string.rep(\" \",sizeOfSearchBar))\
  3006. \009\009colorText(xStartOfSearchBar,yStartOfSearchBar,stringLimit(\"start\",searchInput,sizeOfSearchBar),colors.black)\
  3007. \009end\
  3008. \
  3009. \009sampleWindow(xStart,yStart,xWindowSize,yWindowSize)\
  3010. \009square(xStart,yStart,xWindowSize,3,colors.blue)\
  3011. \009colorText(xStart+1,yStart+1,searchText,colors.white)\
  3012. \009square(xStartOfSearchBar,yStartOfSearchBar,sizeOfSearchBar,1,colors.white)\
  3013. \
  3014. \009drawSearches(fromElement)\
  3015. \
  3016. \009while true do\
  3017. \009\009textOnSearchBar(searchInput)\
  3018. \009\009if #searchInput > sizeOfSearchBar then\
  3019. \009\009\009term.setCursorPos(xStartOfSearchBar+sizeOfSearchBar-1,yStartOfSearchBar)\
  3020. \009\009else\
  3021. \009\009\009term.setCursorPos(xStartOfSearchBar+#searchInput,yStartOfSearchBar)\
  3022. \009\009end\
  3023. \
  3024. \009\009term.setCursorBlink(true)\
  3025. \
  3026. \009\009local event,side,x,y = os.pullEvent()\
  3027. \009\009if event == \"mouse_scroll\" then\
  3028. \009\009\009term.setCursorBlink(false)\
  3029. \009\009\009if side == 1 then\
  3030. \009\009\009\009fromElement = fromElement + 1\
  3031. \009\009\009\009if fromElement > #searchList then\
  3032. \009\009\009\009\009fromElement = #searchList\
  3033. \009\009\009\009else\
  3034. \009\009\009\009\009drawSearches(fromElement)\
  3035. \009\009\009\009end\
  3036. \009\009\009else\
  3037. \009\009\009\009fromElement = fromElement - 1\
  3038. \009\009\009\009if fromElement < 1 then\
  3039. \009\009\009\009\009fromElement = 1\
  3040. \009\009\009\009else\
  3041. \009\009\009\009\009drawSearches(fromElement)\
  3042. \009\009\009\009end\
  3043. \009\009\009end\
  3044. \009\009elseif event == \"mouse_click\" then\
  3045. \009\009\009for key,val in pairs(Objects[\"icon\"]) do\
  3046. \009\009\009\009if x>=Objects[\"icon\"][key][\"x1\"] and x<=Objects[\"icon\"][key][\"x2\"] and y>=Objects[\"icon\"][key][\"y1\"] and y<=Objects[\"icon\"][key][\"y2\"] then\
  3047. \009\009\009\009\009square(Objects[\"icon\"][key][\"x1\"]-1,Objects[\"icon\"][key][\"y1\"],xWindowSize-1,4,colors.blue)\
  3048. \009\009\009\009\009drawConcretnoIcon(Objects[\"icon\"][key][\"x1\"],Objects[\"icon\"][key][\"y1\"],Objects[\"icon\"][key][\"path\"],Objects[\"icon\"][key][\"fileName\"],Objects[\"icon\"][key][\"fileType\"],Objects[\"icon\"][key][\"fileSize\"],colors.blue,Objects[\"icon\"][key][\"fileFormat\"])\
  3049. \009\009\009\009\009sleep(0.3)\
  3050. \009\009\009\009\009term.setCursorBlink(false)\
  3051. \009\009\009\009\009return string.sub(key,2,-1)\
  3052. \009\009\009\009end\
  3053. \009\009\009end\
  3054. \009\009\009term.setCursorBlink(false)\
  3055. \009\009\009return nil\
  3056. \
  3057. \009\009elseif event == \"char\" then\
  3058. \009\009\009fromElement = 1\
  3059. \009\009\009searchInput = searchInput..side\
  3060. \009\009\009searchList = searchInAllFiles(\"/\",searchInput)\
  3061. \009\009\009drawSearches(fromElement)\
  3062. \009\009elseif event == \"key\" then\
  3063. \009\009\009if side == 14 then\
  3064. \009\009\009\009fromElement = 1\
  3065. \009\009\009\009searchInput = string.sub(searchInput,1,-2)\
  3066. \009\009\009\009searchList = searchInAllFiles(\"/\",searchInput)\
  3067. \009\009\009\009drawSearches(fromElement)\
  3068. \009\009\009end\
  3069. \009\009end\
  3070. \009end\
  3071. end\
  3072. \
  3073. --print(\"You selected: \"..search(2,2,28,2,\"Search\"))\
  3074. \
  3075. \
  3076. ---------------------------------------------------------------------------------------------------------------------\
  3077. \
  3078. function info(xStart,yStart,title,text)\
  3079. \009local sizeOfText = #text\
  3080. \009local xWindowSize = 4+sizeOfText\
  3081. \009local yWindowSize = 4\
  3082. \009local xStart,yStart = correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
  3083. \
  3084. \009emptyWindow(xStart,yStart,xWindowSize,yWindowSize,title)\
  3085. \
  3086. \009term.setBackgroundColor(colors.white)\
  3087. \009colorText(xStart+2,yStart+2,text,colors.gray)\
  3088. end",
  3089.     path = "//System/API/windows",
  3090.   },
  3091.   {
  3092.     text = "function archive(chto,vochto)\
  3093. \009local Massiv2 = {}\
  3094. \009local function FileList(path)\
  3095. \009\009local Massiv = fs.list(path)\
  3096. \009\009if #Massiv==0 then\
  3097. \009\009\009local Massiv2Id = #Massiv2 + 1\
  3098. \009\009\009Massiv2[Massiv2Id] = {}\
  3099. \009\009\009Massiv2[Massiv2Id][\"path\"] = path\
  3100. \009\009\009Massiv2[Massiv2Id][\"text\"] = \"@empty@empty\"\
  3101. \009\009else\
  3102. \009\009\009for i=1,#Massiv do\
  3103. \009\009\009\009if fs.isDir(path..\"/\"..Massiv[i]) and Massiv[i] ~= \"/rom\" and Massiv[i] ~= \"rom\" then\
  3104. \009\009\009\009\009FileList(path..\"/\"..Massiv[i])\
  3105. \009\009\009\009elseif not fs.isDir(path..\"/\"..Massiv[i]) and Massiv[i] ~= \"/rom\" and Massiv[i] ~= \"rom\" then\
  3106. \009\009\009\009\009local Massiv2Id = #Massiv2 + 1\
  3107. \009\009\009\009\009Massiv2[Massiv2Id] = {}\
  3108. \009\009\009\009\009Massiv2[Massiv2Id][\"path\"] = path..\"/\"..Massiv[i]\
  3109. \009\009\009\009\009local file = fs.open(path..\"/\"..Massiv[i],\"r\")\
  3110. \009\009\009\009\009Massiv2[Massiv2Id][\"text\"] = file.readAll()\
  3111. \009\009\009\009\009file.close()\
  3112. \009\009\009\009end\
  3113. \009\009\009end\
  3114. \009\009end\
  3115. \009end\
  3116. \009FileList(chto)\
  3117. \009file=fs.open(vochto..\".zip\",\"w\")\
  3118. \009file.write(textutils.serialise(Massiv2))\
  3119. \009file.close()\
  3120. \009return Massiv2\
  3121. end\
  3122. \
  3123. function unarchive(chto,kuda)\
  3124. \009local file = fs.open(chto,\"r\")\
  3125. \009Massiv = textutils.unserialise(file.readAll())\
  3126. \009file.close()\
  3127. \009for i=1,#Massiv do\
  3128. \009\009if Massiv[i][\"text\"] == \"@empty@empty\" then\
  3129. \009\009\009fs.makeDir(kuda..\"/\"..Massiv[i][\"path\"])\
  3130. \009\009else\
  3131. \009\009\009local file = fs.open(kuda..\"/\"..Massiv[i][\"path\"],\"w\")\
  3132. \009\009\009file.write(Massiv[i][\"text\"])\
  3133. \009\009\009file.close()\
  3134. \009\009end\
  3135. \009end\
  3136. end",
  3137.     path = "//System/API/zip",
  3138.   },
  3139.   {
  3140.     text = " 05 0d 0d 0d\
  3141. a05p05p0ds0d\
  3142. 05 05 05 0d",
  3143.     path = "//System/app.png",
  3144.   },
  3145.   {
  3146.     text = " 02 02 0c 02\
  3147. 0b 0b[0c 0b\
  3148. 0d 0d 0c 0d",
  3149.     path = "//System/archive.png",
  3150.   },
  3151.   {
  3152.     text = " 70 70 70 70 70 70\
  3153. 70<70-70-70 70 70\
  3154. 70 70-70-70>70 70\
  3155. 80 80 80 80 80 80",
  3156.     path = "//System/back_ico.png",
  3157.   },
  3158.   {
  3159.     text = " 00 00 00 00\
  3160. 00###### 00\
  3161. 00###### 00\
  3162. 00###### 00\
  3163. 00###### 00\
  3164. 00 00 00 00",
  3165.     path = "//System/clocks/0.png",
  3166.   },
  3167.   {
  3168.     text = "###### 00 00\
  3169. ######### 00\
  3170. ######### 00\
  3171. ######### 00\
  3172. ######### 00\
  3173. ######### 00",
  3174.     path = "//System/clocks/1.png",
  3175.   },
  3176.   {
  3177.     text = "### 00 00###\
  3178. 00###### 00\
  3179. ######### 00\
  3180. ###### 00###\
  3181. ### 00######\
  3182. 00 00 00 00",
  3183.     path = "//System/clocks/2.png",
  3184.   },
  3185.   {
  3186.     text = "### 00 00###\
  3187. 00###### 00\
  3188. ######### 00\
  3189. ###### 00###\
  3190. 00###### 00\
  3191. ### 00 00###",
  3192.     path = "//System/clocks/3.png",
  3193.   },
  3194.   {
  3195.     text = " 00###### 00\
  3196. 00###### 00\
  3197. 00###### 00\
  3198. 00 00 00 00\
  3199. ######### 00\
  3200. ######### 00",
  3201.     path = "//System/clocks/4.png",
  3202.   },
  3203.   {
  3204.     text = " 00 00 00 00\
  3205. 00#########\
  3206. 00 00 00###\
  3207. ######### 00\
  3208. 00###### 00\
  3209. ### 00 00###",
  3210.     path = "//System/clocks/5.png",
  3211.   },
  3212.   {
  3213.     text = "### 00 00 00\
  3214. 00#########\
  3215. 00 00 00###\
  3216. 00###### 00\
  3217. 00###### 00\
  3218. ### 00 00###",
  3219.     path = "//System/clocks/6.png",
  3220.   },
  3221.   {
  3222.     text = " 00 00 00 00\
  3223. 00###### 00\
  3224. ######### 00\
  3225. ###### 00###\
  3226. ### 00######\
  3227. ### 00######",
  3228.     path = "//System/clocks/7.png",
  3229.   },
  3230.   {
  3231.     text = " 00 00 00 00\
  3232. 00###### 00\
  3233. 00###### 00\
  3234. ### 00 00###\
  3235. 00###### 00\
  3236. 00 00 00 00",
  3237.     path = "//System/clocks/8.png",
  3238.   },
  3239.   {
  3240.     text = "### 00 00###\
  3241. 00###### 00\
  3242. 00###### 00\
  3243. ### 00 00 00\
  3244. ######### 00\
  3245. ### 00 00###",
  3246.     path = "//System/clocks/9.png",
  3247.   },
  3248.   {
  3249.     text = "######\
  3250. 00 00\
  3251. ######\
  3252. ######\
  3253. 00 00\
  3254. ######",
  3255.     path = "//System/clocks/dots.png",
  3256.   },
  3257.   {
  3258.     text = "{...}",
  3259.     path = "//System/desks/desk.back",
  3260.   },
  3261.   {
  3262.     text = "os.loadAPI(\"/System/API/image\")\
  3263. os.loadAPI(\"/System/API/windows\")\
  3264. os.loadAPI(\"/rom/apis/gps\")\
  3265. local run = true\
  3266. local xSize, ySize = term.getSize()\
  3267. local xCenter = math.floor(xSize/2)\
  3268. local yCenter = math.floor(ySize/2)\
  3269. local obj = {}\
  3270. local arg = {...}\
  3271. local cursor = 3 \
  3272. local check = -4\
  3273. local p_login = \"\"\
  3274. local p_password = \"\"\
  3275. local pword = \"\"\
  3276. \
  3277. local newObj = function(name,x1,y1,x2,y2)\
  3278. obj[name] = {}\
  3279. obj[name][\"x1\"] = x1\
  3280. obj[name][\"y1\"] = y1\
  3281. obj[name][\"x2\"] = x2\
  3282. obj[name][\"y2\"] = y2\
  3283. end\
  3284. \
  3285. local clear = function(color)\
  3286. term.setBackgroundColor(color)\
  3287. term.clear()\
  3288. term.setCursorPos(1,1)\
  3289. end\
  3290. \
  3291. local text = function(string,xPos,yPos)\
  3292. term.setCursorPos(xPos,yPos)\
  3293. term.write(string)\
  3294. end\
  3295.  \
  3296. local pastebin = function(paste,filename)\
  3297. local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
  3298. if file then\
  3299.  file = file.readAll()\
  3300.  h=fs.open(filename,\"w\")\
  3301.  h.write(file)\
  3302.  h.close()\
  3303. else\
  3304.  windows.error(\"Unable to connect to the Internet\")\
  3305. end\
  3306. end\
  3307. \
  3308. local delik = function(y,color)\
  3309. for i=2,xSize-2 do\
  3310.  term.setBackgroundColor(colors.wite)\
  3311.  term.setTextColor(color)\
  3312.  text(\"-\",i,y)\
  3313. end\
  3314. end\
  3315. \
  3316. local redraw = function()\
  3317. clear(colors.lightGray)\
  3318. term.setTextColor(colors.gray)\
  3319. text(\" Skip \",2,ySize-1)\
  3320. term.setTextColor(colors.white)\
  3321. text(\"Hello!\",xCenter-2,3)\
  3322. text(\"Username:\",4,13)\
  3323. text(\"Password:\",4,15) \
  3324. if p_login~=\"\" and p_password~=\"\" then \
  3325.  term.setBackgroundColor(colors.lime)\
  3326.  text(\" Create \",xSize-8,ySize-1)\
  3327. else\
  3328.  term.setBackgroundColor(colors.gray)\
  3329.  text(\" Create \",xSize-8,ySize-1)\
  3330. end\
  3331. for i=1,4 do\
  3332.  paintutils.drawLine(1,6+i,xSize,6+i,colors.white)\
  3333. end\
  3334. term.setTextColor(colors.black)\
  3335. text(\"Please, create\",xCenter-6,8)\
  3336. text(\"your new account\",xCenter-7,9)\
  3337. paintutils.drawLine(13,13,xSize-3,13,colors.white)\
  3338. paintutils.drawLine(13,15,xSize-3,15,colors.white)\
  3339. term.setTextColor(colors.black)\
  3340. text(p_login,6+(xCenter-#p_login/2),13)\
  3341. text(pword,6+(xCenter-#p_password/2),15)\
  3342. end\
  3343. \
  3344. local pullEvent = function()\
  3345. \009local event, side, x, y = os.pullEventRaw()\
  3346. \009if event == \"terminate\" then\
  3347. \009\009windows.error('You can`t use \"Ctrl+T\"')\
  3348. \009\009redraw()\
  3349. \009else\
  3350. \009\009return event, side, x, y\
  3351. \009end\
  3352. end\
  3353. \
  3354. local running = function()\
  3355. while run do\
  3356.  event, side, x, y = pullEvent()\
  3357.  if event == \"mouse_click\" then\
  3358.   if x>=2 and x<=7 and y==ySize-1 then\
  3359.    term.clear()\
  3360.    clear(colors.white)\
  3361.    term.setCursorPos(1,1)\
  3362.    l_login = \"...\"\
  3363.    run = false\
  3364.   elseif y==13 then\
  3365.    paintutils.drawLine(3,13,xSize-3,13,colors.white)\
  3366.    term.setCursorPos(3,13)\
  3367.    p_login = read()\
  3368.    l_login = p_login\
  3369.    redraw()\
  3370.   elseif y==15 then\
  3371.    paintutils.drawLine(3,15,xSize-3,15,colors.white)\
  3372.    term.setCursorPos(3,15)\
  3373.    p_password = read(string.char(7))\
  3374.    pword=\"\"\
  3375.    for i=1, #p_password do\
  3376.     pword = pword..string.char(7)\
  3377.    end\
  3378.    redraw()\
  3379.   elseif x>=xSize-8 and x<=xSize-1 and y==ySize-1 and p_login~=\"\" and p_password~=\"\" then\
  3380.    local f = fs.open(\"/System/accounts/\"..p_login,\"w\")\
  3381.      local conf = fs.open(\"/System/accounts/\"..p_login,\"w\")\
  3382.       conf.writeLine('autoPassEnter = 0 autoLogin = 0 password = \"'..p_password..'\"')\
  3383.       conf.close()\
  3384.      local conf = fs.open(\"/System/accounts/\"..p_login,\"a\")\
  3385.       conf.writeLine('style = colors.lightBlue')\
  3386.       conf.writeLine('colored = 0')\
  3387.       conf.close()\
  3388.    fs.makeDir('/.ds/'..p_login)\
  3389.    fs.makeDir('/System/desks')\
  3390.    local desk = {}\
  3391.    desk[1] = {}\
  3392.    desk[1][1] = {}\
  3393.    desk[1][1]['name']='sys/Store@.apk'\
  3394.    desk[1][1]['x']=3\
  3395.    desk[1][1]['y']=ySize-6\
  3396.    local file = fs.open('/System/desks/'..p_login,\"w\")\
  3397.    file.write(textutils.serialize(desk))\
  3398.    file.close()\
  3399.    run=false\
  3400.    os.reboot()\
  3401.   end\
  3402.  end\
  3403. end\
  3404. end\
  3405. redraw()\
  3406. running()\
  3407. clear(colors.white)\
  3408. term.setCursorPos(1,1)",
  3409.     path = "//System/FirstStart",
  3410.   },
  3411.   {
  3412.     text = " 04 04#########\
  3413. -04-04-04-04###\
  3414. -04-04-04-04###",
  3415.     path = "//System/folder.png",
  3416.   },
  3417.   {
  3418.     text = " 00 00 00 00 00 00\
  3419. 00 00n80o80 00 00\
  3420. 80i80c80o80n80 00\
  3421. 00 00 00 00 00 00",
  3422.     path = "//System/noico.png",
  3423.   },
  3424.   {
  3425.     text = " 04 03 03 03###\
  3426. 03 03 03 03###\
  3427. 0dp0di0dc0d###",
  3428.     path = "//System/picture.png",
  3429.   },
  3430.   {
  3431.     text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
  3432. os.loadAPI(\"/System/API/windows\")\
  3433. os.loadAPI(\"/System/API/sysbar\")\
  3434. os.loadAPI(\"/System/API/contexts\")\
  3435. local xSize, ySize = term.getSize()\
  3436. local centerX = math.floor(xSize/2)\
  3437. local centerY = math.floor(ySize/2)\
  3438. \
  3439. local fileImage = 0\
  3440. local fileDocument = 0\
  3441. local fileOther = 0\
  3442. local fileApps = 0\
  3443. local newLabel = {}\
  3444. local egg = 0\
  3445. local draw = true\
  3446. \
  3447. --------------------MODEM FIND----------------------------\
  3448. function findModem()\
  3449. \009local PeriList = peripheral.getNames()\
  3450. \009for i=1,#PeriList do\
  3451. \009\009if peripheral.getType(PeriList[i]) == \"modem\" then\
  3452. \009\009\009return PeriList[i]\
  3453. \009\009end\
  3454. \009end\
  3455. end\
  3456. \
  3457. local computerModem = findModem()\
  3458. if computerModem == nil then computerModem = \"not found\" end\
  3459. \
  3460. local function clearScreen(color)\
  3461. \009term.setBackgroundColor(color)\
  3462. \009term.clear()\
  3463. end\
  3464. \
  3465. local function fadeOut(time)\
  3466. for i=0,xSize do\
  3467.  paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
  3468.  paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
  3469.  sleep(time)\
  3470. end\
  3471. \009term.setCursorPos(1,1)\
  3472. \009term.setTextColor(colors.white)\
  3473. end\
  3474. \
  3475. local function writeText(text,x,y)\
  3476. \009term.setCursorPos(x,y)\
  3477. \009term.write(text)\
  3478. end\
  3479. \
  3480. local drawBar = function()\
  3481. \009while true do\
  3482. \009\009if draw then\
  3483. \009\009\009sysbar.draw(colors.white,colors.black,noty,true,true)\
  3484. \009\009end\
  3485. \009\009sleep(1)\
  3486. \009end\
  3487. end\
  3488. \
  3489. local function infoText(key,keyColor,value,x,y)\
  3490. \009term.setCursorPos(x,y)\
  3491. \009term.setTextColor(keyColor)\
  3492. \009term.write(key..\": \")\
  3493. \009term.setTextColor(colors.lightGray)\
  3494. \009term.setCursorPos(xSize-#value,y)\
  3495. \009term.write(value)\
  3496. end\
  3497. \
  3498. local function lines()\
  3499. term.setBackgroundColor(colors.lightGray)\
  3500. end\
  3501. \
  3502. local function redraw()\
  3503. clearScreen(colors.white)\
  3504. for i=3,5 do\
  3505. \009paintutils.drawLine(1,i,xSize,i,colors.white)\
  3506. end\
  3507. term.setTextColor(colors.lightGray)\
  3508. writeText('Vedroid',centerX-4,4)\
  3509. term.setTextColor(colors.lime)\
  3510. writeText('OS',centerX+3,4)\
  3511. if egg < 4 then\
  3512.  local computerLabel = os.getComputerLabel()\
  3513.  if computerLabel == nil then computerLabel = \"not set\" end\
  3514.  sysbar.header(' < About',mainTextCol,mainColor)\
  3515.  for i=6,8 do\
  3516. \009paintutils.drawLine(1,i,xSize,i,mainColor)\
  3517.  end\
  3518.  term.setTextColor(colors.black)\
  3519.  term.setBackgroundColor(colors.white)\
  3520.  infoText(\"Computer label\",colors.black,computerLabel,2,10)\
  3521.  infoText(\"Computer ID\",colors.black,tostring(os.getComputerID()),2,11)\
  3522.  infoText(\"Connected modem\",colors.black,computerModem,2,12)\
  3523.  infoText(\"Developer\",colors.black,\"DECE\",2,17)\
  3524.  term.setTextColor(colors.black)\
  3525.  writeText(\"Your OS version:\",2,14)\
  3526.  writeText(\"Last OS version:\",2,15)\
  3527.  if version == lastVer then\
  3528.   term.setTextColor(colors.lime)\
  3529.  elseif version < lastVer then\
  3530.   term.setTextColor(colors.red)\
  3531.  elseif version > lastVer then\
  3532.   term.setTextColor(colors.lightBlue)\
  3533.  end\
  3534.  writeText(version,xSize-#version,14)\
  3535.  term.setTextColor(colors.lime)\
  3536.  writeText(lastVer,xSize-#lastVer,15)\
  3537. else\
  3538.  for i=6,ySize-1 do\
  3539.   paintutils.drawLine(1,i,xSize,i,colors.white)\
  3540.  end\
  3541.  writeText(osLogo,centerX-math.floor(#osLogo/2),centerY+1)\
  3542.  writeText('just because',centerX-5,ySize-2)\
  3543. end\
  3544. end\
  3545. \
  3546. local function touch()\
  3547. while true do\
  3548.  event, side, x, y = os.pullEvent()\
  3549.  if event == \"mouse_click\" then\
  3550.   draw = false\
  3551.   if x==xSize and y==ySize and egg < 4 then\
  3552.    term.setBackgroundColor(colors.gray)\
  3553.    term.setTextColor(colors.lightGray)\
  3554.    writeText(\"|\",xSize,ySize)\
  3555.    local budka = contexts.main(xSize,ySize-1,'Set label')\
  3556. \009if budka == 'Set label' then\
  3557. \009 redraw()\
  3558. \009 local newLabel = windows.input(\"auto\",\"auto\",\"Set label\",14,{\"New label\",os.getComputerLabel()})\
  3559.     os.setComputerLabel(newLabel[1])\
  3560. \009 if newLabel[1] == nil or newLabel[1] == '' or newLabel[1] == ' ' then\
  3561. \009  os.setComputerLabel(nil)\
  3562. \009 end\
  3563. \009end\
  3564.    redraw()\
  3565.   elseif sysbar.back(x,y) or y==1 then\
  3566.    if egg < 4 then\
  3567.     break\
  3568. \009else\
  3569. \009 egg = 0\
  3570. \009end\
  3571.   elseif sysbar.home(x,y) then\
  3572.    home = true\
  3573.    break\
  3574.   elseif y==4 and egg < 4 then\
  3575.    egg = egg + 1\
  3576.   end\
  3577.   redraw()\
  3578.   draw = true\
  3579.   sysbar.draw(colors.white,colors.black,noty,true,true)\
  3580.  end\
  3581. end\
  3582. end\
  3583. redraw()\
  3584. parallel.waitForAny(drawBar,touch)\
  3585. clearScreen(colors.black)",
  3586.     path = "//System/prog/about",
  3587.   },
  3588.   {
  3589.     text = "os.loadAPI(\"/System/API/image\")\
  3590. os.loadAPI(\"/System/API/windows\")\
  3591. os.loadAPI(\"/rom/apis/gps\")\
  3592. os.loadAPI(\"/System/API/sysbar\")\
  3593. local run = true\
  3594. local xSize, ySize = term.getSize()\
  3595. local xCenter = math.floor(xSize/2)\
  3596. local yCenter = math.floor(ySize/2)\
  3597. local obj = {}\
  3598. local screen = 1\
  3599. local maxScreen = 1\
  3600. local xp = 3\
  3601. local yp = 3\
  3602. local pos = -1\
  3603. local files = {}\
  3604. local lenthScroll = 0\
  3605. local posScroll = 0\
  3606. local step = 0\
  3607. local lenthPage = 0\
  3608. local screen = window.create(term.current(),1,3,xSize-1,ySize-3)\
  3609. \
  3610. local function refreshFiles()\
  3611. \009files = fs.list('/.ds/'..l_login)\
  3612. \009return files\
  3613. end\
  3614. \
  3615. local newObj = function(name,x1,y1,x2,y2)\
  3616. obj[name] = {}\
  3617. obj[name][\"x1\"] = x1\
  3618. obj[name][\"y1\"] = y1\
  3619. obj[name][\"x2\"] = x2\
  3620. obj[name][\"y2\"] = y2\
  3621. end\
  3622. \
  3623. local delApp = function()\
  3624. files = refreshFiles()\
  3625. for i=1,#files do\
  3626.  newObj(files[i],-1,-1,-1,-1)\
  3627. end\
  3628. end\
  3629. \
  3630. local clear = function(color)\
  3631. term.setBackgroundColor(color)\
  3632. term.clear()\
  3633. term.setCursorPos(1,1)\
  3634. end\
  3635. \
  3636. local text = function(string,xPos,yPos)\
  3637. term.setCursorPos(xPos,yPos)\
  3638. term.write(string)\
  3639. end\
  3640. \
  3641. local function fadeOut(time)\
  3642. clear(colors.white)\
  3643.        term.setCursorPos(1,1)\
  3644.        term.setTextColor(colors.white)\
  3645. end\
  3646. \
  3647. local sysBar = function()\
  3648. \009while true do\
  3649. \009\009files = refreshFiles()\
  3650. \009\009sysbar.header(\" < Applications\",mainTextCol,mainColor)\
  3651. \009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
  3652. \009\009sleep(1)\
  3653. \009end\
  3654. end\
  3655. \
  3656. local app = function(name,ico,x,y)\
  3657. image.draw(x,y,ico)\
  3658. term.setBackgroundColor(colors.white)\
  3659. term.setTextColor(colors.black)\
  3660. text(name,x+7,y+1)\
  3661. text(\"    \",x+#name+3,y+1)\
  3662. newObj(name,xSize-10,y+5,xSize-2,y+5)\
  3663. local size = fs.getSize(\"/.ds/\"..l_login..'/'..name..\"/main\")\
  3664. size = math.floor(size/1024)\
  3665. term.setTextColor(colors.gray)\
  3666. text(\"Size: \"..size..\" KB\",x+7,y+2)\
  3667. term.setTextColor(colors.red)\
  3668. text(\"Delete\",xSize-7,y+3)\
  3669. end\
  3670. \
  3671. local redraw = function()\
  3672. term.redirect(screen)\
  3673. clear(colors.white)\
  3674. files = refreshFiles()\
  3675. maxScreen = math.floor(#files/3+1)\
  3676. for i=1,#files do\
  3677.  app(files[i],\"/.ds/\"..l_login..'/'..files[i]..\"/Resources/icon.png\",1,i*5+pos-2)\
  3678. end\
  3679. term.redirect(term.native())\
  3680. step = sysbar.scrollBar(#files,5,posScroll,2)\
  3681. end\
  3682. \
  3683. local running = function()\
  3684. while run and l_login ~= '$test' do\
  3685.  event, side, x, y = os.pullEvent()\
  3686.  if event == \"mouse_scroll\" then\
  3687.   if #files>3 then\
  3688.    if side == 1 then\
  3689.     if pos>-#files*5+15 then\
  3690.      posScroll = posScroll-step\
  3691.      pos = pos-2\
  3692.     else\
  3693.      pos = -#files*5+15\
  3694.     end \
  3695.    elseif side == -1 then\
  3696.     if pos<-1 then \
  3697.      pos = pos+2\
  3698.      posScroll = posScroll+step\
  3699.     else\
  3700.      pos = -1\
  3701.     end\
  3702.    end\
  3703.    redraw()\
  3704.   end\
  3705.  elseif event == \"key\" then\
  3706.   if side == 208 then\
  3707.    if pos>-#files*5+15 then\
  3708.     posScroll = posScroll-step\
  3709.     pos = pos-2\
  3710.    else\
  3711.     pos = -#files*5+15\
  3712.    end \
  3713.   elseif side == 200 then\
  3714.    if pos<-1 then \
  3715.     pos = pos+2\
  3716.     posScroll = posScroll+step\
  3717.    else\
  3718.     pos = -1\
  3719.    end\
  3720.   end\
  3721.   redraw()\
  3722.  elseif event == \"mouse_click\" then\
  3723.   if sysbar.back(x,y) or y==1 then\
  3724.    term.clear()\
  3725.    term.setCursorPos(1,1)\
  3726.    run = false\
  3727.   elseif sysbar.home(x,y) then\
  3728.    home = true\
  3729.    term.clear()\
  3730.    term.setCursorPos(1,1)\
  3731.    run = false\
  3732.   else\
  3733.    files = refreshFiles()\
  3734.    for i=1,#files do\
  3735.     if x>=obj[files[i]][\"x1\"] and x<=obj[files[i]][\"x2\"] and y>=obj[files[i]][\"y1\"] and y<=obj[files[i]][\"y2\"] then\
  3736.      local but = windows.select({\"Delete\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
  3737.      if but == \"Yes\" then\
  3738.       shell.run(\"rm /.ds/\"..l_login..'/'..files[i])\
  3739.       redraw()\
  3740.       break\
  3741.      elseif but == \"No\" then redraw() end\
  3742.     end\
  3743.    end\
  3744.   end\
  3745.  end\
  3746. end\
  3747. end\
  3748. \
  3749. clear(colors.white)\
  3750. redraw()\
  3751. parallel.waitForAny(sysBar,running)\
  3752. fadeOut(0)",
  3753.     path = "//System/prog/applications",
  3754.   },
  3755.   {
  3756.     text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
  3757. os.loadAPI(\"/System/API/context\")\
  3758. os.loadAPI(\"/System/API/windows\")\
  3759. os.loadAPI(\"/System/API/sysbar\")\
  3760. os.loadAPI(\"/System/API/image\")\
  3761. local xSize, ySize = term.getSize()\
  3762. local xCenter, yCenter = math.floor(xSize/2), math.floor(ySize/2)\
  3763. local run = true\
  3764. local digits = {'0.png','1.png','2.png','3.png','4.png','5.png','6.png','7.png','8.png','9.png','dots.png'}\
  3765. local comp = 0\
  3766. if xSize > 30 then comp = 1 end\
  3767. \
  3768. local function clear(color)\
  3769. \009term.setBackgroundColor(color)\
  3770. \009term.clear()\
  3771. end\
  3772. \
  3773. local function fadeIn(time)\
  3774. for i=1,ySize-1 do\
  3775.  paintutils.drawLine(1,i,xSize,i,mainColor)\
  3776.  sleep(time)\
  3777. end\
  3778. end\
  3779. \
  3780. local function fadeOut(time)\
  3781. for i=0,xSize do\
  3782.  paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
  3783.  paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
  3784.  sleep(time)\
  3785. end\
  3786. \009term.setCursorPos(1,1)\
  3787. \009term.setTextColor(colors.white)\
  3788. end\
  3789. \
  3790. local function text(text,x,y)\
  3791. \009term.setCursorPos(x,y)\
  3792. \009term.write(text)\
  3793. end\
  3794. \
  3795. local sysBar = function()\
  3796. term.setTextColor(colors.black)\
  3797. term.setBackgroundColor(colors.white)\
  3798. sysbar.draw(colors.white,colors.black,noty,true,false,false)\
  3799. end\
  3800. \
  3801. local formatTime = function(nTime)\
  3802.    local nHour = math.floor(nTime)\
  3803.    local nMinute = math.floor((nTime - nHour)*60)\
  3804.    return nHour, nMinute\
  3805. end\
  3806. \
  3807. local drawDots = function()\
  3808. \009while true do\
  3809. \009\009image.draw(xCenter,yCenter-3,'/System/clocks/'..digits[11])\
  3810. \009\009sleep(0.5)\
  3811. \009\009paintutils.drawFilledBox(xCenter,yCenter-3,xCenter+1,yCenter+3,style)\
  3812. \009\009sleep(0.5)\
  3813. \009end\
  3814. end\
  3815. \
  3816. local globalClock = function(time)\
  3817. \009while true do\
  3818. \009\009local globalTime = os.time()\
  3819. \009\009local hour, minute = formatTime(globalTime)\
  3820. \009\009paintutils.drawFilledBox(xCenter-10,yCenter-3,xCenter-1,yCenter+3,style)\
  3821. \009\009paintutils.drawFilledBox(xCenter+3,yCenter-3,xCenter+11,yCenter+3,style)\
  3822. \009\009image.draw(xCenter-10,yCenter-3,'/System/clocks/'..digits[math.floor(hour/10)+1])\
  3823. \009\009image.draw(xCenter-5,yCenter-3,'/System/clocks/'..digits[math.floor(hour%10)+1])\
  3824. \009\009image.draw(xCenter+3,yCenter-3,'/System/clocks/'..digits[math.floor(minute/10)+1])\
  3825. \009\009image.draw(xCenter+8,yCenter-3,'/System/clocks/'..digits[math.floor(minute%10)+1])\
  3826. \009\009sleep(1)\
  3827. \009end\
  3828. end\
  3829. \
  3830. local function redraw()\
  3831. clear(style)\
  3832. sysBar()\
  3833. end\
  3834. \
  3835. local function touch()\
  3836. while true do\
  3837.  --clock()\
  3838.  event, side, x, y = os.pullEvent()\
  3839.  if event == \"mouse_click\" then\
  3840.   if sysbar.back(x,y) then\
  3841.    break\
  3842.   elseif sysbar.home(x,y) then\
  3843.    home = true\
  3844.    break\
  3845.   end\
  3846.  end\
  3847. end\
  3848. end\
  3849. \
  3850. redraw()\
  3851. parallel.waitForAny(globalClock,touch,drawDots)\
  3852. clear(colors.black)",
  3853.     path = "//System/prog/clock",
  3854.   },
  3855.   {
  3856.     text = "os.loadAPI(\"/System/API/image\")\
  3857. os.loadAPI(\"/System/API/windows\")\
  3858. os.loadAPI(\"/rom/apis/gps\")\
  3859. os.loadAPI(\"/System/API/sysbar\")\
  3860. \
  3861. local pastebin = function(paste,filename)\
  3862. local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
  3863. if file then\
  3864.  file = file.readAll()\
  3865.  h=fs.open(filename,\"w\")\
  3866.  h.write(file)\
  3867.  h.close()\
  3868. else\
  3869.  windows.error(\"Unable to connect to the Internet\")\
  3870. end\
  3871. end\
  3872. \
  3873. local find = false\
  3874. local file = fs.list(\"/System/accounts\")\
  3875. for I=1,#file do\
  3876. if file[I] == l_login then find = true end\
  3877. end\
  3878. if find == false and l_login ~= '...' then\
  3879.  local conf = fs.open(\"/System/accounts/\"..l_login,\"w\")\
  3880.  conf.writeLine('autoPassEnter = 0 autoLogin = 0')\
  3881.  conf.close()\
  3882. elseif l_login ~= '...' and log == true then\
  3883.  pastebin(\"AH3k8DMa\",\"/ver\")\
  3884.  shell.run(\"/ver\")\
  3885.  shell.run(\"/System/accounts/\"..l_login)\
  3886. end\
  3887. local run = true\
  3888. local xSize, ySize = term.getSize()\
  3889. local xCenter = math.floor(xSize/2)\
  3890. local yCenter = math.floor(ySize/2)\
  3891. local obj = {}\
  3892. local arg = {...}\
  3893. local cursor = 3 \
  3894. local check = -4\
  3895. find = true\
  3896. local p_login = \"\"\
  3897. local p_password = \"\"\
  3898. local pword = \"\"\
  3899. local ico = false\
  3900. local back = false\
  3901. local pull = false\
  3902. shell.run(\"mkdir /System/accounts\")\
  3903. file = fs.list(\"System/accounts\")\
  3904. local autopass = autoPassEnter\
  3905. local autolog = autoLogin\
  3906. \
  3907. local newObj = function(name,x1,y1,x2,y2)\
  3908. obj[name] = {}\
  3909. obj[name][\"x1\"] = x1\
  3910. obj[name][\"y1\"] = y1\
  3911. obj[name][\"x2\"] = x2\
  3912. obj[name][\"y2\"] = y2\
  3913. end\
  3914. \
  3915. local clear = function(color)\
  3916. term.setBackgroundColor(color)\
  3917. term.clear()\
  3918. term.setCursorPos(1,1)\
  3919. end\
  3920. \
  3921. local text = function(string,xPos,yPos)\
  3922. term.setCursorPos(xPos,yPos)\
  3923. term.write(string)\
  3924. end\
  3925. \
  3926. local function fadeOut(time)\
  3927.        clear(colors.lightGray)\
  3928.        sleep(time)\
  3929.        clear(colors.gray)\
  3930.        sleep(time)\
  3931.        clear(colors.black)\
  3932.        sleep(time)\
  3933.        term.setCursorPos(1,1)\
  3934.        term.setTextColor(colors.black)\
  3935. end\
  3936. \
  3937. local sysBar = function()\
  3938. \009while true do\
  3939. \009\009sysbar.header(\" < Security\",mainTextCol,mainColor)\
  3940. \009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
  3941. \009\009sleep(1)\
  3942. \009end\
  3943. end\
  3944. \
  3945. local redraw = function()\
  3946. clear(colors.white)\
  3947. term.setTextColor(colors.black)\
  3948. if #file == 0 then \
  3949.  find = false \
  3950. elseif #file > 0 then\
  3951.  find = true\
  3952. end\
  3953. if find == false and log == false then\
  3954.  clear(colors.white)\
  3955.  term.setTextColor(colors.gray)\
  3956.  text(\"New account\",3,4)\
  3957.  term.setTextColor(colors.black)\
  3958.  text(\"Username:\",6,6)\
  3959.  text(\"Password:\",6,8)\
  3960.  paintutils.drawLine(15,6,xSize-5,6,colors.lightGray)\
  3961.  paintutils.drawLine(15,8,xSize-5,8,colors.lightGray)\
  3962.  term.setTextColor(colors.white)\
  3963.  text(p_login,6+(xCenter-#p_login/2),6)\
  3964.  text(pword,6+(xCenter-#p_password/2),8)\
  3965.  if p_login~=\"\" and p_password~=\"\" then\
  3966.   term.setBackgroundColor(colors.lime)\
  3967.   term.setTextColor(colors.white)\
  3968.   text(\" Create \",xCenter-3,10)\
  3969.  end\
  3970. elseif find == true and log == false then\
  3971.  clear(colors.white)\
  3972.  term.setTextColor(colors.gray)\
  3973.  text(\"Enter account\",3,4)\
  3974.  term.setTextColor(colors.black)\
  3975.  text(\"Username:\",6,6)\
  3976.  text(\"Password:\",6,8)\
  3977.  paintutils.drawLine(15,6,xSize-5,6,colors.lightGray)\
  3978.  paintutils.drawLine(15,8,xSize-5,8,colors.lightGray)\
  3979.  term.setTextColor(colors.white)\
  3980.  if l_login~=nil then\
  3981.   text(l_login,xCenter-#l_login/2+6,6)\
  3982.  end\
  3983.  text(pword,xCenter-#p_password/2+6,8)\
  3984.  text(\"v\",xSize-5,6)\
  3985.  if l_login~=\"\" and p_password~=\"\" then\
  3986.   term.setBackgroundColor(colors.lime)\
  3987.   term.setTextColor(colors.white)\
  3988.   text(\" Log In \",xCenter-3,10)\
  3989.  end\
  3990. elseif log == true then\
  3991.  clear(colors.white)\
  3992.  term.setTextColor(colors.gray)\
  3993.  text(\"Account settings\",3,4)\
  3994.  local icon = fs.list(\"/System\")\
  3995.  for i=1,#icon do\
  3996.   if icon[i]==l_login..\".png\" then\
  3997.    image.draw(3,6,\"/System/\"..l_login..\".png\")\
  3998.    ico = true\
  3999.   end\
  4000.  end\
  4001.  if ico == false then\
  4002.   image.draw(3,6,\"/System/acc.png\")\
  4003.  end\
  4004.  ico = false\
  4005.  term.setTextColor(colors.black)\
  4006.  term.setBackgroundColor(colors.white)\
  4007.  text(\"Auto enter\",3,12)\
  4008.  text(\"Auto login\",3,14)\
  4009.  term.setTextColor(colors.gray)\
  4010.  text(\"Exit to CraftOS\",3,16)\
  4011.  term.setBackgroundColor(colors.red)\
  4012.  term.setTextColor(colors.white)\
  4013.  text(\" Delete \",12,8)\
  4014.  term.setBackgroundColor(colors.lightGray)\
  4015.  text(\" Logout \",12,6)\
  4016.  sysbar.switch(12,autoPassEnter,mainSwitchCol)\
  4017.  sysbar.switch(14,autoLogin,mainSwitchCol)\
  4018. end\
  4019. end\
  4020. \
  4021. local pullEvent = function()\
  4022. \009local event, side, x, y = os.pullEventRaw()\
  4023. \009if event == \"terminate\" then\
  4024. \009\009windows.error('You can`t use \"Ctrl+T\"')\
  4025. \009\009redraw()\
  4026. \009else\
  4027. \009\009return event, side, x, y\
  4028. \009end\
  4029. end \
  4030. \
  4031. local running = function()\
  4032. while run do\
  4033.  event, side, x, y = pullEvent()\
  4034.  if event == \"mouse_click\" then\
  4035.   if log == false then\
  4036.    if x==xSize-5 and y==6 then\
  4037.     if pull == true then\
  4038.      pull = false\
  4039.      redraw()\
  4040.     elseif pull == false then\
  4041.      file = fs.list(\"/System/accounts\")\
  4042.      for i=1,#file do\
  4043.       paintutils.drawLine(15,6,xSize-5,6,colors.lightGray)\
  4044.       term.setTextColor(colors.white)\
  4045.       text(\"^\",xSize-5,6)\
  4046.       text(\"...\",xCenter-3/2+6,6)\
  4047.       paintutils.drawLine(15,6+i,xSize-5,6+i,colors.lightGray)\
  4048.       paintutils.drawLine(15,7+i,xSize-5,7+i,colors.lightGray)\
  4049.       text(file[i],xCenter-#file[i]/2+6,6+i)\
  4050.       term.setTextColor(colors.gray)\
  4051.       text(\"New\",xCenter-3/2+6,7+i)\
  4052.      end\
  4053.      pull = true\
  4054.     end\
  4055.    elseif y>6 and y-6<=#file and pull==true then\
  4056.     l_login = file[y-6]\
  4057.     shell.run(\"/System/accounts/\"..file[y-6])\
  4058.     pull = false\
  4059.     redraw()\
  4060.    elseif y-6==#file+1 and pull==true then\
  4061.     l_login = \"$test\"\
  4062.     file = {}\
  4063.     find = false\
  4064.     pull = false\
  4065.     redraw()\
  4066.    elseif y==6 and find==false then\
  4067.     paintutils.drawLine(6,6,xSize-5,6,colors.lightGray)\
  4068. \009 term.setTextColor(colors.white)\
  4069.     term.setCursorPos(6,6)\
  4070.     p_login = read()\
  4071.     redraw()\
  4072.    elseif y==8 and pull==false then\
  4073.     paintutils.drawLine(6,8,xSize-5,8,colors.lightGray)\
  4074.     term.setCursorPos(6,8)\
  4075. \009 term.setTextColor(colors.white)\
  4076.     p_password = read(\"o\")\
  4077.     pword=\"\"\
  4078.     for i=1, #p_password do\
  4079.      pword = pword..\"o\"\
  4080.     end\
  4081.     redraw()\
  4082.    elseif y==10 and ((p_login~=\"\" or l_login~=\"\") and l_login ~= '$test') and p_password~=\"\" then\
  4083.     if find==false then\
  4084.      local f = fs.open(\"/System/accounts/\"..p_login,\"w\")\
  4085.      local conf = fs.open(\"/System/accounts/\"..p_login,\"w\")\
  4086.       conf.writeLine('autoPassEnter = 0 autoLogin = 0 password = \"'..p_password..'\"')\
  4087.       conf.close()\
  4088.      local conf = fs.open(\"/System/accounts/\"..p_login,\"a\")\
  4089.       conf.writeLine('style = colors.lightBlue')\
  4090.       conf.writeLine('colored = 0')\
  4091.       conf.close()\
  4092.      p_password = \"\"\
  4093.      pword = \"\"\
  4094. \009  fs.makeDir('/.ds/'..p_login)\
  4095.      file = fs.list(\"System/accounts\")\
  4096.     else\
  4097.      if p_password == password then\
  4098.       log = true\
  4099.      else\
  4100.       paintutils.drawLine(6,7,xSize-5,7,colors.red)\
  4101.       term.setTextColor(colors.white)\
  4102.       text(\"Wrong password\",xCenter-6,7)\
  4103.       sleep(1)\
  4104.      end\
  4105.     end\
  4106.     redraw()\
  4107.    elseif sysbar.back(x,y) or y==1 then\
  4108.     term.clear()\
  4109.     term.setCursorPos(1,1)\
  4110.     run = false\
  4111.    elseif sysbar.home(x,y) then\
  4112. \009 home = true\
  4113.     term.clear()\
  4114.     term.setCursorPos(1,1)\
  4115.     run = false\
  4116.    end\
  4117.   elseif log == true then\
  4118.    if y==6 and x>=12 and x<=21 then\
  4119.     log = false\
  4120.     p_password = \"\"\
  4121.     pword = \"\"\
  4122. \009 password = \"\"\
  4123.     l_login = \"$test\"\
  4124. \009 style = colors.lightBlue\
  4125. \009 colored = 0\
  4126. \009 mainColor = colors.lightGray\
  4127. \009 mainTextCol = colors.gray\
  4128. \009 mainSwitchCol = colors.lightBlue\
  4129.     redraw()\
  4130.    elseif y==8 and x>=12 and x<=21 then\
  4131. \009 local but = windows.select({\"Delete account\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
  4132.     if but == \"Yes\" then\
  4133.      shell.run(\"rm /System/accounts/\"..l_login)\
  4134. \009  shell.run(\"rm /System/desks/\"..l_login)\
  4135. \009  shell.run('rm /.ds/'..l_login)\
  4136.      log = false\
  4137.      p_password = \"\"\
  4138.      pword = \"\"\
  4139. \009  password = \"\"\
  4140.      l_login = \"$test\"\
  4141. \009  style = colors.lightBlue\
  4142. \009  colored = 0\
  4143. \009  mainColor = colors.lightGray\
  4144. \009  mainTextCol = colors.gray\
  4145. \009  mainSwitchCol = colors.lightBlue\
  4146. \009 end\
  4147.     redraw()\
  4148.    elseif sysbar.back(x,y) or y==1 then\
  4149.     clear(colors.black)\
  4150.     term.setCursorPos(1,1)\
  4151.     run = false\
  4152.    elseif sysbar.home(x,y) then\
  4153.     term.clear()\
  4154.     term.setCursorPos(1,1)\
  4155. \009 home = true\
  4156.     run = false\
  4157.    elseif x>=1 and x<=xSize and y==12 and autoPassEnter == 0 then\
  4158.     autoPassEnter = 1\
  4159.     redraw()\
  4160.    elseif x>=1 and x<=xSize and y==12 and autoPassEnter == 1 then\
  4161.     autoPassEnter = 0 \
  4162.     redraw()\
  4163.    elseif x>=1 and x<=xSize and y==14 and autoLogin == 0 then\
  4164.     autoLogin = 1\
  4165.     redraw()\
  4166.    elseif x>=1 and x<=xSize and y==14 and autoLogin == 1 then\
  4167.     autoLogin = 0\
  4168.     redraw()\
  4169. \009elseif y==16 then\
  4170.     local but = windows.select({\"Exit to CraftOS\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
  4171.     if but == \"Yes\" then\
  4172. \009  osexit = true\
  4173.      clear(colors.black)\
  4174.      term.setCursorPos(1,1)\
  4175. \009  home = true\
  4176.      run = false\
  4177. \009  break\
  4178.     elseif but == \"No\" then\
  4179. \009  redraw()\
  4180. \009 end\
  4181.    end\
  4182.   end\
  4183.  end\
  4184. end\
  4185. end\
  4186. \
  4187. redraw()\
  4188. parallel.waitForAny(sysBar,running)\
  4189. if l_login ~= '...' and l_login ~= '$test' and log == true then\
  4190.  local conf = fs.open(\"/System/accounts/\"..l_login,\"w\")\
  4191.  conf.writeLine('autoPassEnter = '..autoPassEnter..' autoLogin = '..autoLogin..' password = \"'..password..'\"')\
  4192.  conf.close()\
  4193.  local conf = fs.open(\"/System/accounts/\"..l_login,\"a\")\
  4194.  conf.writeLine('style = '..style)\
  4195.  conf.writeLine('colored = '..colored)\
  4196.  conf.close()\
  4197. elseif log == false then\
  4198.  l_login = \"$test\"\
  4199.  style = colors.lightBlue\
  4200.  colored = 0\
  4201.  mainColor = colors.lightGray\
  4202.  mainTextCol = colors.gray\
  4203.  mainSwitchCol = colors.lightBlue\
  4204.  shell.run('mkdir /System/desks')\
  4205.  local file = fs.open('/System/desks/'..l_login,\"w\")\
  4206.  file.write('{}')\
  4207.  file.close()\
  4208. end",
  4209.     path = "//System/prog/security",
  4210.   },
  4211.   {
  4212.     text = "os.loadAPI(\"/System/API/image\")\
  4213. os.loadAPI(\"/System/API/windows\")\
  4214. os.loadAPI(\"/rom/apis/gps\")\
  4215. os.loadAPI(\"/System/apis/sysbar\")\
  4216. local run = true\
  4217. local xSize, ySize = term.getSize()\
  4218. local xCenter = math.floor(xSize/2)\
  4219. local yCenter = math.floor(ySize/2)\
  4220. local obj = {}\
  4221. local arg = {...}\
  4222. local screen = window.create(term.current(),1,3,xSize,ySize-3)\
  4223. local draw = true\
  4224. \
  4225. function findModem()\
  4226. \009local PeriList = peripheral.getNames()\
  4227. \009for i=1,#PeriList do\
  4228. \009\009if peripheral.getType(PeriList[i]) == \"modem\" then\
  4229. \009\009\009return PeriList[i]\
  4230. \009\009end\
  4231. \009end\
  4232. end\
  4233. \
  4234. local computerModem = findModem()\
  4235. \
  4236. local newObj = function(name,x1,y1,x2,y2)\
  4237. obj[name] = {}\
  4238. obj[name][\"x1\"] = x1\
  4239. obj[name][\"y1\"] = y1\
  4240. obj[name][\"x2\"] = x2\
  4241. obj[name][\"y2\"] = y2\
  4242. end\
  4243. \
  4244. local clear = function(color)\
  4245. term.setBackgroundColor(color)\
  4246. term.clear()\
  4247. term.setCursorPos(1,1)\
  4248. end\
  4249. \
  4250. local text = function(string,xPos,yPos)\
  4251. term.setCursorPos(xPos,yPos)\
  4252. term.write(string)\
  4253. end\
  4254. \
  4255. local fadeIn = function()\
  4256. for i=1,xSize do\
  4257.  paintutils.drawLine(i,1,i,ySize-1,colors.black)\
  4258.  sleep(0)\
  4259. end\
  4260. end\
  4261. \
  4262. local function fadeOut(time)\
  4263.        clear(colors.lightGray)\
  4264.        sleep(time)\
  4265.        clear(colors.gray)\
  4266.        sleep(time)\
  4267.        clear(colors.black)\
  4268.        sleep(time)\
  4269.        term.setCursorPos(1,1)\
  4270.        term.setTextColor(colors.black)\
  4271. end\
  4272. \
  4273. local sysBar = function()\
  4274. \009while true do\
  4275. \009\009if draw then\
  4276. \009\009\009sysbar.header(\"Settings\",mainTextCol,mainColor)\
  4277. \009\009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
  4278. \009\009end\
  4279. \009\009sleep(1)\
  4280. \009end\
  4281. end\
  4282. \
  4283. local menu = function(...)\
  4284. term.setBackgroundColor(colors.white)\
  4285. term.setTextColor(colors.black)\
  4286. local cursor = 4\
  4287. for i=1,#arg do\
  4288.  text(arg[i],2,cursor-2)\
  4289.  newObj(arg[i],2,cursor,xSize,cursor)\
  4290.  cursor=cursor+2\
  4291. end\
  4292. end\
  4293. \
  4294. local redraw = function()\
  4295. term.redirect(screen)\
  4296. clear(colors.white)\
  4297. menu(\"RedNet\",\"Applications\",\"Customization\",\"Security\",\"Storage\",\"Update\",\"About\")\
  4298. paintutils.drawLine(xSize-7,2,xSize-2,2,colors.gray)\
  4299. term.setTextColor(colors.white)\
  4300. if wifi == \"off\" then\
  4301.  paintutils.drawLine(xSize-7,2,xSize-5,2,colors.lightGray)\
  4302. elseif wifi == \"on\" then\
  4303.  paintutils.drawLine(xSize-4,2,xSize-2,2,mainSwitchCol)\
  4304. end\
  4305. term.redirect(term.native())\
  4306. end\
  4307. \
  4308. \
  4309. local running = function()\
  4310. while run == true and home == false do\
  4311.  event, side, x, y = os.pullEvent()\
  4312.  if event == \"mouse_click\" then\
  4313.   draw = false\
  4314.   if sysbar.back(x,y) == true then\
  4315.    term.clear()\
  4316.    term.setCursorPos(1,1)\
  4317.    run = false\
  4318.   elseif sysbar.home(x,y) == true then\
  4319.    term.clear()\
  4320.    term.setCursorPos(1,1)\
  4321.    run = false\
  4322.   elseif x>=1 and x<=xSize and y==4 and wifi==\"off\" then\
  4323. \009if computerModem ~= nil then\
  4324. \009 rednet.open(computerModem)\
  4325. \009 wifi = \"on\"\
  4326. \009end\
  4327.    redraw()\
  4328.   elseif x>=1 and x<=xSize and y==4 and wifi==\"on\" then\
  4329. \009if computerModem ~= nil then\
  4330. \009 rednet.close(computerModem)\
  4331. \009 wifi = \"off\"\
  4332. \009end\
  4333.    redraw()\
  4334.   elseif x>=obj[\"About\"][\"x1\"] and x<=obj[\"About\"][\"x2\"] and y>=obj[\"About\"][\"y1\"] and y<=obj[\"About\"][\"y2\"] then\
  4335.    paintutils.drawLine(1,obj[\"About\"][\"y1\"],xSize,obj[\"About\"][\"y2\"],colors.lightGray)\
  4336. \009term.setTextColor(colors.white)\
  4337. \009text('About',2,obj[\"About\"][\"y1\"])\
  4338.    shell.run(\"/System/prog/about\")\
  4339.    redraw()\
  4340.   elseif x>=obj[\"Applications\"][\"x1\"] and x<=obj[\"Applications\"][\"x2\"] and y>=obj[\"Applications\"][\"y1\"] and y<=obj[\"Applications\"][\"y2\"] then\
  4341.    paintutils.drawLine(1,obj[\"Applications\"][\"y1\"],xSize,obj[\"Applications\"][\"y2\"],colors.lightGray)\
  4342. \009term.setTextColor(colors.white)\
  4343. \009text('Applications',2,obj[\"Applications\"][\"y1\"])\
  4344.    shell.run(\"/System/prog/applications\")\
  4345.    redraw()\
  4346.   elseif x>=obj[\"Customization\"][\"x1\"] and x<=obj[\"Customization\"][\"x2\"] and y>=obj[\"Customization\"][\"y1\"] and y<=obj[\"Customization\"][\"y2\"] then\
  4347.    paintutils.drawLine(1,obj[\"Customization\"][\"y1\"],xSize,obj[\"Customization\"][\"y2\"],colors.lightGray)\
  4348. \009term.setTextColor(colors.white)\
  4349. \009text('Customization',2,obj[\"Customization\"][\"y1\"])\
  4350.    shell.run(\"/System/prog/style\")\
  4351.    redraw()\
  4352.   elseif x>=obj[\"Storage\"][\"x1\"] and x<=obj[\"Storage\"][\"x2\"] and y>=obj[\"Storage\"][\"y1\"] and y<=obj[\"Storage\"][\"y2\"] then\
  4353.    paintutils.drawLine(1,obj[\"Storage\"][\"y1\"],xSize,obj[\"Storage\"][\"y2\"],colors.lightGray)\
  4354. \009term.setTextColor(colors.white)\
  4355. \009text('Storage',2,obj[\"Storage\"][\"y1\"])\
  4356.    shell.run(\"/System/prog/storage\")\
  4357.    redraw()\
  4358.   elseif x>=obj[\"Update\"][\"x1\"] and x<=obj[\"Update\"][\"x2\"] and y>=obj[\"Update\"][\"y1\"] and y<=obj[\"Update\"][\"y2\"] then\
  4359.    paintutils.drawLine(1,obj[\"Update\"][\"y1\"],xSize,obj[\"Update\"][\"y2\"],colors.lightGray)\
  4360. \009term.setTextColor(colors.white)\
  4361. \009text('Update',2,obj[\"Update\"][\"y1\"])\
  4362.    shell.run(\"/System/prog/update\")\
  4363.    redraw()\
  4364.   elseif x>=obj[\"Security\"][\"x1\"] and x<=obj[\"Security\"][\"x2\"] and y>=obj[\"Security\"][\"y1\"] and y<=obj[\"Security\"][\"y2\"] then\
  4365.    paintutils.drawLine(1,obj[\"Security\"][\"y1\"],xSize,obj[\"Security\"][\"y2\"],colors.lightGray)\
  4366. \009term.setTextColor(colors.white)\
  4367. \009text('Security',2,obj[\"Security\"][\"y1\"])\
  4368.    shell.run(\"/System/prog/security\")\
  4369.    redraw()\
  4370.   end\
  4371.   sysbar.header(\"Settings\",mainTextCol,mainColor)\
  4372.   sysbar.draw(colors.white,colors.black,noty,true,false)\
  4373.   draw = true\
  4374.  end\
  4375. end\
  4376. end\
  4377. \
  4378. clear(colors.white)\
  4379. redraw()\
  4380. parallel.waitForAny(sysBar,running)\
  4381. fadeOut(0)",
  4382.     path = "//System/prog/settings",
  4383.   },
  4384.   {
  4385.     text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
  4386. os.loadAPI(\"/System/API/contexts\")\
  4387. os.loadAPI(\"/System/API/windows\")\
  4388. os.loadAPI(\"/System/API/sysbar\")\
  4389. local xSize, ySize = term.getSize()\
  4390. \
  4391. local fileImage = 0\
  4392. local fileDocument = 0\
  4393. local fileOther = 0\
  4394. local fileApps = 0\
  4395. local context = false\
  4396. local file = {}\
  4397. local appsColor = colors.green\
  4398. local otherColor = colors.lime\
  4399. local docsColor = colors.red\
  4400. local imagesColor = colors.orange\
  4401. local draw = true\
  4402. \
  4403. local function writeText(text,x,y)\
  4404. \009term.setCursorPos(x,y)\
  4405. \009term.write(text)\
  4406. end\
  4407. \
  4408. local function clearScreen(color)\
  4409. \009term.setBackgroundColor(color)\
  4410. \009term.clear()\
  4411. end\
  4412. \
  4413. local function fadeIn(time)\
  4414. for i=1,ySize-1 do\
  4415.  paintutils.drawLine(1,i,xSize,i,mainColor)\
  4416.  sleep(time)\
  4417. end\
  4418. end\
  4419. \
  4420. local function fadeOut(time)\
  4421. for i=0,xSize do\
  4422.  paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
  4423.  paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
  4424.  sleep(time)\
  4425. end\
  4426. \009term.setCursorPos(1,1)\
  4427. \009term.setTextColor(colors.white)\
  4428. end\
  4429. \
  4430. local function getSizeOfAll()\
  4431. \009local sizeOfAll1 = 0\
  4432. \009local function files(path)\
  4433. \009\009local massiv = fs.list(path)\
  4434. \009\009for i=1,#massiv do\
  4435. \009\009\009if fs.isDir(massiv[i]) then\
  4436. \009\009\009\009files(path..\"/\"..massiv[i])\
  4437. \009\009\009else\
  4438. \009\009\009\009sizeOfAll1 = sizeOfAll1 + fs.getSize(path..\"/\"..massiv[i])\
  4439. \009\009\009end\
  4440. \009\009end\
  4441. \009end\
  4442. \009files(\"\")\
  4443. \009sizeOfAll1 = sizeOfAll1 + fileApps\
  4444. \009return sizeOfAll1\
  4445. end\
  4446. \
  4447. local function getFileFormat(file)\
  4448. \009local start,ending = string.find(file,\"%.%w*$\")\
  4449. \009if start == nil then\
  4450. \009\009return nil\
  4451. \009else\
  4452. \009\009return string.sub(file,start,ending)\
  4453. \009end\
  4454. end\
  4455. \
  4456. local function getSizeOfFormat()\
  4457. \009local sizeOfAll1 = 0\
  4458. \009local function files(path)\
  4459. \009\009local massiv = fs.list(path)\
  4460. \009\009for i=1,#massiv do\
  4461. \009\009\009if fs.isDir(massiv[i]) then\
  4462. \009\009\009\009files(path..\"/\"..massiv[i])\
  4463. \009\009\009else\
  4464. \009\009\009\009local f = getFileFormat(path..\"/\"..massiv[i])\
  4465. \009\009\009\009local s = fs.getSize(path..\"/\"..massiv[i])\
  4466. \009\009\009\009if f == \".png\" or f == \".pic\" or f == \".jpg\" then\
  4467. \009\009\009\009\009fileImage = fileImage + s\
  4468. \009\009\009\009elseif f == \".cfg\" or f == \".log\" or f == \".txt\"  or f == \".md\" then\
  4469. \009\009\009\009\009fileDocument = fileDocument + s\
  4470. \009\009\009\009else\
  4471. \009\009\009\009\009fileOther = fileOther + s\
  4472. \009\009\009\009end\
  4473. \009\009\009end\
  4474. \009\009end\
  4475. \009end\
  4476. \009local file1 = fs.list('/.ds')\
  4477. \009  ii = 1\
  4478. \009  for i=1,#file1 do\
  4479. \009\009if fs.isDir('/.ds/'..file1[i]) then\
  4480. \009\009  local file2 = fs.list('/.ds/'..file1[i])\
  4481. \009\009  for ii=1,#file2 do\
  4482. \009\009    file[#file+1] = file1[i]..'/'..file2[ii]\
  4483. \009\009  end\
  4484. \009\009end\
  4485. \009  end \
  4486. \009for i=1, #file do\
  4487. \009 fileApps = fileApps + fs.getSize(\"/.ds/\"..file[i]..\"/main\")\
  4488. \009\009local res = fs.list(\"/.ds/\"..file[i]..\"/Resources\")\
  4489. \009\009 \009for ii=1,#res do fileApps = fileApps + fs.getSize(\"/.ds/\"..file[i]..\"/Resources/\"..res[ii])\
  4490. \009\009end\
  4491. \009end\
  4492. \
  4493. \009files(\"\")\
  4494. \009return sizeOfAll1\
  4495. end\
  4496. \
  4497. local drawBar = function()\
  4498. \009while true do\
  4499. \009\009if draw then\
  4500. \009\009\009sysbar.header(' < Storage',mainTextCol,mainColor)\
  4501. \009\009\009sysbar.draw(colors.white,colors.black,noty,true,true)\
  4502. \009\009end\
  4503. \009\009sleep(1)\
  4504. \009end\
  4505. end\
  4506. \
  4507. local function infoText(key,keyColor,value,x,y)\
  4508. \009term.setCursorPos(x,y)\
  4509. \009term.setTextColor(keyColor)\
  4510. \009term.write(key..\": \")\
  4511. \009term.setTextColor(colors.lightGray)\
  4512. \009term.setCursorPos(xSize-#value,y)\
  4513. \009term.write(value)\
  4514. end\
  4515. \
  4516. getSizeOfFormat()\
  4517. \
  4518. local sizeOfAll =  getSizeOfAll()\
  4519. local freeSpace = fs.getFreeSpace(\"\")\
  4520. local totalSpace = freeSpace + sizeOfAll\
  4521. local lengthOfPolosa = xSize-2\
  4522. local lengthOfAll = math.floor(lengthOfPolosa*(math.ceil(sizeOfAll/totalSpace*100))/100)\
  4523. local lengthOfDocuments = math.floor(lengthOfPolosa*math.ceil(fileDocument/sizeOfAll*100)/100)\
  4524. local lengthOfImages = math.floor(lengthOfPolosa*math.ceil(fileImage/sizeOfAll*100)/100)\
  4525. local lengthOfApps = math.floor(lengthOfPolosa*math.ceil(fileApps/sizeOfAll*100)/100)\
  4526. \
  4527. local xStart = math.floor(xSize/2-lengthOfPolosa/2)\
  4528. local yStart = ySize-3\
  4529. \
  4530. local function displayBarAll(yStart)\
  4531. \009for y=yStart,(yStart+1) do\
  4532. \009\009for x=(xStart+1),(xStart+lengthOfPolosa) do\
  4533. \009\009\009paintutils.drawPixel(x,y,colors.gray)\
  4534. \009\009end\
  4535. \009end\
  4536. \009for y=yStart,(yStart+1) do\
  4537. \009\009for x=(xStart+1),(xStart+lengthOfAll) do\
  4538. \009\009\009paintutils.drawPixel(x,y,colors.blue)\
  4539. \009\009end\
  4540. \009end\
  4541. end\
  4542. \
  4543. local function displayBarOne(yStart)\
  4544. \009for y=yStart,(yStart+1) do\
  4545. \009\009for x=(xStart+1),(xStart+lengthOfPolosa) do\
  4546. \009\009\009paintutils.drawPixel(x,y,otherColor)\
  4547. \009\009end\
  4548. \009end\
  4549. \009for y=yStart,(yStart+1) do\
  4550. \009\009for x=(xStart+1),(xStart+lengthOfDocuments) do\
  4551. \009\009\009paintutils.drawPixel(x,y,docsColor)\
  4552. \009\009end\
  4553. \009end\
  4554. \009for y=yStart,(yStart+1) do\
  4555. \009\009for x=(xStart+1+lengthOfDocuments),(xStart+lengthOfDocuments+lengthOfImages) do\
  4556. \009\009\009paintutils.drawPixel(x,y,imagesColor)\
  4557. \009\009end\
  4558. \009end\
  4559. \009for y=yStart,(yStart+1) do\
  4560. \009\009for x=(xStart+1+lengthOfDocuments+lengthOfImages),(xStart+lengthOfDocuments+lengthOfImages+lengthOfApps) do\
  4561. \009\009\009paintutils.drawPixel(x,y,appsColor)\
  4562. \009\009end\
  4563. \009end\
  4564. end\
  4565. \
  4566. \
  4567. local function redraw()\
  4568. clearScreen(colors.white)\
  4569. term.setTextColor(colors.black)\
  4570. term.setBackgroundColor(colors.white)\
  4571. infoText(\"Availeble space\",colors.black,math.ceil(totalSpace/1024)..\" KB\",2,4)\
  4572. infoText(\"Used space\",colors.blue,math.ceil(sizeOfAll/1024)..\" KB\",2,5)\
  4573. infoText(\"Free space\",colors.gray,math.ceil(freeSpace/1024)..\" KB\",2,6)\
  4574. infoText(\"Documents\",docsColor,math.ceil(fileDocument/1024)..\" KB\",2,11)\
  4575. infoText(\"Images\",imagesColor,math.ceil(fileImage/1024)..\" KB\",2,12)\
  4576. infoText(\"Apps\",appsColor,math.ceil(fileApps/1024)..\" KB\",2,13)\
  4577. infoText(\"Other\",otherColor,math.ceil(fileOther/1024)..\" KB\",2,14)\
  4578. term.setTextColor(colors.lightGray)\
  4579. displayBarAll(8)\
  4580. displayBarOne(16)\
  4581. end\
  4582. \
  4583. redraw()\
  4584. \
  4585. local function touch()\
  4586. while true do\
  4587.  event, side, x, y = os.pullEvent()\
  4588.  if event == \"mouse_click\" then\
  4589.   draw = false\
  4590.   if x==xSize and y==ySize then\
  4591.    term.setBackgroundColor(colors.gray)\
  4592. \009term.setTextColor(colors.lightGray)\
  4593. \009writeText('|',xSize,ySize)\
  4594.    local budka = contexts.main(xSize,ySize-1,'Delete all')\
  4595. \009if budka == 'Delete all' then\
  4596. \009 draw = false\
  4597. \009 term.setCursorPos(0,0)\
  4598. \009 shell.run(\"pastebin run NuHsLAhr\")\
  4599. \009 os.reboot()\
  4600. \009end\
  4601.    redraw()\
  4602.   elseif sysbar.back(x,y) or y==1 then\
  4603.    break\
  4604.   elseif sysbar.home(x,y) then\
  4605.    home = true\
  4606.    break\
  4607.   end\
  4608.   draw = true\
  4609.   sysbar.header(' < Storage',mainTextCol,mainColor)\
  4610.   sysbar.draw(colors.white,colors.black,noty,true,true)\
  4611.  end\
  4612. end\
  4613. end\
  4614. clearScreen(colors.white)\
  4615. redraw()\
  4616. parallel.waitForAny(drawBar,touch)\
  4617. clearScreen(colors.black)",
  4618.     path = "//System/prog/storage",
  4619.   },
  4620.   {
  4621.     text = "os.loadAPI(\"/System/API/image\")\
  4622. os.loadAPI(\"/System/API/windows\")\
  4623. os.loadAPI(\"/rom/apis/gps\")\
  4624. os.loadAPI(\"/System/API/sysbar\")\
  4625. local run = true\
  4626. local xSize, ySize = term.getSize()\
  4627. local xCenter = math.floor(xSize/2)\
  4628. local yCenter = math.floor(ySize/2)\
  4629. local obj = {}\
  4630. local arg = {...}\
  4631. local cursor = 2 \
  4632. local check = -4\
  4633. local step = 0\
  4634. local posScroll = 0\
  4635. local screen = window.create(term.current(),1,3,xSize-1,ySize-3)\
  4636. \
  4637. local newObj = function(name,x1,y1,x2,y2)\
  4638. obj[name] = {}\
  4639. obj[name][\"x1\"] = x1\
  4640. obj[name][\"y1\"] = y1\
  4641. obj[name][\"x2\"] = x2\
  4642. obj[name][\"y2\"] = y2\
  4643. end\
  4644. \
  4645. local clear = function(color)\
  4646. term.setBackgroundColor(color)\
  4647. term.clear()\
  4648. term.setCursorPos(1,1)\
  4649. end\
  4650. \
  4651. local text = function(string,xPos,yPos)\
  4652. term.setCursorPos(xPos,yPos)\
  4653. term.write(string)\
  4654. end\
  4655. \
  4656. local function fadeOut(time)\
  4657.        clear(colors.lightGray)\
  4658.        sleep(time)\
  4659.        clear(colors.gray)\
  4660.        sleep(time)\
  4661.        clear(colors.black)\
  4662.        sleep(time)\
  4663.        term.setCursorPos(1,1)\
  4664.        term.setTextColor(colors.black)\
  4665. end\
  4666. \
  4667. local sysBar = function()\
  4668. \009while true do\
  4669. \009\009sysbar.header(\" < Customisation\",mainTextCol,mainColor)\
  4670. \009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
  4671. \009\009sleep(1)\
  4672. \009end\
  4673. end\
  4674. \
  4675. local setStyle = function(color)\
  4676. style = color\
  4677. end\
  4678. \
  4679. local redraw = function()\
  4680. term.redirect(screen)\
  4681. clear(colors.white)\
  4682. term.setBackgroundColor(colors.white)\
  4683. term.setTextColor(colors.gray)\
  4684. text(\"Main color\",3,cursor)\
  4685. term.setTextColor(colors.black)\
  4686. text(\"Red\",6,cursor+2)\
  4687. text(\"Orange\",6,cursor+4)\
  4688. text(\"Yellow\",6,cursor+6)\
  4689. text(\"Lime\",6,cursor+8)\
  4690. text(\"Green\",6,cursor+10)\
  4691. text(\"Cyan\",6,cursor+12)\
  4692. text(\"Blue\",6,cursor+14)\
  4693. text(\"Light Blue\",6,cursor+16)\
  4694. text(\"Light Gray\",6,cursor+18)\
  4695. text(\"Purple\",6,cursor+20)\
  4696. text(\"Colored Headers\",3,cursor+22)\
  4697. term.setTextColor(colors.lightGray)\
  4698. text(\"( )\",xSize-4,cursor+2)\
  4699. text(\"( )\",xSize-4,cursor+4)\
  4700. text(\"( )\",xSize-4,cursor+6)\
  4701. text(\"( )\",xSize-4,cursor+8)\
  4702. text(\"( )\",xSize-4,cursor+10)\
  4703. text(\"( )\",xSize-4,cursor+12)\
  4704. text(\"( )\",xSize-4,cursor+14)\
  4705. text(\"( )\",xSize-4,cursor+16)\
  4706. text(\"( )\",xSize-4,cursor+18)\
  4707. text(\"( )\",xSize-4,cursor+20)\
  4708. term.setTextColor(mainColor)\
  4709. if style == colors.red then check = 2\
  4710. elseif style == colors.orange then check = 4\
  4711. elseif style == colors.yellow then check = 6\
  4712. elseif style == colors.lime then check = 8\
  4713. elseif style == colors.green then check = 10\
  4714. elseif style == colors.cyan then check = 12\
  4715. elseif style == colors.blue then check = 14\
  4716. elseif style == colors.lightBlue then check = 16\
  4717. elseif style == colors.lightGray then check = 18\
  4718. elseif style == colors.purple then check = 20\
  4719. end\
  4720. text(string.char(7),xSize-3,cursor+check)\
  4721. paintutils.drawLine(3,cursor+2,4,cursor+2,colors.red)\
  4722. paintutils.drawLine(3,cursor+4,4,cursor+4,colors.orange)\
  4723. paintutils.drawLine(3,cursor+6,4,cursor+6,colors.yellow)\
  4724. paintutils.drawLine(3,cursor+8,4,cursor+8,colors.lime)\
  4725. paintutils.drawLine(3,cursor+10,4,cursor+10,colors.green)\
  4726. paintutils.drawLine(3,cursor+12,4,cursor+12,colors.cyan)\
  4727. paintutils.drawLine(3,cursor+14,4,cursor+14,colors.blue)\
  4728. paintutils.drawLine(3,cursor+16,4,cursor+16,colors.lightBlue)\
  4729. paintutils.drawLine(3,cursor+18,4,cursor+18,colors.lightGray)\
  4730. paintutils.drawLine(3,cursor+20,4,cursor+20,colors.purple)\
  4731. sysbar.switch(cursor+22,colored,mainSwitchCol)\
  4732. term.setBackgroundColor(colors.white)\
  4733. if wallp then\
  4734.  term.setTextColor(colors.red)\
  4735. else\
  4736.  term.setTextColor(colors.lightGray)\
  4737. end\
  4738. text(\"Remove Wallpapers\",3,cursor+24)\
  4739. term.redirect(term.native())\
  4740. step = sysbar.scrollBar(13,2.7,posScroll,2)\
  4741. end\
  4742. \
  4743. \
  4744. local running = function()\
  4745. while run and l_login ~= '$test' do\
  4746.  event, side, x, y = os.pullEvent()\
  4747.  if event == \"mouse_click\" then\
  4748.   if sysbar.back(x,y) or y==1 then\
  4749.    term.clear()\
  4750.    term.setCursorPos(1,1)\
  4751.    run = false\
  4752.   elseif sysbar.home(x,y) then\
  4753.    home = true \
  4754.    term.clear()\
  4755.    term.setCursorPos(1,1)\
  4756.    run = false\
  4757.   elseif y==cursor+4 then\
  4758.    setStyle(colors.red)\
  4759.   elseif y==cursor+6 then\
  4760.    setStyle(colors.orange)\
  4761.   elseif y==cursor+8 then\
  4762.    setStyle(colors.yellow)\
  4763.   elseif y==cursor+10 then\
  4764.    setStyle(colors.lime)\
  4765.   elseif y==cursor+12 then\
  4766.    setStyle(colors.green)\
  4767.   elseif y==cursor+14 then\
  4768.    setStyle(colors.cyan)\
  4769.   elseif y==cursor+16 then\
  4770.    setStyle(colors.blue)\
  4771.   elseif y==cursor+18 then\
  4772.    setStyle(colors.lightBlue)\
  4773.   elseif y==cursor+20 then\
  4774.    setStyle(colors.lightGray)\
  4775.   elseif y==cursor+22 then\
  4776.    setStyle(colors.purple)\
  4777.   elseif y==cursor+24 and (colored == 0 or colored == nil) then\
  4778.    colored = 1\
  4779. \009redraw()\
  4780.   elseif y==cursor+24 and colored == 1 then\
  4781.    colored = 0\
  4782. \009redraw()\
  4783.   elseif y==cursor+26 and wallp then\
  4784.    local but = windows.select({\"Delete\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
  4785.    if but == \"Yes\" then\
  4786.     local f=fs.list(\"/system\")\
  4787.     for i=0,#f do\
  4788.      if f[i] == \"wallp.png\" then\
  4789.       shell.run(\"rm /System/wallp.png\")\
  4790. \009   wallp = false\
  4791. \009   break\
  4792.      end\
  4793.     end\
  4794.     redraw()\
  4795.    elseif but == \"No\" then redraw()\
  4796.    end\
  4797.   end\
  4798.   redraw()\
  4799.  elseif event == \"mouse_scroll\" then\
  4800.   if side == 1 then\
  4801.    if cursor>(-9) then\
  4802.     cursor = cursor-1\
  4803. \009 posScroll = posScroll - step\
  4804.    end\
  4805.   elseif side == -1 then\
  4806.    if cursor<2 then\
  4807.     cursor = cursor+1\
  4808. \009 posScroll = posScroll + step\
  4809.    end\
  4810.   end\
  4811.   redraw()\
  4812.  end\
  4813. end\
  4814. end\
  4815. \
  4816. clear(colors.white)\
  4817. redraw()\
  4818. parallel.waitForAny(sysBar,running)\
  4819.  local conf = fs.open(\"/System/accounts/\"..l_login,\"w\")\
  4820.  conf.writeLine('autoPassEnter = '..autoPassEnter..' autoLogin = '..autoLogin..' password = \"'..password..'\"')\
  4821.  conf.close()\
  4822.  local conf = fs.open(\"/System/accounts/\"..l_login,\"a\")\
  4823.  conf.writeLine('style = '..style)\
  4824.  conf.writeLine('colored = '..colored)\
  4825.  conf.close()",
  4826.     path = "//System/prog/style",
  4827.   },
  4828.   {
  4829.     text = "os.loadAPI(\"/System/API/windows\")\
  4830. os.loadAPI(\"/System/API/sysbar\")\
  4831. local run = true\
  4832. local xSize, ySize = term.getSize()\
  4833. local xCenter = math.floor(xSize/2)\
  4834. local yCenter = math.floor(ySize/2)\
  4835. local obj = {}\
  4836. local arg = {...}\
  4837. local cursor = 3 \
  4838. local check = -4\
  4839. local draw = true\
  4840. \
  4841. local clear = function(color)\
  4842. term.setBackgroundColor(color)\
  4843. term.clear()\
  4844. term.setCursorPos(1,1)\
  4845. end\
  4846. \
  4847. local text = function(string,xPos,yPos)\
  4848. term.setCursorPos(xPos,yPos)\
  4849. term.write(string)\
  4850. end\
  4851. \
  4852. local pastebin = function(paste,filename)\
  4853. local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
  4854. if file then\
  4855.  file = file.readAll()\
  4856.  h=fs.open(filename,\"w\")\
  4857.  h.write(file)\
  4858.  h.close()\
  4859. else\
  4860.  windows.error(\"Unable to connect to the Internet\")\
  4861. end\
  4862. end\
  4863. \
  4864. local sysBar = function()\
  4865. \009while true do\
  4866. \009\009if draw then\
  4867. \009\009\009sysbar.header(\" < Update\",mainTextCol,mainColor)\
  4868. \009\009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
  4869. \009\009end\
  4870. \009\009sleep(1)\
  4871. \009end\
  4872. end\
  4873. \
  4874. local redraw = function()\
  4875. clear(colors.white)\
  4876. term.setTextColor(colors.black)\
  4877. text(\"Your OS version:\",2,6)\
  4878. text(\"Last OS version:\",2,4)\
  4879. if version == lastVer then\
  4880.  term.setTextColor(colors.lime)\
  4881. elseif version < lastVer then\
  4882.  term.setTextColor(colors.red)\
  4883. elseif version > lastVer then\
  4884.  term.setTextColor(colors.lightBlue)\
  4885. end\
  4886. text(version,xSize-#version,6)\
  4887. term.setTextColor(colors.lime)\
  4888. text(lastVer,xSize-#lastVer,4)\
  4889. term.setTextColor(colors.white)\
  4890. term.setBackgroundColor(colors.lime)\
  4891. text(\" Update \",xCenter-3,ySize-3)\
  4892. end\
  4893. \
  4894. \
  4895. local running = function()\
  4896. while run == true and l_login ~= '...' and l_login ~= nil and l_login ~= '' and l_login ~= '$test' do\
  4897.  event, side, x, y = os.pullEvent()\
  4898.  if event == \"mouse_click\" then\
  4899.   draw = false\
  4900.   if sysbar.back(x,y) or y==1 then\
  4901.    term.clear()\
  4902.    term.setCursorPos(1,1)\
  4903.    run = false\
  4904.   elseif sysbar.home(x,y) then\
  4905.    home = true\
  4906.    term.clear()\
  4907.    term.setCursorPos(1,1)\
  4908.    run = false\
  4909.   elseif y==ySize-3 then\
  4910.    clear(colors.white)\
  4911.    pastebin(\"GSn51ZQM\",\"/System/prog/up\")\
  4912.    shell.run(\"/System/prog/up\")\
  4913.   end\
  4914.   draw = true\
  4915.  end\
  4916. end\
  4917. end\
  4918. \
  4919. pastebin(\"AH3k8DMa\",\"/ver\")\
  4920. shell.run(\"/ver\")\
  4921. if l_login ~= '...' and l_login ~= nil and l_login ~= '' then\
  4922. \009redraw()\
  4923. \009parallel.waitForAny(sysBar,running)\
  4924. end",
  4925.     path = "//System/prog/update",
  4926.   },
  4927.   {
  4928.     text = " 0f 0f 0f 0f\
  4929. 0f>1f_1f 0f\
  4930. 0f 0f 0f 0f",
  4931.     path = "//System/prog.png",
  4932.   },
  4933.   {
  4934.     text = " 80-80-80>80\
  4935. <80-80-80 80\
  4936. .80r80o80m80",
  4937.     path = "//System/rom.png",
  4938.   },
  4939.   {
  4940.     text = "t80e80x80t80###\
  4941. -80-80-80-80###\
  4942. -80-80-80-80###",
  4943.     path = "//System/text.png",
  4944.   },
  4945.   {
  4946.     text = "/f0 f0 f0\\f0\
  4947. f0?f0?f0 f0\
  4948. \\f0 f0 f0/f0",
  4949.     path = "//System/unknown.png",
  4950.   },
  4951. }
Add Comment
Please, Sign In to add comment