Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- {
- text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
- os.loadAPI(\"/System/API/context\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/System/API/sysbar\")\
- os.loadAPI(\"/System/API/image\")\
- local xSize, ySize = term.getSize()\
- local xCenter, yCenter = math.floor(xSize/2), math.floor(ySize/2)\
- local run = true\
- local digits = {'0.png','1.png','2.png','3.png','4.png','5.png','6.png','7.png','8.png','9.png','dots.png'}\
- local comp = 0\
- if xSize > 30 then comp = 1 end\
- \
- local function clear(color)\
- \009term.setBackgroundColor(color)\
- \009term.clear()\
- end\
- \
- local function fadeIn(time)\
- for i=1,ySize-1 do\
- paintutils.drawLine(1,i,xSize,i,mainColor)\
- sleep(time)\
- end\
- end\
- \
- local function fadeOut(time)\
- for i=0,xSize do\
- paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
- paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
- sleep(time)\
- end\
- \009term.setCursorPos(1,1)\
- \009term.setTextColor(colors.white)\
- end\
- \
- local function text(text,x,y)\
- \009term.setCursorPos(x,y)\
- \009term.write(text)\
- end\
- \
- local sysBar = function()\
- term.setTextColor(colors.black)\
- term.setBackgroundColor(colors.white)\
- sysbar.draw(colors.white,colors.black,noty,true,false,false)\
- end\
- \
- local formatTime = function(nTime)\
- local nHour = math.floor(nTime)\
- local nMinute = math.floor((nTime - nHour)*60)\
- return nHour, nMinute\
- end\
- \
- local drawDots = function()\
- \009while true do\
- \009\009image.draw(xCenter,yCenter-3,'/System/clocks/'..digits[11])\
- \009\009sleep(0.5)\
- \009\009paintutils.drawFilledBox(xCenter,yCenter-3,xCenter+1,yCenter+3,style)\
- \009\009sleep(0.5)\
- \009end\
- end\
- \
- local globalClock = function(time)\
- \009while true do\
- \009\009local globalTime = os.time()\
- \009\009local hour, minute = formatTime(globalTime)\
- \009\009paintutils.drawFilledBox(xCenter-10,yCenter-3,xCenter-1,yCenter+3,style)\
- \009\009paintutils.drawFilledBox(xCenter+3,yCenter-3,xCenter+11,yCenter+3,style)\
- \009\009image.draw(xCenter-10,yCenter-3,'/System/clocks/'..digits[math.floor(hour/10)+1])\
- \009\009image.draw(xCenter-5,yCenter-3,'/System/clocks/'..digits[math.floor(hour%10)+1])\
- \009\009image.draw(xCenter+3,yCenter-3,'/System/clocks/'..digits[math.floor(minute/10)+1])\
- \009\009image.draw(xCenter+8,yCenter-3,'/System/clocks/'..digits[math.floor(minute%10)+1])\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local function redraw()\
- clear(style)\
- sysBar()\
- end\
- \
- local function touch()\
- while true do\
- --clock()\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- if sysbar.back(x,y) then\
- break\
- elseif sysbar.home(x,y) then\
- home = true\
- break\
- end\
- end\
- end\
- end\
- \
- redraw()\
- parallel.waitForAny(globalClock,touch,drawDots)\
- clear(colors.black)",
- path = "//.ds/sys/Clock.apk/main",
- },
- {
- text = "\\80 80|80|80 70/80\
- -80_f0_f0/f0 70-80\
- -80 00 70 70 70-80\
- /80 00|80|80 00\\80",
- path = "//.ds/sys/Clock.apk/Resources/icon.png",
- },
- {
- text = "shell.run(\"/System/prog/settings\")",
- path = "//.ds/sys/Settings.apk/main",
- },
- {
- text = "[80O80-80-80-80]80\
- [80-80-80-80O80]80\
- [80-80O80-80-80]80\
- C80o80n80f80i80g80",
- path = "//.ds/sys/Settings.apk/Resources/icon.png",
- },
- {
- text = "os.loadAPI(\"/System/API/image\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/System/API/zip\")\
- local run = true\
- local xSize, ySize = term.getSize()\
- local obj = {}\
- local screen = 1\
- local maxScreen = 5\
- local instFolder = \"/.ds/\"..l_login..'/'\
- local objName = {}\
- local id = 0\
- local mods = \"\"\
- \
- local newObj = function(name,x1,y1,x2,y2)\
- obj[name] = {}\
- obj[name][\"x1\"] = x1\
- obj[name][\"y1\"] = y1\
- obj[name][\"x2\"] = x2\
- obj[name][\"y2\"] = y2\
- end\
- \
- local pastebin = function(paste,filename)\
- local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
- if file then\
- file = file.readAll()\
- h=fs.open(filename,\"w\")\
- h.write(file)\
- h.close()\
- else\
- windows.error(\"Failed to connect to pastebin.com\")\
- end\
- end\
- \
- local clear = function(color)\
- term.setBackgroundColor(color)\
- term.clear()\
- term.setCursorPos(1,1)\
- end\
- \
- local usualText = function(string,xPos,yPos)\
- term.setCursorPos(xPos,yPos)\
- term.write(string)\
- end\
- \
- \
- local sysBar = function()\
- local time = textutils.formatTime(os.time(),true)\
- term.setTextColor(colors.lightGray)\
- term.setBackgroundColor(colors.white)\
- usualText(\"Store@\",1,1)\
- sysbar.draw(colors.white,colors.black,noty,true,false)\
- paintutils.drawLine(xSize,1,xSize,ySize,colors.gray)\
- paintutils.drawLine(xSize,(ySize/maxScreen*screen)-(ySize/maxScreen)+1,xSize,ySize/maxScreen*screen,colors.white)\
- term.setTextColor(colors.gray)\
- usualText(screen,xSize,(ySize/maxScreen*screen)-(ySize/maxScreen)+1)\
- end\
- \
- local app = function(name,x,y,info,by)\
- image.draw(x,y,\"/store-icons/\"..name..\".png\")\
- term.setBackgroundColor(colors.white)\
- term.setTextColor(colors.lime)\
- usualText(name,x+7,y)\
- term.setBackgroundColor(colors.white)\
- term.setTextColor(colors.black)\
- usualText(info,x+7,y+1)\
- term.setTextColor(colors.lightGray)\
- term.setBackgroundColor(colors.white)\
- usualText(\"By \",x+7,y+2)\
- term.write(by)\
- mods = \" Install \"\
- term.setTextColor(colors.white)\
- term.setBackgroundColor(colors.lime)\
- local files = fs.list(instFolder)\
- for i=1,#files do \
- if files[i] == name..\".apk\" then\
- mods=\" Update \"\
- term.setTextColor(colors.lime)\
- term.setBackgroundColor(colors.white)\
- end\
- end\
- if name == 'Store@' then \
- term.setTextColor(colors.lime)\
- term.setBackgroundColor(colors.white)\
- mods = ' Update '\
- end\
- usualText(mods,xSize-1-#mods,y+3)\
- newObj(name,xSize-1-#mods,y+3,xSize-2,y+3)\
- newObj(name..\".inf\",2,y,xSize-2,y+2)\
- id=id+1\
- objName[id] = name\
- end\
- \
- local delObj = function()\
- for i=1,(screen-1)*3 do\
- obj[objName[i]][\"x1\"]=-1\
- obj[objName[i]][\"y1\"]=-1\
- obj[objName[i]][\"x2\"]=-1\
- obj[objName[i]][\"y2\"]=-1\
- end\
- end\
- \
- local appinfo = function(name,by)\
- clear(colors.white)\
- sysBar()\
- image.draw(2,3,\"/store-icons/\"..name..\".png\")\
- term.setBackgroundColor(colors.white)\
- term.setTextColor(colors.lime)\
- usualText(name,9,3)\
- term.setTextColor(colors.lightGray)\
- usualText(\"By: \",9,4)\
- term.write(by)\
- mods = \" Install \"\
- term.setTextColor(colors.white)\
- term.setBackgroundColor(colors.lime)\
- local files = fs.list(instFolder)\
- for i=1,#files do \
- if files[i] == name..\".apk\" then\
- mods=\" Update \"\
- term.setTextColor(colors.lime)\
- term.setBackgroundColor(colors.white)\
- end\
- end\
- usualText(mods,xSize-1-#mods,6)\
- newObj(name..\".inf\",xSize-1-#mods,5,xSize-2,5)\
- id=id+1\
- objName[id] = name..\".inf\"\
- end\
- \
- local redraw = function()\
- clear(colors.white)\
- sysBar()\
- if screen == 1 then\
- id = 0\
- delObj()\
- app(\"Store@\",2,3,\"Apps Store\",\"-DECE-\")\
- app(\"ImageViewer\",2,9,\"Image browser\",\"-DECE-\")\
- app(\"FileBrowser\",2,15,\"File manager\",\"-DECE-\")\
- elseif screen == 2 then\
- delObj()\
- app(\"Photoshop\",2,3,\"Image editor\",\"ECS\")\
- app(\"Ink\",2,9,\"Text editor\",\"OEED\",\" Install \")\
- app(\"QuickShell\",2,15,\"Shell\",\"OEED\",\" Install \")\
- elseif screen == 3 then\
- delObj()\
- app(\"Maze3D\",2,3,\"3D game\",\"JESUSTHEKILLER\")\
- app(\"NanoMaze\",2,9,\"Mazes in CC\",\"JESUSTHEKILLER\")\
- app(\"Minesweeper\",2,15,\"Game\",\"GopherAtl\")\
- elseif screen == 4 then\
- delObj()\
- app(\"FlappyPixel\",2,3,\"Game\",\"Creator\")\
- app(\"gtRemote\",2,9,\"Remote turtle\",\"Dog\")\
- app(\"Udo\",2,15,\"Pocket Todo List\",\"Zambonie\")\
- elseif screen == 5 then\
- delObj()\
- app(\"PackageInstaller\",2,3,\"For custom apps\",\"-DECE-\")\
- app(\"Backup\",2,9,\"Backup and restore\",\"-DECE-\")\
- end\
- end\
- \
- local inst = function(name,code,path)\
- shell.run(\"rm \"..path..name..\".apk\")\
- clear(colors.white)\
- term.setTextColor(colors.black)\
- usualText(\"Installing \"..name,2,ySize-6)\
- usualText(\"Please wait...\",2,ySize-5)\
- paintutils.drawLine(2,ySize-2,xSize-1,ySize-2,colors.lightGray)\
- paintutils.drawLine(2,ySize-2,2,ySize-2,colors.lime)\
- pastebin(code,path..name..\".apk/main\")\
- paintutils.drawLine(3,ySize-2,3+5,ySize-2,colors.lime)\
- shell.run(\"mkdir \"..path..name..\".apk/Resources\")\
- paintutils.drawLine(9,ySize-2,8+5,ySize-2,colors.lime)\
- sleep(0.5)\
- shell.run(\"copy /store-icons/\"..name..\".png \"..path..name..\".apk/Resources\")\
- paintutils.drawLine(14,ySize-2,14+5,ySize-2,colors.lime)\
- sleep(0.5)\
- shell.run(\"rename \"..path..name..\".apk/Resources/\"..name..\".png \"..path..name..\".apk/Resources/icon.png\")\
- paintutils.drawLine(20,ySize-2,25,ySize-2,colors.lime)\
- sleep(0.5)\
- clear(colors.white)\
- if noty ~= nil then\
- noty[#noty+1]={[\"app\"]=name, [\"text\"]=name..\" installed\", [\"button\"]=\" Launch \", [\"ico\"]=string.char(25)}\
- else\
- noty[1]={[\"app\"]=name, [\"text\"]=name..\" installed\", [\"button\"]=\" Launch \", [\"ico\"]=string.char(25)}\
- end\
- redraw()\
- end\
- \
- local running = function()\
- while run == true and l_login ~= '...' and l_login ~= nil and l_login ~= '' do\
- event, side, x, y = os.pullEvent()\
- \
- if event == \"mouse_scroll\" then\
- if side == 1 then\
- screen = screen+1\
- if screen > maxScreen then\
- screen = maxScreen\
- else\
- clear(colors.white)\
- redraw()\
- end\
- elseif side == -1 then\
- screen = screen-1\
- if screen < 1 then\
- screen = 1\
- else\
- clear(colors.white)\
- redraw()\
- end\
- end\
- \
- elseif event == \"key\" then\
- if side == 208 then\
- screen = screen+1\
- if screen > maxScreen then\
- screen = maxScreen\
- else\
- clear(colors.white)\
- redraw()\
- end\
- elseif side == 200 then\
- screen = screen-1\
- if screen < 1 then\
- screen = 1\
- else\
- clear(colors.white)\
- redraw()\
- end\
- end\
- \
- elseif event == \"mouse_click\" then\
- if sysbar.back(x,y) == true then\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false \
- elseif sysbar.home(x,y) == true then\
- term.clear()\
- term.setCursorPos(1,1)\
- \009home = true\
- run = false\
- end\
- if screen == 1 then\
- if x>=obj[\"Store@\"][\"x1\"] and x<=obj[\"Store@\"][\"x2\"] and y>=obj[\"Store@\"][\"y1\"] and y<=obj[\"Store@\"][\"y2\"] and screen==1 then\
- inst(\"Store@\",\"g8LMzmxa\",'/.ds/sys/')\
- \009 run = false\
- \009 break\
- elseif x>=obj[\"ImageViewer\"][\"x1\"] and x<=obj[\"ImageViewer\"][\"x2\"] and y>=obj[\"ImageViewer\"][\"y1\"] and y<=obj[\"ImageViewer\"][\"y2\"] then\
- inst(\"ImageViewer\",\"tYNEKygi\",instFolder)\
- elseif x>=obj[\"FileBrowser\"][\"x1\"] and x<=obj[\"FileBrowser\"][\"x2\"] and y>=obj[\"FileBrowser\"][\"y1\"] and y<=obj[\"FileBrowser\"][\"y2\"] then\
- inst(\"FileBrowser\",\"2Xms362b\",instFolder)\
- pastebin(\"daqgga1q\",\"/icons.zip\")\
- zip.unarchive('/icons.zip','/')\
- shell.run('rm /icons.zip')\
- pastebin(\"pDdRdBkj\",\"/.ds/\"..l_login..\"/FileBrowser.apk/Resources/reader\")\
- end\
- elseif screen == 2 then\
- if x>=obj[\"QuickShell\"][\"x1\"] and x<=obj[\"QuickShell\"][\"x2\"] and y>=obj[\"QuickShell\"][\"y1\"] and y<=obj[\"QuickShell\"][\"y2\"] then\
- inst(\"QuickShell\",\"wwVmBJax\",instFolder)\
- elseif x>=obj[\"Ink\"][\"x1\"] and x<=obj[\"Ink\"][\"x2\"] and y>=obj[\"Ink\"][\"y1\"] and y<=obj[\"Ink\"][\"y2\"] then\
- inst(\"Ink\",\"JxzXPv03\",instFolder)\
- elseif x>=obj[\"Photoshop\"][\"x1\"] and x<=obj[\"Photoshop\"][\"x2\"] and y>=obj[\"Photoshop\"][\"y1\"] and y<=obj[\"Photoshop\"][\"y2\"] then\
- inst(\"Photoshop\",\"tK3FSmf2\",instFolder)\
- 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\
- appinfo(\"Photoshop\", \"ECS\")\
- end\
- elseif screen == 3 then\
- if x>=obj[\"Maze3D\"][\"x1\"] and x<=obj[\"Maze3D\"][\"x2\"] and y>=obj[\"Maze3D\"][\"y1\"] and y<=obj[\"Maze3D\"][\"y2\"] then\
- inst(\"Maze3D\",\"i7VkRaf6\",instFolder)\
- elseif x>=obj[\"NanoMaze\"][\"x1\"] and x<=obj[\"NanoMaze\"][\"x2\"] and y>=obj[\"NanoMaze\"][\"y1\"] and y<=obj[\"NanoMaze\"][\"y2\"] then\
- inst(\"NanoMaze\",\"m6WFB8D3\",instFolder)\
- elseif x>=obj[\"Minesweeper\"][\"x1\"] and x<=obj[\"Minesweeper\"][\"x2\"] and y>=obj[\"Minesweeper\"][\"y1\"] and y<=obj[\"Minesweeper\"][\"y2\"] then\
- inst(\"Minesweeper\",\"nsKrHTbN\",instFolder)\
- end\
- elseif screen == 4 then\
- if x>=obj[\"FlappyPixel\"][\"x1\"] and x<=obj[\"FlappyPixel\"][\"x2\"] and y>=obj[\"FlappyPixel\"][\"y1\"] and y<=obj[\"FlappyPixel\"][\"y2\"] then\
- inst(\"FlappyPixel\",\"4kqJKA42\",instFolder)\
- elseif x>=obj[\"gtRemote\"][\"x1\"] and x<=obj[\"gtRemote\"][\"x2\"] and y>=obj[\"gtRemote\"][\"y1\"] and y<=obj[\"gtRemote\"][\"y2\"] then\
- inst(\"gtRemote\",\"Cz31MiDJ\",instFolder)\
- pastebin(\"XQQsRyLX\",\"/.ds/\"..l_login..\"/gtRemote.apk/Resources/app\")\
- elseif x>=obj[\"Udo\"][\"x1\"] and x<=obj[\"Udo\"][\"x2\"] and y>=obj[\"Udo\"][\"y1\"] and y<=obj[\"Udo\"][\"y2\"] then\
- inst(\"Udo\",\"LKguNrXk\",instFolder)\
- end\
- elseif screen == 5 then\
- if x>=obj[\"PackageInstaller\"][\"x1\"] and x<=obj[\"PackageInstaller\"][\"x2\"] and y>=obj[\"PackageInstaller\"][\"y1\"] and y<=obj[\"PackageInstaller\"][\"y2\"] then\
- inst(\"PackageInstaller\",\"vVeK5iuD\",instFolder)\
- elseif x>=obj[\"Backup\"][\"x1\"] and x<=obj[\"Backup\"][\"x2\"] and y>=obj[\"Backup\"][\"y1\"] and y<=obj[\"Backup\"][\"y2\"] then\
- inst(\"Backup\",\"U6nc5vK1\",instFolder)\
- end\
- -- else\
- -- redraw()\
- end\
- end\
- end\
- end\
- \
- local start = function()\
- redraw()\
- running()\
- end\
- \
- local fadeX = function()\
- clear(colors.gray)\
- sleep(0.05)\
- clear(colors.lightGray)\
- sleep(0.05)\
- clear(colors.white)\
- end\
- \
- fadeX()\
- term.setTextColor(colors.black)\
- usualText(\"Loading...\",xSize-10,19)\
- pastebin(\"YAjRjaJM\",\"/store-icons.zip\")\
- zip.unarchive(\"/store-icons.zip\",\"/\")\
- if l_login == '...' or l_login == nil or l_login == '' then\
- \009pastebin(\"AH3k8DMa\",\"ver\")\
- \009shell.run('ver')\
- end\
- start()\
- fadeX()\
- shell.run(\"rm /store-icons\")\
- shell.run(\"rm /store-icons.zip\")\
- clear(colors.black)",
- path = "//.ds/sys/Store@.apk/main",
- },
- {
- text = "###=70=70=70=70###\
- _70_70_70_70_70_70\
- Se0t10o50r30eb0@a0\
- -70-70-70-70-70-70",
- path = "//.ds/sys/Store@.apk/Resources/icon.png",
- },
- {
- text = "mainColor = colors.lightGray\
- mainTextCol = colors.gray\
- mainSwitchCol = colors.lightBlue\
- \
- os.loadAPI(\"/System/API/image\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/System/API/zip\")\
- os.loadAPI(\"/System/API/sysbar\")\
- os.loadAPI(\"/System/API/contexts\")\
- \
- osLogo = '| '..string.char(7)..' ^ '..string.char(7)..' |'\
- osName = 'VedroidOS'\
- osexit = false\
- home = false\
- wallp = false\
- local xSize, ySize = term.getSize()\
- local centerX = math.floor(xSize/2)\
- local centerY = math.floor(ySize/2)\
- local comp = 0\
- if xSize > 30 then comp = 1 end\
- appHistory = {}\
- version = \"5.5.5\"\
- noty = {}\
- wifi = \"off\"\
- log = false\
- local appH = {}\
- local aph = \"0\"\
- local run = true\
- local obj = {}\
- local screen = 1\
- local maxScreen = 1\
- local deskS = 1\
- local maxDeskS = 1\
- local topM = \"0\"\
- local background = colors.lightBlue\
- local xp = 3\
- local yp = 3 - comp\
- local wallpapers = \"wallp.png\"\
- local notyPos = 1\
- local set = false\
- if style == nil then style = colors.lightBlue end\
- if colored == nil then colored = false end\
- local files = {}\
- local Napp = 0\
- local appMenu = false\
- local desk = {}\
- local editMode = false\
- local sear = nil\
- local addMode = false\
- local adds = 0\
- local draw = true\
- \
- function getColors()\
- \009return mainColor, mainTextCol, mainSwitchCol\
- end\
- \
- function os.run( _tEnv, _sPath, ... )\
- local tArgs = { ... }\
- local tEnv = _tEnv\
- setmetatable( tEnv, { __index = _G } )\
- local fnFile, err = loadfile( _sPath, tEnv )\
- if fnFile then\
- local ok, err = pcall( function()\
- fnFile( table.unpack( tArgs ) )\
- end )\
- if not ok then\
- if err and err ~= \"\" then\
- printError( err )\
- end\
- return err\
- end\
- return nil\
- end\
- if err and err ~= \"\" then\
- printError( err )\
- end\
- return err\
- end\
- \
- local function refreshFiles()\
- \009local sys = fs.list('/.ds/sys')\
- \009local filis = {}\
- \009for i=1,#sys do\
- \009\009filis[i] = 'sys/'..sys[i]\
- \009end\
- \009if l_login ~= '...' and l_login~='$test' then\
- \009\009local file = fs.list('/.ds/'..l_login)\
- \009\009if file ~= nil then\
- \009\009\009for i=#sys+1,#file+#sys do\
- \009\009\009\009filis[i] = l_login..'/'..file[i-#sys]\
- \009\009\009end\
- \009\009end\
- \009end\
- \009return filis\
- end\
- \
- local function saveDesk(table)\
- \009local file = fs.open('/System/desks/'..l_login,\"w\")\
- \009file.write(textutils.serialize(table))\
- \009file.close()\
- end\
- \
- local function refreshDesk()\
- \009local function load(name)\
- \009\009local file = fs.open(name,\"r\")\
- \009\009local data = file.readAll()\
- \009\009file.close()\
- \009\009return textutils.unserialize(data)\
- \009end\
- \009desk = load('/System/desks/'..l_login)\
- \009if editMode == false then\
- \009\009maxDeskS = #desk\
- \009end\
- end\
- \
- local newObj = function(name,x1,y1,x2,y2)\
- obj[name] = {}\
- obj[name][\"x1\"] = x1\
- obj[name][\"y1\"] = y1\
- obj[name][\"x2\"] = x2\
- obj[name][\"y2\"] = y2\
- end\
- \
- local pastebin = function(paste,filename)\
- \009local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
- \009if file then\
- \009\009file = file.readAll()\
- \009\009h=fs.open(filename,\"w\")\
- \009\009h.write(file)\
- \009\009h.close()\
- \009\009return true\
- \009else\
- \009\009windows.error(\"Unable to connect to the Internet\")\
- \009\009return false\
- \009end\
- end\
- \
- local clear = function(color)\
- \009term.setBackgroundColor(color)\
- \009term.clear()\
- \009term.setCursorPos(1,1)\
- end\
- \
- local usualText = function(string,xPos,yPos)\
- \009term.setCursorPos(xPos,yPos)\
- \009term.write(string)\
- end\
- \
- local fadeX = function()\
- clear(colors.gray)\
- sleep(0.05)\
- clear(colors.lightGray)\
- sleep(0.05)\
- clear(colors.lightBlue)\
- sleep(0.05)\
- end\
- \
- local drawBox = function(x1,y1,x2,y2,color1,color2,text)\
- \009term.setTextColor(color2)\
- \009term.setBackgroundColor(color1)\
- \009if text == nil then\
- \009\009text = \" \"\
- \009end\
- \009for i=x1, x2 do\
- \009\009for ii=y1, y2 do\
- \009\009\009usualText(text,i,ii)\
- \009\009end\
- \009end\
- end\
- \
- local app = function(name,ico,x,y)\
- \009image.draw(x,y,ico,6,4)\
- \009newObj(name,x,y,x+5,y+3)\
- end \
- \
- local drawn = function(app,text,button,y)\
- \009for i=0,3 do\
- \009\009paintutils.drawLine(xSize-25,y+i,xSize,y+i,colors.lightGray)\
- \009end\
- \009if app == 'Settings' or app == 'Store@' then \
- \009 image.draw(xSize-25,y,\"/.ds/sys/\"..app..\".apk/Resources/icon.png\",6,4)\
- \009else\
- \009 image.draw(xSize-25,y,\"/.ds/\"..l_login..'/'..app..\".apk/Resources/icon.png\",6,4)\
- \009end\
- \009term.setBackgroundColor(colors.lightGray)\
- \009term.setTextColor(colors.gray)\
- \009usualText(\"x\",xSize,y)\
- \009usualText(button,xSize-#button+1, y+3)\
- \009term.setTextColor(colors.white)\
- \009usualText(text,xSize-26+8,y+1)\
- \009newObj(app,xSize,y,xSize,y)\
- end\
- \
- local getStyle = function()\
- shell.run(\"style\")\
- end\
- \
- local shutAnimation = function()\
- \009fadeX()\
- \009clear(colors.white)\
- \009term.setTextColor(colors.lime)\
- \009usualText(osLogo,centerX-math.floor(#osLogo/2),centerY+1)\
- \009sleep(0.3)\
- \009usualText(osLogo,centerX-math.floor(#osLogo/2)-3,centerY+1)\
- \009term.setTextColor(colors.lightGray)\
- \009usualText('Goodbye',centerX-math.floor(#osLogo/2)+6,centerY+1)\
- \009sleep(0.5)\
- end\
- \
- local nativeReboot = os.reboot\
- os.reboot = function()\
- \009shutAnimation()\
- \009nativeReboot()\
- \009while true do\
- coroutine.yield()\
- end\
- end\
- \
- local nativeShutdown = os.shutdown\
- os.shutdown = function()\
- \009shutAnimation()\
- \009nativeShutdown()\
- while true do\
- coroutine.yield()\
- end\
- end\
- \
- local topMenu = function()\
- \009local time = textutils.formatTime(os.time(),true)\
- \009files = refreshFiles()\
- \009for i=1,#files do\
- \009\009newObj(files[i],-1,-1,-1,-1)\
- \009end\
- \009if comp == 0 then\
- \009\009if noty ~= nil then\
- \009\009\009for i=1,#noty do\
- \009\009\009\009drawn(noty[i][\"app\"],noty[i][\"text\"],noty[i][\"button\"],4*i+notyPos)\
- \009\009\009end\
- \009\009end\
- \009\009paintutils.drawLine(0,2,xSize,2,colors.gray)\
- \009\009term.setTextColor(colors.lightGray)\
- \009\009for i=1,4 do\
- \009\009\009paintutils.drawLine(0,i,xSize,i,colors.gray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009end\
- \009\009usualText(time,xSize-#time,1)\
- \009\009usualText(\"Settings\",2,3)\
- \009\009term.setTextColor(colors.lightGray)\
- \009\009usualText(string.char(31),11,3)\
- \009\009usualText(l_login,xSize-#l_login,3)\
- \009\009term.setTextColor(colors.white)\
- \009\009paintutils.drawLine(0,ySize,xSize,ySize,style)\
- \009\009usualText(\"^^\",xSize/2,ySize)\
- \009\009if #noty ~= 0 then\
- \009\009\009usualText(\"Clear\",xSize-4,ySize)\
- \009\009end\
- \009\009newObj(\"sett\",2,3,9,3)\
- \009\009if set==true then\
- \009\009\009for I=4,11 do\
- \009\009\009\009paintutils.drawLine(1,I,11,I,colors.white)\
- \009\009\009end\
- \009\009\009term.setTextColor(colors.gray)\
- \009\009\009usualText(\" \"..string.char(30),10,3)\
- \009\009\009usualText(\"Apps\",2,5)\
- \009\009\009usualText(\"Customize\",2,6)\
- \009\009\009usualText(\"Security\",2,7)\
- \009\009\009usualText(\"Storage\",2,8)\
- \009\009\009usualText(\"Update\",2,9)\
- \009\009\009usualText(\"About\",2,10)\
- \009\009end\
- \009else\
- \009\009if noty ~= nil then\
- \009\009\009for i=1,#noty do\
- \009\009\009\009drawn(noty[i][\"app\"],noty[i][\"text\"],noty[i][\"button\"],ySize-4*i-notyPos-1)\
- \009\009\009end\
- \009\009end\
- \009\009term.setTextColor(colors.lightGray)\
- \009\009for i=0,2 do\
- \009\009\009paintutils.drawLine(xSize-25,ySize-i,xSize,ySize-i,colors.gray)\
- \009\009end\
- \009\009term.setTextColor(colors.white)\
- \009\009usualText(time,xSize-#time-1,ySize)\
- \009\009usualText(\"Settings\",xSize-24,ySize-1)\
- \009\009term.setTextColor(colors.lightGray)\
- \009\009usualText(string.char(30),xSize-15,ySize-1)\
- \009\009usualText(l_login,xSize-#l_login,ySize-1)\
- \009\009newObj(\"sett\",xSize-24,ySize-1,xSize-17,ySize-1)\
- \009\009if set==true then\
- \009\009\009for I=2,9 do\
- \009\009\009\009paintutils.drawLine(xSize-25,ySize-I,xSize-15,ySize-I,colors.white)\
- \009\009\009end\
- \009\009\009term.setTextColor(colors.gray)\
- \009\009\009usualText(\" \"..string.char(31),xSize-16,ySize-1)\
- \009\009\009usualText(\"Apps\",xSize-24,ySize-8)\
- \009\009\009usualText(\"Customize\",xSize-24,ySize-7)\
- \009\009\009usualText(\"Security\",xSize-24,ySize-6)\
- \009\009\009usualText(\"Storage\",xSize-24,ySize-5)\
- \009\009\009usualText(\"Update\",xSize-24,ySize-4)\
- \009\009\009usualText(\"About\",xSize-24,ySize-3)\
- \009\009end\
- \009end\
- end\
- \
- local sysBar = function()\
- \009while true do\
- \009\009local noti = #noty\
- \009\009if draw and topM == \"0\" then\
- \009\009\009sysbar.draw(style,colors.white,noty,false,true)\
- \009\009end\
- \009\009if topM == \"1\" then\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009term.setBackgroundColor(colors.gray)\
- \009\009\009local time = textutils.formatTime(os.time(),true)\
- \009\009\009if comp == 0 then\
- \009\009\009\009usualText(time,xSize-#time,1)\
- \009\009\009else\
- \009\009\009\009usualText(time,xSize-#time-1,ySize)\
- \009\009\009end\
- \009\009end\
- \009\009sleep(1)\
- \009\009if noti < #noty then\
- \009\009\009local b = term.current()\
- \009\009\009local n = window.create(term.current(),xSize-25,1+(ySize-6)*comp+comp,26,4)\
- \009\009\009term.redirect(n)\
- \009\009\009clear(colors.lightGray)\
- \009\009\009if noty[#noty][\"app\"] == 'Settings' or noty[#noty][\"app\"] == 'Store@' then \
- \009\009\009\009image.draw(11,1,\"/.ds/sys/\"..noty[#noty][\"app\"]..\".apk/Resources/icon.png\",6,4)\
- \009\009\009else\
- \009\009\009\009image.draw(1,1,\"/.ds/\"..l_login..'/'..noty[#noty][\"app\"]..\".apk/Resources/icon.png\",6,4)\
- \009\009\009end\
- \009\009\009term.setBackgroundColor(colors.lightGray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009usualText(noty[#noty][\"text\"],8,2)\
- \009\009\009newObj(noty[#noty][\"app\"],25,1,25,1)\
- \009\009\009term.redirect(b)\
- \009\009\009sleep(1)\
- \009\009\009n.setVisible(false)\
- \009\009\009n.redraw()\
- \009\009\009n = nil\
- \009\009end\
- \009end\
- end\
- \
- local appHis = function()\
- clear(style)\
- sysBar()\
- if appHistory == {} then usualText(\"No recent apps\",xCenter-7,yCenter) end\
- usualText(\"App History\",1,1)\
- files = refreshFiles()\
- for i=1,#files do\
- newObj(files[i],-1,-1,-1,-1)\
- end\
- term.setTextColor(colors.black)\
- term.setBackgroundColor(colors.white)\
- for i=1,#appHistory do\
- if appHistory[i] == appHistory[i+1] then\
- for ii=i,#appHistory do\
- appHistory[ii] = appHistory[ii+1]\
- end\
- end\
- end\
- for i=1,#appHistory do\
- paintutils.drawLine(1,i*2+1,xSize,i*2+1,colors.white)\
- usualText(\"x\",xSize,i*2+1)\
- usualText(appHistory[i],1,i*2+1)\
- usualText(\" \",#appHistory[i]-3,i*2+1)\
- newObj(appHistory[i],1,i*2+1,#appHistory[i],i*2+1)\
- end\
- end\
- \
- local function redraw()\
- \009if l_login ~= '...' and (l_login == nil or l_login == '') then\
- \009\009pastebin(\"AH3k8DMa\",\"ver\")\
- \009\009shell.run('ver')\
- \009end\
- \009if colored == 1 then\
- \009\009mainColor = style\
- \009\009mainSwitchCol = style\
- \009\009mainTextCol = colors.white\
- \009else\
- \009\009mainColor = colors.lightGray\
- \009\009mainSwitchCol = colors.lightBlue\
- \009\009mainTextCol = colors.gray\
- \009end\
- \009set=false\
- \009clear(style)\
- \009wallp = false\
- \009local file = fs.list(\"/System\")\
- \009for i=1,#file do\
- \009\009if file[i] == wallpapers then\
- \009\009\009wallp = true\
- \009\009end\
- \009end\
- \009\009\
- \009if wallp then\
- \009\009image.draw(1,2-comp,\"/System/\"..wallpapers)\
- \009end\
- \009\
- \009newObj(\"sett\",-2,-2,-2,-2)\
- \009\
- \009if appMenu then\
- \009\
- \009\009paintutils.drawLine(3,2-comp,xSize-2,2-comp,colors.white)\
- \
- \009\009for i=1,maxScreen do\
- \009\009\009term.setTextColor(colors.lightGray)\
- \009\009\009usualText(string.char(7),xSize+i-maxScreen-4,2-comp)\
- \009\009\009term.setTextColor(style)\
- \009\009\009usualText(string.char(7),xSize+screen-maxScreen-4,2-comp) \
- \009\009end\
- \009\009usualText(string.char(30),xSize-2,2-comp)\
- \009\009\
- \009\009drawBox(3,3-comp,xSize-2,math.floor(ySize/(6-comp))*6-comp,colors.white,style,string.char(127))\
- \009\009if sear == nil then\
- \009\009\009files = refreshFiles()\
- \009\009end\
- \009\009maxScreen = 1 + math.floor(#files/(math.floor(xSize/8)*math.floor((ySize)/(6-comp))))\
- \009\009xp=3\
- \009\009yp=4 - comp\
- \009\009Napp = (screen-1)*(math.floor(xSize/8)*math.floor((ySize)/(6-comp)))+1\
- \
- \009\009for i=1,math.floor(ySize/(6-comp)) do\
- \009\009\009for ii=1,math.floor(xSize/(8)) do\
- \009\009\009\009if files[Napp] ~= nil then\
- \009\009\009\009\009if fs.exists(\"/.ds/\"..files[Napp]..\"/Resources/icon.png\") then\
- \009\009\009\009\009\009app(files[Napp],\"/.ds/\"..files[Napp]..\"/Resources/icon.png\",xp,yp)\
- \009\009\009\009\009else\
- \009\009\009\009\009\009app(files[Napp],\"/System/noico.png\",xp,yp)\
- \009\009\009\009\009end\
- \009\009\009\009\009if addMode == true then\
- \009\009\009\009\009\009usualText('+',xp,yp)\
- \009\009\009\009\009end\
- \009\009\009\009\009Napp = Napp + 1\
- \009\009\009\009\009xp = xp + 8\
- \009\009\009\009else\
- \009\009\009\009\009break\
- \009\009\009\009end\
- \009\009\009end\
- \009\009\009yp = yp + 5\
- \009\009\009xp = 3\
- \009\009end\
- \009else\
- \009\009addMode = false\
- \009\009adds = 0\
- \009\009sear = nil\
- \009\009if l_login~='$test' then\
- \009\009\009refreshDesk()\
- \009\009\009if desk[deskS] ~= nil then\
- \009\009\009\009for i=1,#desk[deskS] do\
- \009\009\009\009\009if desk[deskS][i] ~= nil then\
- \009\009\009\009\009\009if fs.exists(\"/.ds/\"..desk[deskS][i]['name']..\"/Resources/icon.png\") then\
- \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'])\
- \009\009\009\009\009\009else\
- \009\009\009\009\009\009\009if fs.exists(\"/.ds/\"..desk[deskS][i]['name']) then\
- \009\009\009\009\009\009\009\009app(desk[deskS][i]['name'],\"/System/noico.png\",desk[deskS][i]['x'],desk[deskS][i]['y'])\
- \009\009\009\009\009\009\009else\
- \009\009\009\009\009\009\009\009for ii=i,#desk[deskS]-1 do\
- \009\009\009\009\009\009\009\009\009desk[deskS][ii]=desk[deskS][ii+1]\
- \009\009\009\009\009\009\009\009end\
- \009\009\009\009\009\009\009\009desk[deskS][#desk[deskS]] = nil\
- \009\009\009\009\009\009\009\009saveDesk(desk)\
- \009\009\009\009\009\009\009\009refreshDesk()\
- \009\009\009\009\009\009\009\009redraw()\
- \009\009\009\009\009\009\009\009break\
- \009\009\009\009\009\009\009end\
- \009\009\009\009\009\009end\
- \009\009\009\009\009end\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009\009paintutils.drawLine(3,2-comp,xSize-2,2-comp,colors.white)\
- \009\009term.setTextColor(colors.lightGray)\
- \009\009usualText(string.char(31),xSize-2,2-comp)\
- \009\009for i=1,maxDeskS do\
- \009\009\009term.setTextColor(colors.lightGray)\
- \009\009\009usualText(string.char(7),xSize+i-maxDeskS-4,2-comp)\
- \009\009\009term.setTextColor(style)\
- \009\009\009usualText(string.char(7),xSize+deskS-maxDeskS-4,2-comp) \
- \009\009end\
- \009end\
- \009term.setTextColor(colors.lightGray)\
- \009term.setBackgroundColor(colors.white)\
- \009if editMode == false then\
- \009\009if sear then\
- \009\009\009usualText(sear,4,2-comp)\
- \009\009else\
- \009\009\009usualText('Search',4,2-comp)\
- \009\009end\
- \009else\
- \009\009usualText('Apply',4,2-comp)\
- \009\009usualText('+',xSize-2,2-comp)\
- \009\009term.setTextColor(colors.red)\
- \009\009if maxDeskS > 0 then\
- \009\009\009usualText('x',xSize-maxDeskS-5,2-comp)\
- \009\009end\
- \009\009if deskS > 1 then\
- \009\009\009drawBox(1,3-comp,1,ySize-2,style,colors.white,string.char(127))\
- \009\009end\
- \009\009drawBox(xSize,3-comp,xSize,ySize-2,style,colors.white,string.char(127))\
- \009end\
- end\
- \
- function runApp(app)\
- \009local error = shell.run(app)\
- \009term.redirect(term.native())\
- \009if error ~= nil then\
- \009\009redraw()\
- \009\009windows.error(error)\
- \009end\
- end\
- \
- os.pullEvent = function()\
- \009local event, side, x, y = os.pullEventRaw()\
- \009if event ~= \"terminate\" then\
- \009\009return event, side, x, y\
- \009end\
- end\
- \
- local running = function()\
- while run == true and osexit == false do\
- if home == true then\
- home = false\
- end\
- \
- if l_login ~= '...' and (l_login == nil or l_login == '') then\
- \009pastebin(\"AH3k8DMa\",\"ver\")\
- \009shell.run('ver')\
- end\
- \
- event, side, x, y = os.pullEvent()\
- \
- if event == \"mouse_scroll\" then\
- if side == 1 then\
- if topM==\"0\" then\
- if appMenu == true then\
- screen = screen+1\
- if screen > maxScreen then\
- screen = maxScreen\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009 else\
- \009 deskS = deskS+1\
- if deskS > maxDeskS then\
- deskS = maxDeskS\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009 end\
- elseif topM==\"1\" and #noty*4+4+notyPos-comp*2>ySize then\
- notyPos=notyPos-1\
- topMenu()\
- end\
- elseif side == -1 then\
- if topM==\"0\" then\
- if appMenu == true then\
- screen = screen-1\
- if screen < 1 then\
- screen = 1\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009 else\
- \009 deskS = deskS-1\
- if deskS < 1 then\
- deskS = 1\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009 end\
- elseif topM==\"1\" and #noty*4+5>ySize and notyPos<1 then\
- notyPos=notyPos+1\
- topMenu()\
- end\
- end\
- \
- elseif event == \"key\" then \
- if side == 205 and topM==\"0\" then\
- if appMenu == true then\
- screen = screen+1\
- if screen > maxScreen then\
- screen = maxScreen\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009else\
- \009 deskS = deskS+1\
- if deskS > maxDeskS then\
- deskS = maxDeskS\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009end\
- elseif side == 203 and topM==\"0\" then\
- if appMenu == true then\
- screen = screen-1\
- if screen < 1 then\
- screen = 1\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009else\
- \009 deskS = deskS-1\
- if deskS < 1 then\
- deskS = 1\
- else\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009end\
- end\
- \
- elseif event == \"mouse_click\" then\
- draw = false\
- if sysbar.notifyCheck(x,y) and topM == \"0\" then\
- topM = \"1\"\
- topMenu()\
- elseif (sysbar.back(x,y) or (x>=3 and x <=9 and y == 2-comp)) and editMode and topM == '0' then\
- \009editMode = false\
- \009redraw()\
- elseif sysbar.back(x,y) and editMode == false and topM == '0' then\
- if sear then\
- sear = nil\
- \009elseif addMode == true then\
- \009 addMode = false\
- \009elseif appMenu then\
- \009 appMenu = false\
- \009end\
- \009redraw()\
- elseif x>=xSize-3 and x<=xSize-2 and editMode and y == 2-comp then\
- maxDeskS = maxDeskS + 1\
- \009desk[maxDeskS] = {}\
- \009deskS = maxDeskS\
- \009saveDesk(desk)\
- \009redraw()\
- elseif x==xSize-maxDeskS-5 and editMode and y == 2-comp then\
- \009if deskS < maxDeskS then\
- \009 for i=deskS,maxDeskS do\
- \009 desk[i]=desk[i+1]\
- \009 end\
- \009end\
- \009desk[maxDeskS] = nil\
- \009maxDeskS = maxDeskS - 1\
- \009if deskS>maxDeskS then\
- \009 deskS = deskS-1\
- \009end\
- \009saveDesk(desk)\
- \009redraw()\
- elseif sysbar.home(x,y) and topM == '0' then\
- \009editMode = false\
- \009deskS = 1\
- \009appMenu = false\
- \009sear = nil\
- \009redraw()\
- elseif editMode == true then\
- local select = 0\
- \009local bx = 0\
- \009local by = 0\
- refreshDesk()\
- \009if #desk > 0 then\
- \009 for i=1,#desk[deskS] do\
- \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\
- \009 select = i\
- \009 bx = desk[deskS][select]['x']\
- \009 by = desk[deskS][select]['y']\
- \009 end\
- \009 end\
- \009end\
- \009if select ~= 0 then\
- \009 while true do\
- \009 local eve, si, xt, yt = os.pullEvent()\
- \009 if eve == \"mouse_drag\" then\
- \009 if yt>=3 and yt<=ySize-6+comp then\
- \009 desk[deskS][select]['x']=xt\
- \009 desk[deskS][select]['y']=yt\
- \009\009if xt>=xSize-1 then\
- \009 deskS = deskS+1\
- if deskS > maxDeskS then\
- \009\009 maxDeskS = maxDeskS + 1\
- deskS = maxDeskS\
- \009\009 desk[maxDeskS] = {}\
- \009\009 desk[deskS-1][select]['x']=4\
- \009\009 desk[deskS][#desk[deskS]+1] = desk[deskS-1][select]\
- \009\009 desk[deskS-1][select] = nil\
- \009\009 saveDesk(desk)\
- \009\009 redraw()\
- \009\009 break\
- else\
- \009\009 desk[deskS-1][select]['x']=3\
- \009\009 desk[deskS][#desk[deskS]+1] = desk[deskS-1][select]\
- \009\009 desk[deskS-1][select] = nil\
- clear(colors.lightBlue)\
- \009\009 select = #desk[deskS]\
- \009\009 saveDesk(desk)\
- \009\009 redraw()\
- \009\009 break\
- end\
- \009\009elseif xt<=2 then\
- \009\009 deskS = deskS-1\
- if deskS < 1 then\
- deskS = 1\
- else\
- \009\009 desk[deskS+1][select]['x']=math.floor((xSize/8)*8-8)\
- \009\009 desk[deskS][#desk[deskS]+1] = desk[deskS+1][select]\
- \009\009 desk[deskS+1][select] = nil\
- clear(colors.lightBlue)\
- \009\009 select = #desk[deskS]\
- \009\009 saveDesk(desk)\
- \009\009 redraw()\
- \009\009 break\
- end\
- \009\009end\
- \009\009saveDesk(desk)\
- \009 redraw()\
- \009 end\
- \009 elseif eve == \"mouse_scroll\" then\
- if si == 1 then\
- \009 deskS = deskS+1\
- if deskS > maxDeskS then\
- deskS = maxDeskS\
- else\
- \009\009 desk[deskS][#desk[deskS]+1] = desk[deskS-1][select]\
- \009\009 saveDesk(desk)\
- \009\009 select = #desk[deskS]\
- clear(colors.lightBlue)\
- redraw()\
- end\
- elseif si == -1 then\
- \009 deskS = deskS-1\
- if deskS < 1 then\
- deskS = 1\
- else\
- \009\009 desk[deskS][#desk[deskS]+1] = desk[deskS+1][select]\
- \009\009 saveDesk(desk)\
- \009\009 select = #desk[deskS]\
- clear(colors.lightBlue)\
- redraw()\
- end\
- \009 end\
- \009 elseif eve == \"mouse_up\" then\
- \009 for i=1,math.floor(xSize/8) do\
- \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\
- \009\009 desk[deskS][select]['x']=i*8-5\
- \009\009end\
- \009 end\
- \009 for i=1,math.floor(ySize/6) do\
- \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\
- \009\009 desk[deskS][select]['y']=i*5-(6-comp*4)\
- \009\009end\
- \009 end\
- \009 for i=1,#desk[deskS] do\
- \009 if desk[deskS][select]['x']==desk[deskS][i]['x'] and desk[deskS][select]['y']==desk[deskS][i]['y'] and i~=select then\
- \009\009 desk[deskS][i]['x'] = bx\
- \009\009 desk[deskS][i]['y'] = by\
- \009\009end\
- \009 end\
- \009 saveDesk(desk)\
- \009 redraw()\
- \009 select = 0\
- \009 break\
- \009 end\
- \009 end\
- \009end\
- elseif x==xSize and y==ySize and topM == '0' then\
- term.setBackgroundColor(colors.gray)\
- term.setTextColor(colors.lightGray)\
- usualText(\"|\",xSize,ySize)\
- term.setTextColor(colors.white)\
- \009local budka = ''\
- \009if appMenu == true then\
- \009 local a = \"Add to desktop\"\
- \009 if addMode then a = \"Apply\" end\
- \009 budka = contexts.main(x,y-1,a,\"Shutdown\",\"Reboot\",\"Wallpapers\")\
- \009else\
- \009 budka = contexts.main(x,y-1,\"Edit desktop\",\"Shutdown\",\"Reboot\",\"Wallpapers\")\
- \009end\
- if budka == \"Shutdown\" then\
- \009 os.shutdown()\
- \009elseif budka == \"Reboot\" then\
- \009 os.reboot()\
- \009elseif budka == \"Wallpapers\" then\
- \009 redraw()\
- \009 files = refreshFiles()\
- \009 local find = false\
- for i=1,#files do if files[i]==l_login..\"/ImageViewer.apk\" then find = true end end\
- \009 if find then\
- \009 shell.run(\"/.ds/\"..l_login..\"/ImageViewer.apk/main\")\
- \009 else\
- \009 local but = windows.select({\"ImageViewer not found\"},{\"Install it?\"},{\"Yes\",colors.lightBlue,colors.white},{\"No\",colors.gray,colors.white})\
- \009 if but == 'Yes' then\
- \009 shell.run(\"/.ds/sys/Store@.apk/main\")\
- \009 end\
- \009 redraw()\
- \009 end\
- redraw() \
- topM=\"0\"\
- \009elseif budka == \"Add to desktop\" and l_login~='$test' then\
- \009 addMode = true\
- \009 redraw()\
- \009elseif budka == \"Apply\" then\
- \009 addMode = false\
- \009 redraw()\
- \009elseif budka == \"Edit desktop\" and l_login~='$test' then\
- \009 editMode = true\
- \009 redraw()\
- \009elseif budka == nil then\
- \009 redraw()\
- \009end\
- elseif x>=obj[\"sett\"][\"x1\"] and x<=obj[\"sett\"][\"x2\"] and y>=obj[\"sett\"][\"y1\"] and y<=obj[\"sett\"][\"y2\"] and topM == \"1\" then\
- topM = \"0\"\
- shell.run(\"/System/prog/settings\")\
- redraw()\
- elseif x>=xSize-#l_login and ((y==3 and comp == 0 ) or (y==ySize-1 and comp == 1))and topM==\"1\" then\
- log = false\
- l_login = \"...\"\
- shell.run(\"/ver\")\
- topM=\"0\"\
- \009files = refreshFiles()\
- redraw()\
- 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\
- set=true\
- topMenu()\
- elseif topM==\"1\" and set==true then\
- 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\
- \009\009topM = '0'\
- \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
- \009\009shell.run(\"/System/prog/applications\")\
- \009\009redraw()\
- 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\
- \009\009topM = '0'\
- \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
- \009\009shell.run(\"/System/prog/style\")\
- \009\009redraw()\
- 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\
- \009\009topM = '0'\
- \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
- \009\009shell.run(\"/System/prog/security\")\
- \009\009redraw()\
- 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\
- \009\009topM = '0'\
- \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
- \009\009shell.run(\"/System/prog/storage\")\
- \009\009redraw()\
- 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\
- \009\009topM = '0'\
- \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
- \009\009shell.run(\"/System/prog/update\")\
- \009\009redraw()\
- 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\
- \009\009topM = '0'\
- \009\009paintutils.drawLine(1,1,xSize,1,colors.lightGray)\
- \009\009shell.run(\"/System/prog/about\")\
- \009\009redraw()\
- else\
- \009\009redraw()\
- \009\009topM=\"1\"\
- \009\009topMenu()\
- end\
- if ((y>=5 or y<=10) and comp == 0) or ((y>=ySize-2 or y<=ySize-10) and comp == 1) and x<=11 then\
- topM=\"0\"\
- redraw()\
- end\
- elseif x>=xSize-4 and x<=xSize and y==ySize and topM==\"1\" then\
- noty = {}\
- redraw()\
- topM=\"0\"\
- elseif x>=1 and x<=xSize and y==ySize and topM==\"1\" then\
- redraw()\
- topM = \"0\"\
- notyPos=1\
- elseif x>=3 and x<=xSize-4 and y==2-comp and topM==\"0\" then\
- if appMenu then\
- \009\009screen = 1\
- \009\009sear = nil\
- \009\009sear = sysbar.search(\"*\",false,true)\
- \009\009if sear then\
- \009\009\009local file = refreshFiles()\
- \009\009\009files = {}\
- \009\009\009local ii=1\
- \009\009\009for i=1,#file do\
- \009\009\009\009if (string.find(file[i],sear) ~= nil) and (string.find(file[i],sear) < #file[i]-3) then\
- \009\009\009\009\009files[ii]=file[i]\
- \009\009\009\009\009ii=ii+1\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009else\
- \009\009local op = sysbar.search(\"*\",true)\
- \009\009if op~=nil and fs.isDir(op)==false then\
- \009\009\009shell.run(op)\
- \009\009end\
- \009end\
- \009redraw()\
- elseif x==xSize-2 and y==2-comp then\
- if appMenu == true then\
- \009 appMenu = false\
- \009 redraw()\
- \009else\
- \009 appMenu = true\
- \009 redraw()\
- \009end\
- else\
- if side == 1 then\
- \009 if appMenu then\
- for i=(screen-1)*(math.floor(xSize/8)*math.floor((ySize)/(6-comp)))+1,Napp-1 do\
- 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\
- if appHistory ~= nil then\
- appHistory[#appHistory+1]=files[i]\
- else\
- appHistory[1]=files[i]\
- end\
- for ii=1,#files do\
- newObj(files[ii],-1,-1,-1,-1)\
- end\
- \009\009if addMode == true then\
- \009\009 if #desk < 1 then\
- \009\009 desk[1] = {}\
- \009\009 deskS = 1\
- \009\009 end\
- \009\009 desk[deskS][#desk[deskS]+1] = {}\
- \009\009 desk[deskS][#desk[deskS]]['name']=files[i]\
- \009\009 desk[deskS][#desk[deskS]]['x']=3+adds\
- \009\009 desk[deskS][#desk[deskS]]['y']=ySize-6\
- \009\009 adds = adds + 2\
- \009\009 saveDesk(desk)\
- \009\009 if math.floor(adds/2) > math.floor(xSize/8)-1 then\
- \009\009 adds = 0\
- \009\009 appMenu = false\
- \009\009 addMode = false\
- \009\009 end\
- \009\009 redraw()\
- \009\009else\
- \009\009 topM=\"0\"\
- \009\009 screen = 1\
- \009\009 appMenu = false\
- \009\009 clear(colors.black)\
- runApp(\"/.ds/\"..files[i]..\"/main\")\
- \009\009 break\
- \009\009end\
- end\
- end\
- \009 redraw()\
- \009 elseif appMenu == false and #desk > 0 and l_login~='$test' then\
- \009 refreshDesk()\
- \009 for i=1,#desk[deskS] do\
- \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\
- clear(colors.black)\
- if appHistory ~= nil then\
- appHistory[#appHistory+1]=desk[deskS][i]['name']\
- else\
- appHistory[1]=desk[deskS][i]['name']\
- end\
- topM=\"0\"\
- \009\009clear(colors.black)\
- runApp(\"/.ds/\"..desk[deskS][i]['name']..\"/main\")\
- \009\009break\
- end\
- \009 end\
- \009 redraw()\
- end\
- for i=1,#noty do\
- 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\
- clear(colors.black)\
- \009 topM=\"0\"\
- \009 if noty[i][\"app\"] == 'Settings' or noty[i][\"app\"] == 'Store@' then\
- \009 shell.run(\"/.ds/sys/\"..noty[i][\"app\"]..\".apk/main\")\
- \009 else\
- shell.run(\"/.ds/\"..l_login..\"/\"..noty[i][\"app\"]..\".apk/main\")\
- \009 end\
- if noty[i+1] ~= nil then\
- for i=i,#noty do\
- noty[i] = noty[i+1]\
- end\
- else\
- noty[i] = nil\
- end\
- redraw()\
- break\
- 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\
- if noty[i+1] ~= nil then\
- for i=i,#noty do\
- noty[i] = noty[i+1]\
- end\
- else\
- noty[i] = nil\
- end\
- if notyPos<-3 then\
- notyPos=notyPos+4\
- else\
- notyPos=1\
- redraw()\
- end\
- topMenu()\
- break\
- end\
- end\
- for i=1,#appHistory do\
- if x==xSize and y==i*2+1 and aph == \"1\" then\
- if appHistory[i+1] ~= nil then\
- for ii=i,#appHistory do\
- appHistory[ii] = appHistory[ii+1]\
- end\
- else\
- appHistory[i] = nil\
- end\
- appHis()\
- break\
- end\
- end\
- end\
- end\
- draw = true\
- end\
- sysbar.draw(style,colors.white,noty,false,true)\
- if topM == \"1\" then\
- topMenu()\
- end\
- end\
- end\
- \
- local start = function()\
- redraw()\
- running()\
- end\
- \
- fadeX()\
- clear(colors.white)\
- term.setTextColor(colors.lightGray)\
- usualText('Vedroid',centerX-4,centerY-1)\
- term.setTextColor(colors.lime)\
- usualText('OS',centerX+3,centerY-1)\
- usualText(osLogo,centerX-math.floor(#osLogo/2),centerY+6)\
- usualText(\".\",centerX,ySize-1)\
- local web = pastebin(\"AH3k8DMa\",\"ver\")\
- if not web then\
- \009term.setBackgroundColor(colors.white)\
- end\
- sleep(0.1)\
- usualText(\"..\",centerX,ySize-1)\
- sleep(0.1)\
- usualText(\"...\",centerX-1,ySize-1)\
- sleep(0.1)\
- shell.run(\"ver\")\
- if l_login == '...' then l_login = '$test' end\
- local f = fs.list('/.ds')\
- local find = false\
- if #f ~= nil then\
- \009for i=1, #f do\
- \009\009if f[i] ~= nil and f[i] == l_login then find = true end\
- \009end\
- end\
- if find == false and l_login ~= '...' then\
- \009shell.run('mkdir /.ds/'..l_login)\
- else\
- \009shell.run(\"/System/accounts/\"..l_login)\
- end\
- find = false\
- local f = fs.list('/System/desks')\
- for i=1, #f do\
- \009if f[i] == l_login then find = true end\
- end\
- if find == false then\
- \009shell.run('mkdir /System/desks')\
- \009local desk = {}\
- \009desk[1] = {}\
- \009desk[1][1] = {}\
- \009desk[1][1]['name']='sys/Store@.apk'\
- \009desk[1][1]['x']=3\
- \009desk[1][1]['y']=ySize-6\
- \009local file = fs.open('/System/desks/'..l_login,\"w\")\
- \009file.write(textutils.serialize(desk))\
- \009file.close()\
- end\
- f = nil\
- find = nil\
- \
- clear(colors.white)\
- local workPath = \"/.ds/\"..l_login\
- parallel.waitForAny(sysBar,start)\
- fadeX()\
- clear(colors.black)",
- path = "//startup",
- },
- {
- text = " 70 70 70 70 70 70 70 70\
- 70C70h70a70n70g70e70 70\
- 70 70 70 70 70 70 70 70\
- 70 70I70m70a70g70e70 70\
- 70 70 70 70 70 70 70 70",
- path = "//System/acc.png",
- },
- {
- text = "{...}",
- path = "//System/accounts/accs.back",
- },
- {
- text = "local xSize, ySize = term.getSize()\
- local comp = false\
- \
- local usualText = function(string,xPos,yPos)\
- \009term.setCursorPos(xPos,yPos)\
- \009term.write(string)\
- end\
- \
- function main(...)\
- \009local waitFor = true\
- \009local x = arg[1]\
- \009local y = arg[2]\
- \009local maxLenth = 3\
- \009local output = nil\
- \009for i=3,#arg do\
- \009\009if #arg[i] > maxLenth then\
- \009\009\009maxLenth = #arg[i]\
- \009\009end\
- \009end\
- \009maxLenth = maxLenth + 1\
- \009local xend = x+maxLenth\
- \009local yend = y+#arg-1\
- \009if x+maxLenth > xSize then\
- \009\009xend = x\
- \009\009x = x-maxLenth\
- \009end\
- \009if y+#arg > ySize then\
- \009\009yend = y\
- \009\009y = y-#arg+1\
- \009end\
- \009paintutils.drawFilledBox(x,y,xend,yend,colors.gray)\
- \009term.setTextColor(colors.white)\
- \009for i=3,#arg do\
- \009\009usualText(arg[i],x+math.floor((maxLenth-1)/2)-math.floor(#arg[i]/2)+1,y+i-2)\
- \009end\
- \009while waitFor do\
- \009\009event, side, xp, yp = os.pullEvent()\
- \009\009if event == 'mouse_click' then \
- \009\009\009for i=1,#arg-2 do\
- \009\009\009\009if xp >= x and xp <= xend and yp >= y and yp <= yend then\
- \009\009\009\009\009if yp == y+i then\
- \009\009\009\009\009\009paintutils.drawFilledBox(x,y+i,xend,y+i,colors.lightGray)\
- \009\009\009\009\009\009usualText(arg[i+2],x+math.floor((maxLenth-1)/2)-math.floor(#arg[i+2]/2)+1,y+i)\
- \009\009\009\009\009\009sleep(0.1)\
- \009\009\009\009\009\009output = arg[i+2]\
- \009\009\009\009\009end\
- \009\009\009\009end\
- \009\009\009end\
- \009\009\009return output\
- \009\009end\
- \009end\
- end",
- path = "//System/API/contexts",
- },
- {
- text = "function draw(startX,startY,image,cutX,cutY)\
- \009local Colors = {\
- \009\009[\"0\"] = 1,\
- \009\009[\"1\"] = 2,\
- \009\009[\"2\"] = 4,\
- \009\009[\"3\"] = 8,\
- \009\009[\"4\"] = 16,\
- \009\009[\"5\"] = 32,\
- \009\009[\"6\"] = 64,\
- \009\009[\"7\"] = 128,\
- \009\009[\"8\"] = 256,\
- \009\009[\"9\"] = 512,\
- \009\009[\"a\"] = 1024,\
- \009\009[\"b\"] = 2048,\
- \009\009[\"c\"] = 4096,\
- \009\009[\"d\"] = 8192,\
- \009\009[\"e\"] = 16384,\
- \009\009[\"f\"] = 32768\
- \009}\
- \009local Pixels = {}\
- \009\
- \009local function convert(mode,color)\
- \009\009if mode == \"from cc\" then\
- \009\009\009for key,value in pairs(Colors) do\
- \009\009\009\009if color == value then\
- \009\009\009\009\009return key\
- \009\009\009\009end\
- \009\009\009end\
- \009\009else\
- \009\009\009if color == \"#\" then\
- \009\009\009\009return \"0\"\
- \009\009\009else\
- \009\009\009\009return Colors[color]\
- \009\009\009end\
- \009\009end\
- \009end\
- \
- \009local function load(path)\
- \009\009local file = fs.open(path,\"r\")\
- \009\009local lineCounter = 1\
- \009\009while true do\
- \009\009\009local line = file.readLine()\
- \009\009\009Pixels[lineCounter]={}\
- \009\009\009if line ~= nil then\
- \009\009\009\009for i=1,#line,3 do\
- \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))}\
- \009\009\009\009end\
- \009\009\009\009lineCounter = lineCounter + 1\
- \009\009\009else\
- \009\009\009\009break\
- \009\009\009end\
- \009\009end\
- \009\009file.close()\
- \009end\
- \
- \009load(image)\
- \009\
- \009if cutX == nil or cutY == nil then\
- \009\009cutX = #Pixels[1]\
- \009\009cutY = #Pixels-1\
- \009else\
- \009\009if cutY >= #Pixels then cutY = #Pixels-1 end\
- \009\009if cutX > #Pixels[1] then cutX = #Pixels[1] end\
- \009end\
- \009\
- \009local function LT()\
- \009\009for y=1,math.floor(cutY/2) do\
- \009\009\009for x=1,math.floor(cutX/2) do\
- \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" then\
- \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
- \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
- \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
- \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- \009\
- \009local function LD()\
- \009\009for y=math.floor(cutY/2)+1,cutY do\
- \009\009\009for x=1,math.floor(cutX/2) do\
- \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" then\
- \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
- \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
- \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
- \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- \009\
- \009local function RT()\
- \009\009for y=1,math.floor(cutY/2) do\
- \009\009\009for x=math.floor(cutX/2)+1,cutX do\
- \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" then\
- \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
- \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
- \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
- \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\009\
- \009\
- \009local function RD()\
- \009\009for y=math.floor(cutY/2)+1,cutY do\
- \009\009\009for x=math.floor(cutX/2)+1,cutX do\
- \009\009\009\009if Pixels[y][x][\"symbol\"] ~= \"#\" and Pixels[y][x][\"symbol\"] ~= \"\" then\
- \009\009\009\009\009term.setTextColor(Pixels[y][x][\"textColor\"])\
- \009\009\009\009\009term.setBackgroundColor(Pixels[y][x][\"backColor\"])\
- \009\009\009\009\009term.setCursorPos(startX+x-1,startY+y-1)\
- \009\009\009\009\009term.write(Pixels[y][x][\"symbol\"])\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- \009\009\
- \009parallel.waitForAll(LT,RT,LD,RD)\
- end",
- path = "//System/API/image",
- },
- {
- text = "local xSize, ySize = term.getSize()\
- local comp = false\
- os.loadAPI('/System/API/windows')\
- \
- local usualText = function(string,xPos,yPos)\
- \009term.setCursorPos(xPos,yPos)\
- \009term.write(string)\
- end\
- \
- function draw(color,textColor,noty,inapp,settings,timer)\
- \009local time = ''\
- \009if timer ~= false then\
- \009\009time = textutils.formatTime(os.time(),true)\
- \009end\
- \009\009\
- \009local obj = {}\
- \009if xSize > 30 then comp = true end\
- \009\
- \009if comp == false then\
- \009\009term.setTextColor(textColor)\
- \009\009if inapp == false then\
- \009\009\009paintutils.drawLine(0,1,xSize,1,color)\
- \009\009\009usualText(time,xSize-#time,1)\
- \009\009\009if noty~=nil then\
- \009\009\009\009for i=1,#noty do\
- \009\009\009\009\009if noty[i][\"ico\"] ~= nil then\
- \009\009\009\009\009\009usualText(noty[i][\"ico\"],i,1)\
- \009\009\009\009\009else\
- \009\009\009\009\009\009usualText(\"+\",i,1)\
- \009\009\009\009\009end\
- \009\009\009\009end\
- \009\009\009end\009\
- \009\009end\
- \009\009paintutils.drawLine(0,ySize,xSize,ySize,color)\
- \009\009usualText(\"()\",xSize/2,ySize)\
- \009\009usualText(\"<<\",xSize/2-4,ySize)\
- \009\009usualText(\"[]\",xSize/2+4,ySize)\
- \009\009if settings == true then\
- \009\009\009usualText(\"|\",xSize,ySize)\
- \009\009end\
- \009elseif comp == true then\
- \009\009paintutils.drawLine(0,ySize,xSize,ySize,color)\
- \009\009term.setTextColor(textColor)\
- \009\009usualText(time,xSize-#time-1,ySize)\
- \009\009usualText(\"()\",5,ySize)\
- \009\009usualText(\"<<\",2,ySize)\
- \009\009usualText(\"[]\",8,ySize)\
- \009\009if settings == true then\
- \009\009\009usualText(\"|\",xSize,ySize)\
- \009\009end\
- \009\009if noty~=nil then\
- \009\009\009for i=1,#noty do\
- \009\009\009\009if noty[i][\"ico\"] ~= nil then\
- \009\009\009\009\009usualText(noty[i][\"ico\"],xSize-2-i-#time,ySize)\
- \009\009\009\009else\
- \009\009\009\009\009usualText(\"+\",xSize-2-i-#time,ySize)\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- end\
- \
- function back(x,y)\
- \009if xSize > 30 then comp = true end\
- \009if comp == false then\
- \009\009if (x >= math.floor(xSize/2)-4 and x <= math.floor(xSize/2)-3) and y==ySize then\
- \009\009\009term.setBackgroundColor(colors.lightGray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009usualText(\" << \",xSize/2-5,ySize)\
- \009\009\009sleep(0.1)\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009elseif comp == true then\
- \009\009if (x == 2 or x == 3) and y==ySize then\
- \009\009\009term.setBackgroundColor(colors.lightGray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009usualText(\" << \",1,ySize)\
- \009\009\009sleep(0.1)\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009end\
- end\
- \
- function home(x,y)\
- \009if xSize > 30 then comp = true end\
- \009if comp == false then\
- \009\009if (x >= math.floor(xSize/2) and x <= math.floor(xSize/2)+1) and y==ySize then\
- \009\009\009term.setBackgroundColor(colors.lightGray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009usualText(\" () \",xSize/2-1,ySize)\
- \009\009\009sleep(0.1)\
- \009\009\009home = true\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009elseif comp == true then\
- \009\009if (x == 5 or x == 6) and y==ySize then\
- \009\009\009term.setBackgroundColor(colors.lightGray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009usualText(\" () \",4,ySize)\
- \009\009\009sleep(0.1)\
- \009\009\009home = true\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009end\
- end\
- \
- function recents(x,y)\
- \009if xSize > 30 then comp = true end\
- \009if comp == false then\
- \009\009if (x >= math.floor(xSize/2)+4 and x <= math.floor(xSize/2)+5) and y==ySize then\
- \009\009\009term.setBackgroundColor(colors.lightGray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009usualText(\" [] \",xSize/2+3,ySize)\
- \009\009\009sleep(0.1)\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009elseif comp == true then\
- \009\009if (x == 8 or x == 9) and y==ySize then\
- \009\009\009term.setBackgroundColor(colors.lightGray)\
- \009\009\009term.setTextColor(colors.white)\
- \009\009\009usualText(\" [] \",7,ySize)\
- \009\009\009sleep(0.1)\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009end\
- end\
- \
- function notifyCheck(x,y)\
- \009local time = textutils.formatTime(os.time(),true)\
- \009if xSize > 30 then comp = true end\
- \009if comp == false then\
- \009\009if y==1 then\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009elseif comp == true then\
- \009\009if (x > 9 and x < xSize-#time-1) and y==ySize then\
- \009\009\009return true\
- \009\009else\
- \009\009\009return false\
- \009\009end\
- \009end\
- end\
- \
- function header(text,textColor,backColor)\
- \009paintutils.drawLine(1,1,xSize,1,backColor)\
- \009paintutils.drawLine(1,2,xSize,2,backColor)\
- \009term.setTextColor(textColor)\
- \009usualText(text,1,1)\
- end\
- \
- function switch(y, pos, color)\
- \009if pos == nil then\
- \009\009pos = false\
- \009end\
- \009if color == nil then\
- \009\009color = colors.lightBlue\
- \009end\
- \009paintutils.drawLine(xSize-7,y,xSize-2,y,colors.gray)\
- \009if pos==true or pos==1 then\
- \009\009paintutils.drawLine(xSize-4,y,xSize-2,y,color)\
- \009else\
- \009\009paintutils.drawLine(xSize-7,y,xSize-5,y,colors.lightGray)\
- \009end\
- end\
- \
- function scrollBar(count, size, pos, sizeStep, color2, color1)\
- \009local lenthScroll = 0\
- \009local posScroll = 0\
- \009local lenthPage = 0\
- \009local step = 0\
- \009if color1 == nil then\
- \009\009color1 = colors.white\
- \009end\
- \009if color2 == nil then\
- \009\009color2 = colors.lightGray\
- \009end\
- \009paintutils.drawLine(xSize,3,xSize,ySize-1,color2)\
- \009if count>0 then\
- \009\009if count*size > ySize-3 then\
- \009\009\009lenthPage = count*size\
- \009\009\009lenthScroll = math.floor((ySize-3)/(lenthPage/(ySize-3)))\
- \009\009\009step = ((ySize-4)-lenthScroll)/math.floor((lenthPage-(ySize-4))/sizeStep)\
- \009\009\009\
- \009\009else\
- \009\009\009step = 0\
- \009\009\009lenthScroll = ySize-3\
- \009\009end\
- \009else \
- \009\009lenthScroll = ySize-3\
- \009end\
- \009paintutils.drawLine(xSize,3-pos,xSize,3+lenthScroll-pos,color1)\
- \009return step\
- end\
- \
- function search(path, expand, input)\
- \009if path == nil then path = \"\" end\
- \009local waitFor = true\
- \009local output = nil\
- \009term.setTextColor(colors.black)\
- \009if xSize > 30 then comp = 1 else comp = 0 end\
- \009paintutils.drawLine(3,2-comp,xSize-2,2-comp,colors.white)\
- \009paintutils.drawLine(3,3-comp,xSize-2,3-comp,colors.white)\
- \009paintutils.drawLine(3,4-comp,xSize-2,4-comp,colors.white)\
- \009term.setCursorPos(4,3-comp)\
- \009local keyWord = read()\
- \009if input == false or input == nil then\
- \009\009local result = {}\
- \009\009if keyWord ~= \"\" then\
- \009\009\009result = fs.find(path..keyWord..\"*\")\
- \009\009end\
- \009\009if expand == true then\
- \009\009\009if result ~= nil then\
- \009\009\009\009local i = 1\
- \009\009\009\009while result[i] ~= nil do\
- \009\009\009\009\009if fs.isDir(result[i]) == true then\
- \009\009\009\009\009\009for ii=i,#result-1 do\
- \009\009\009\009\009\009\009result[ii] = result[ii+1]\
- \009\009\009\009\009\009end\
- \009\009\009\009\009\009result[#result] = nil\
- \009\009\009\009\009end\
- \009\009\009\009\009i = i +1\
- \009\009\009\009end\
- \009\009\009\009term.setTextColor(colors.white)\
- \009\009\009\009paintutils.drawLine(3,5-comp,xSize-2,5-comp,colors.lightGray)\
- \009\009\009\009for i=1,#result do\
- \009\009\009\009\009paintutils.drawLine(3,5-comp+i,xSize-2,5-comp+i,colors.lightGray)\
- \009\009\009\009\009usualText(result[i],5,5-comp+i)\
- \009\009\009\009\009paintutils.drawLine(3,6-comp+i,xSize-2,6-comp+i,colors.lightGray)\
- \009\009\009\009end\
- \009\009\009end\
- \009\009\009while waitFor==true and keyWord~=\"\" do\
- \009\009\009\009local event, side, xp, yp = os.pullEvent()\
- \009\009\009\009if event == 'mouse_click' then \
- \009\009\009\009\009for i=1,#result do\
- \009\009\009\009\009\009if xp >= 3 and xp <= xSize-2 and yp==i+5-comp then\
- \009\009\009\009\009\009\009output = result[i]\
- \009\009\009\009\009\009end\
- \009\009\009\009\009end\
- \009\009\009\009\009waitFor = false\
- \009\009\009\009\009comp = false\
- \009\009\009\009\009return output\
- \009\009\009\009end\
- \009\009\009end\
- \009\009else\
- \009\009\009comp = false\
- \009\009\009return result\
- \009\009end\
- \009else\
- \009\009comp = false\
- \009\009return keyWord\
- \009end\
- end",
- path = "//System/API/sysbar",
- },
- {
- text = "local xSize,ySize = term.getSize()\
- local centerX,centerY = math.floor(xSize/2),math.floor(ySize/2)\
- \
- function findPeripheral(whatToFind)\
- local PeriList = peripheral.getNames()\
- for i=1,#PeriList do\
- if peripheral.getType(PeriList[i]) == whatToFind then\
- return PeriList[i]\
- end\
- end\
- end\
- \
- function findWirelessModem()\
- \009local periList = peripheral.getNames()\
- \009for i=1,#periList do\
- \009\009if peripheral.getType(periList[i]) == \"modem\" then\
- \009\009\009local govno = peripheral.wrap(periList[i])\
- \009\009\009if govno.isWireless() then\
- \009\009\009\009return periList[i]\
- \009\009\009end\
- \009\009end\
- \009end\
- end\
- \
- function clickedAtArea(x,y,sx,sy,ex,ey)\
- if (x >= sx) and (x <= ex) and (y >= sy) and (y <= ey) then return true end \
- return false\
- end\
- \
- function toboolean(s)\
- \009if s == \"true\" then\
- \009\009return true\
- \009else\
- \009\009return false\
- \009end\
- end\
- \
- function colorText(x,y,text,textColor)\
- \009term.setTextColor(textColor)\
- \009term.setCursorPos(x,y)\
- \009term.write(text)\
- end\
- \
- function colorTextWithBack(x,y,text,textColor,backColor)\
- \009term.setTextColor(textColor)\
- \009term.setBackgroundColor(backColor)\
- \009term.setCursorPos(x,y)\
- \009term.write(text)\
- end\
- \
- function usualText(x,y,text)\
- \009term.setCursorPos(x,y)\
- \009term.write(text)\
- end\
- \
- function centerText(how,coord,text,textColor,backColor)\
- \009term.setTextColor(textColor)\
- \009term.setBackgroundColor(backColor)\
- \009if how == \"xy\" then\
- \009\009term.setCursorPos(math.floor(xSize/2-#text/2),math.floor(ySize/2))\
- \009elseif how == \"x\" then\
- \009\009term.setCursorPos(math.floor(xSize/2-#text/2),coord)\
- \009elseif how == \"y\" then\
- \009\009term.setCursorPos(coord,math.floor(ySize/2))\
- \009end\
- \009term.write(text)\
- end\
- \
- function square(x1,y1,width,height,color)\
- \009local string = string.rep(\" \",width)\
- \009term.setBackgroundColor(color)\
- \009for y=y1,(y1+height-1) do\
- \009\009usualText(x1,y,string)\
- \009end\
- end\
- \
- function circle(cx, cy, radius, char, backColor, textColor)\
- \009local x = radius\
- local y = 0\
- local radiusError = 1 - x\
- term.setTextColor(textColor)\
- term.setBackgroundColor(backColor)\
- while (x >= y) do\
- usualText(x + cx, y + cy, char)\
- usualText(y + cx, x + cy, char)\
- usualText(-x + cx, y + cy, char)\
- usualText(-y + cx, x + cy, char)\
- usualText(-x + cx, -y + cy, char)\
- usualText(-y + cx, -x + cy, char)\
- usualText(x + cx, -y + cy, char)\
- usualText(y + cx, -x + cy, char)\
- y = y + 1\
- if (radiusError < 0) then\
- radiusError = radiusError + (2 * y + 1)\
- else\
- x = x - 1\
- radiusError = radiusError + (2 * (y - x + 1))\
- end\
- end\
- end\
- \
- function clearScreen(color)\
- \009term.setBackgroundColor(color)\
- \009term.clear()\
- end\
- \
- function fadeIn(time)\
- \009clearScreen(colors.gray)\
- \009sleep(time)\
- \009clearScreen(colors.lightGray)\
- \009sleep(time)\
- \009clearScreen(colors.white)\
- \009sleep(time)\
- end\
- \
- function fadeOut(time)\
- \009clearScreen(colors.lightGray)\
- \009sleep(time)\
- \009clearScreen(colors.gray)\
- \009sleep(time)\
- \009clearScreen(colors.black)\
- \009sleep(time)\
- \009term.setCursorPos(1,1)\
- \009term.setTextColor(colors.white)\
- end\
- \
- function emptyWindow(xStart,yStart,xWindowSize,yWindowSize,title)\
- \009--DRAW WINDOW\
- \009square(xStart+1,yStart,xWindowSize,1,colors.white)\
- \009colorText(math.floor(xStart+xWindowSize/2-#title/2),yStart,title,colors.gray)\
- \
- \009square(xStart+1,yStart+1,xWindowSize,yWindowSize-1,colors.white)\
- end\
- \
- function sampleWindow(xStart,yStart,xWindowSize,yWindowSize)\
- \009square(xStart+1,yStart,xWindowSize,yWindowSize,colors.white)\
- end\
- \
- function stringLimit(mode,text,size,noDots)\
- \009if string.len(text)<=size then return text end\
- \009if mode == \"start\" then\
- \009\009if noDots then\
- \009\009\009return string.sub(text,#text-size+1,-1)\
- \009\009else\
- \009\009\009return \"...\"..string.sub(text,#text-size+4,-1)\
- \009\009end\
- \009else\
- \009\009if noDots then\
- \009\009\009return string.sub(text,1,size)\
- \009\009else\
- \009\009\009return string.sub(text,1,size-3)..\"...\"\
- \009\009end\
- \009end\
- end\
- \
- function getFileFormat(path)\
- \009local name = fs.getName(path)\
- \009local starting,ending = string.find(name,\"(.)%.[%d%w]*$\")\
- \009if starting == nil then\
- \009\009return nil\
- \009else\
- \009\009return string.sub(name,starting+1,-1)\
- \009end\
- end\
- \
- function isFileHidden(path)\
- \009local name = fs.getName(path)\
- \009local starting,ending = string.find(name,\"^%.(.*)$\")\
- \009if starting == nil then\
- \009\009return false\
- \009else\
- \009\009return true\
- \009end\
- end\
- \
- function hideFileFormat(path)\
- \009local name = fs.getName(path)\
- \009local fileFormat = getFileFormat(name)\
- \009if fileFormat == nil then\
- \009\009return name\
- \009else\
- \009\009return string.sub(name,1,#name-#fileFormat)\
- \009end\
- end\
- \
- function getFileSize(path)\
- \009local allFilesSize = 0\
- \009if fs.isDir(path) then\
- \009\009local fileList = fs.list(path)\
- \009\009for i=1,#fileList do\
- \009\009\009allFilesSize = allFilesSize + getFileSize(path..\"/\"..fileList[i])\
- \009\009end\
- \009else\
- \009\009allFilesSize = allFilesSize + fs.getSize(path)\
- \009end\
- \009return allFilesSize\
- end\
- \
- function getFileType(path)\
- \009local fileTypes = {\
- \009\009[\".png\"] = \"Image\",\
- \009\009[\".cfg\"] = \"Config\",\
- \009\009[\".zip\"] = \"Archive\",\
- \009\009[\".app\"] = \"Application\",\
- \009}\
- \
- \009local currentFileType = nil\
- \
- \009local fileFormat = getFileFormat(path)\
- \009if fileFormat == nil then\
- \009\009if fs.isDir(path) then\
- \009\009\009currentFileType = \"Folder\"\
- \009\009else\
- \009\009\009currentFileType = \"Lua script\"\
- \009\009end\
- \009else\
- \009\009currentFileType = fileTypes[fileFormat] or fileFormat\
- \009end\
- \009\
- \009return currentFileType\
- end\
- \
- function reorganizeFilesAndFolders(workPath,massivSudaPihay,showHiddenFiles,showSystemFolders)\
- \009local reorganizedMassiv = {}\
- \009local function doGovno(i)\
- \009\009if showHiddenFiles then\
- \009\009\009reorganizedMassiv[#reorganizedMassiv+1] = massivSudaPihay[i]\
- \009\009else\
- \009\009\009if not windows.isFileHidden(workPath..\"/\"..massivSudaPihay[i]) then\
- \009\009\009\009reorganizedMassiv[#reorganizedMassiv+1] = massivSudaPihay[i]\
- \009\009\009end\
- \009\009end\
- \009end\
- \009local filePath = nil\
- \009for i=1,#massivSudaPihay do\
- \009\009filePath = workPath..\"/\"..massivSudaPihay[i]\
- \009\009if fs.isDir(filePath) and windows.getFileFormat(filePath) ~= \".app\" then\
- \009\009\009if showSystemFolders then\
- \009\009\009\009doGovno(i)\
- \009\009\009else\
- \009\009\009\009if massivSudaPihay[i] ~= \"rom\" and massivSudaPihay[i] ~= \"System\" then\
- \009\009\009\009\009--windows.attention({\"massiv[i] = \"..massivSudaPihay[i]},{\"heh\"})\
- \009\009\009\009\009doGovno(i)\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- \009for i=1,#massivSudaPihay do\
- \009\009filePath = workPath..\"/\"..massivSudaPihay[i]\
- \009\009if not fs.isDir(filePath) and massivSudaPihay[i] ~= \"OS\" or fs.isDir(filePath) and windows.getFileFormat(filePath) == \".app\" then\
- \009\009\009doGovno(i)\
- \009\009end\
- \009end\
- \009return reorganizedMassiv\
- end\
- \
- function drawOSIcon(xIconPos,yIconPos,workPath,name,fileFormat)\
- \009if not fs.isDir(workPath..\"/\"..name) then\
- \009\009if fileFormat == \".png\" then\
- \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/image.png\")\
- \009\009elseif fileFormat == \".cfg\" then\
- \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/config.png\")\
- \009\009elseif fileFormat == \".zip\" then\
- \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/zip.png\")\
- \009\009else\
- \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/default.png\")\
- \009\009end\
- \009else\
- \009\009local iconPath = workPath..\"/\"..name..\"/Resources/icon.png\"\
- \009\009if fileFormat == \".app\" and fs.exists(iconPath) then\
- \009\009\009image.draw(xIconPos,yIconPos,iconPath)\
- \009\009elseif string.sub(name,1,4)==\"disk\" then\
- \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/disk.png\")\
- \009\009else\
- \009\009\009image.draw(xIconPos,yIconPos,\"System/OS/Icons/folder.png\")\
- \009\009end\
- \009end\
- end\
- \
- local function correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
- \009if xStart == \"auto\" then\
- \009\009xStart = math.floor(xSize/2 - xWindowSize/2)\
- xStart = xStart+1\
- \009end\
- \009if yStart == \"auto\" then\
- \009\009yStart = math.floor(ySize/2 - yWindowSize/2)\
- \009end\
- \009return xStart,yStart\
- end\
- \
- function button(x,y,xOffset,yOffset,text,textColor,backColor)\
- \009local width = xOffset*2+#text\
- \009local height = yOffset*2+1\
- \009x,y = correctStartCoords(x,y,width,height)\
- \009square(x,y,width,height,backColor)\
- \009colorText(x+xOffset,y+yOffset,text,textColor)\
- \009return x,y,x+width-1,y+height-1\
- end\
- \
- local function drawProgressBar(xStart,yStart,width,height,frontColor,backColor,percent)\
- \009local doneSize = math.ceil(percent/100*width)\
- \
- \009square(xStart,yStart,width,height,backColor)\
- \009square(xStart,yStart,doneSize,height,frontColor)\
- end\
- \
- function scrollBar(xStart,yStart,height,countOfAllElements,currentElement,backColor,frontColor)\
- \009local percent = 1/countOfAllElements\
- \009local sizeOfScrollBar = math.ceil(percent * height)\
- \009local displayBarFrom = math.floor(yStart + height*((currentElement-1)/countOfAllElements))\
- \
- \009for i=yStart,(yStart+height-1) do\
- \009\009paintutils.drawPixel(xStart,i,backColor)\
- \009end\
- \
- \009for i=displayBarFrom,(displayBarFrom+sizeOfScrollBar-1) do\
- \009\009paintutils.drawPixel(xStart,i,frontColor)\
- \009end\
- end\
- \
- function searchInAllFiles(path,whatToFind)\
- \
- \009local function poiskSovpadeniya(name)\
- \009\009local starting,ending = string.find(string.lower(name),string.lower(whatToFind))\
- \009\009if starting == nil then\
- \009\009\009return false\
- \009\009else\
- \009\009\009return true\
- \009\009end\
- \009end\
- \
- \009local searchMassiv = {}\
- \
- \009local function createFileMassiv(path,whatToFind)\
- \009\009local fileList = fs.list(path)\
- \009\009for i=1,#fileList do\
- \009\009\009if fs.isDir(path..\"/\"..fileList[i]) then\
- \009\009\009\009if poiskSovpadeniya(fileList[i]) then\
- \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])}\
- \009\009\009\009end\
- \009\009\009\009createFileMassiv(path..\"/\"..fileList[i],whatToFind)\
- \009\009\009else\
- \009\009\009\009if poiskSovpadeniya(fileList[i]) then\
- \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])}\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- \009createFileMassiv(path,whatToFind)\
- \009return searchMassiv\
- \
- end\
- \
- local colorCodes = {\
- \009{[\"code\"] = \"&0\", [\"color\"] = 1},\
- \009{[\"code\"] = \"&1\", [\"color\"] = 2},\
- \009{[\"code\"] = \"&2\", [\"color\"] = 4},\
- \009{[\"code\"] = \"&3\", [\"color\"] = 8},\
- \009{[\"code\"] = \"&4\", [\"color\"] = 16},\
- \009{[\"code\"] = \"&5\", [\"color\"] = 32},\
- \009{[\"code\"] = \"&6\", [\"color\"] = 64},\
- \009{[\"code\"] = \"&7\", [\"color\"] = 128},\
- \009{[\"code\"] = \"&8\", [\"color\"] = 256},\
- \009{[\"code\"] = \"&9\", [\"color\"] = 512},\
- \009{[\"code\"] = \"&a\", [\"color\"] = 1024},\
- \009{[\"code\"] = \"&b\", [\"color\"] = 2048},\
- \009{[\"code\"] = \"&c\", [\"color\"] = 4096},\
- \009{[\"code\"] = \"&d\", [\"color\"] = 8192},\
- \009{[\"code\"] = \"&e\", [\"color\"] = 16384},\
- \009{[\"code\"] = \"&f\", [\"color\"] = 32768},\
- }\
- \
- function foramattedText(text)\
- \009local color = colors.white\
- \009term.setTextColor(color)\
- \009local sText = #text\
- \009local searchFrom = 1\
- \
- \009local exit = false\
- \009while true do\
- \009\009if exit then break end\
- \009\009local founded = false\
- \009\009local s,e = string.find(text,\"&\",searchFrom)\
- \009\009if s then\
- \009\009\009local code = string.sub(text,s,s+1)\
- \009\009\009for i=1,16 do\
- \009\009\009\009if code == colorCodes[i][\"code\"] then\
- \
- \009\009\009\009\009local cyka = string.sub(text,searchFrom,s-1)\
- \009\009\009\009\009term.write(cyka)\
- \
- \009\009\009\009\009color = colorCodes[i][\"color\"]\
- \009\009\009\009\009term.setTextColor(color)\
- \
- \009\009\009\009\009founded = true\
- \009\009\009\009\009searchFrom = searchFrom + #cyka + 2\
- \009\009\009\009\009break\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009\009\
- \009\009if not founded then\
- \009\009\009term.write(string.sub(text,searchFrom,-1))\
- \009\009\009exit = true\
- \009\009end\
- \009end\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------\
- \
- function error(text1)\
- \009\
- \009local title = \"Error\"\
- \009local limit = xSize - 11\
- \009local sizeOfText1 = #text1\
- \
- \009local parsedErr = {}\
- \009for i=1,(math.ceil(sizeOfText1/limit)) do\
- \009\009parsedErr[#parsedErr+1] = string.sub(text1,i*limit+1-limit,i*limit)\
- \009end\
- \
- \009local theLongestElement = #title\
- \009for i=1,#parsedErr do\
- \009\009local size = #parsedErr[i]\
- \009\009if size > theLongestElement then theLongestElement = size end\
- \009end\
- \009\
- \009local xWindowSize = 9 + theLongestElement + 2\
- \009local yWindowSize = 2 + 1 + 1 + #parsedErr + 3\
- \009local xStart = math.floor(xSize/2-xWindowSize/2)\
- \009local yStart = math.floor(ySize/2-yWindowSize/2)\
- \009\
- \009emptyWindow(0,yStart,xSize,yWindowSize,\" \")\
- \
- \009--DRAW ICON\
- \009paintutils.drawPixel(xStart+4,yStart+2,colors.red)\
- \009paintutils.drawPixel(xStart+3,yStart+3,colors.red)\
- \009paintutils.drawPixel(xStart+4,yStart+3,colors.red)\
- \009paintutils.drawPixel(xStart+5,yStart+3,colors.red)\
- \009paintutils.drawPixel(xStart+2,yStart+4,colors.red)\
- \009paintutils.drawPixel(xStart+3,yStart+4,colors.red)\
- \009paintutils.drawPixel(xStart+4,yStart+4,colors.red)\
- \009paintutils.drawPixel(xStart+5,yStart+4,colors.red)\
- \009\
- \009paintutils.drawPixel(xStart+6,yStart+4,colors.red)\
- \009colorText(xStart+4,yStart+3,\"!\",colors.white)\
- \009\
- \009--ERROR TEXT\
- \009term.setBackgroundColor(colors.white)\
- \
- \009colorText(xStart+9,yStart+2,title,colors.gray)\
- \
- \009for i=1,#parsedErr do\
- \009\009colorText(xStart+9,yStart+3+i,parsedErr[i],colors.lightGray)\
- \009end\
- \
- \009--BUTTON\
- \009local function drawButton(color,color2)\
- \009\009for x=(xStart+xWindowSize-8),(xStart+xWindowSize-3) do\
- \009\009\009paintutils.drawPixel(x,yStart+yWindowSize-2,color)\
- \009\009end\
- \009\009colorText(xStart+xWindowSize-6,yStart+yWindowSize-2,\"OK\",color2)\
- \009end\
- \009drawButton(colors.lightBlue,colors.black)\
- \009\
- \009while true do\
- \009\009local event,side,x,y = os.pullEvent()\
- \009\009if event == \"mouse_click\" then\
- \009\009\009if x>=xStart+xWindowSize-8 and x<=xStart+xWindowSize-3 and y == yStart+yWindowSize-2 then\
- \009\009\009\009drawButton(colors.blue,colors.white)\
- \009\009\009\009sleep(0.2)\
- \009\009\009\009break\
- \009\009\009end\
- \009\009elseif event == \"key\" then\
- \009\009\009if side == 28 then\
- \009\009\009\009drawButton(colors.blue,colors.white)\
- \009\009\009\009sleep(0.2)\
- \009\009\009\009break\
- \009\009\009end\
- \009\009end\
- \009end\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------\
- \
- function attention(text1,text2)\
- \
- \009local sizeOfText1 = #text1\
- \009local sizeOfText2 = #text2\
- \
- \009local theLongestElement = 0\
- \009for i=1,sizeOfText1 do\
- \009\009if #text1[i] > theLongestElement then theLongestElement = #text1[i] end\
- \009end\
- \009for i=1,sizeOfText2 do\
- \009\009if #text2[i] > theLongestElement then theLongestElement = #text2[i] end\
- \009end\
- \
- \009local xWindowSize = 9 + theLongestElement + 2\
- \009local yWindowSize = 2 + sizeOfText1 + 1 + sizeOfText2 + 3\
- \009local xStart = math.floor(xSize/2-xWindowSize/2)\
- \009local yStart = math.floor(ySize/2-yWindowSize/2)\
- \009\
- \009emptyWindow(0,yStart,xSize,yWindowSize,\" \")\
- \
- \009--DRAW ICON\
- \009paintutils.drawPixel(xStart+4,yStart+2,colors.yellow)\
- \009paintutils.drawPixel(xStart+3,yStart+3,colors.yellow)\
- \009paintutils.drawPixel(xStart+4,yStart+3,colors.yellow)\
- \009paintutils.drawPixel(xStart+5,yStart+3,colors.yellow)\
- \009paintutils.drawPixel(xStart+2,yStart+4,colors.yellow)\
- \009paintutils.drawPixel(xStart+3,yStart+4,colors.yellow)\
- \009paintutils.drawPixel(xStart+4,yStart+4,colors.yellow)\
- \009paintutils.drawPixel(xStart+5,yStart+4,colors.yellow)\
- \009paintutils.drawPixel(xStart+6,yStart+4,colors.yellow)\
- \009colorText(xStart+4,yStart+3,\"!\",colors.white)\
- \009\
- \009--ERROR TEXT\
- \009term.setBackgroundColor(colors.white)\
- \009for i=1,sizeOfText1 do\
- \009\009colorText(xStart+9,yStart+1+i,text1[i],colors.gray)\
- \009end\
- \009for i=1,sizeOfText2 do\
- \009\009colorText(xStart+9,yStart+3+i,text2[i],colors.lightGray)\
- \009end\
- \
- \009--BUTTON\
- \009local function drawButton(color,color2)\
- \009\009for x=(xStart+xWindowSize-8),(xStart+xWindowSize-3) do\
- \009\009\009paintutils.drawPixel(x,yStart+yWindowSize-2,color)\
- \009\009end\
- \009\009colorText(xStart+xWindowSize-6,yStart+yWindowSize-2,\"OK\",color2)\
- \009end\
- \009drawButton(colors.lightBlue,colors.black)\
- \009\
- \009while true do\
- \009\009local event,side,x,y = os.pullEvent()\
- \009\009if event == \"mouse_click\" then\
- \009\009\009if x>=xStart+xWindowSize-8 and x<=xStart+xWindowSize-3 and y == yStart+yWindowSize-2 then\
- \009\009\009\009drawButton(colors.blue,colors.white)\
- \009\009\009\009sleep(0.2)\
- \009\009\009\009break\
- \009\009\009end\
- \009\009elseif event == \"key\" then\
- \009\009\009if side == 28 then\
- \009\009\009\009drawButton(colors.blue,colors.white)\
- \009\009\009\009sleep(0.2)\
- \009\009\009\009break\
- \009\009\009end\
- \009\009end\
- \009end\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------\
- \
- function input(...)\
- \009\
- \009local xStart = arg[1]\
- \009local yStart = arg[2]\
- \009local title = arg[3]\
- \009local sizeOfInputRow = arg[4]\
- \
- \009local sizeOfText1 = #arg-4\
- \
- \009local Inputs = {}\
- \
- \009local allowToPressOk = true\
- \
- \009local inputCounter = 1\
- \
- \009local theLongestElement = 0\
- \009for i=1,sizeOfText1 do\
- \009\009if #arg[i+4][1] > theLongestElement then theLongestElement = #arg[i+4][1] end\
- \009end\
- \
- \009local xWindowSize = 2 + theLongestElement + 1 + sizeOfInputRow + 2\
- \009local yWindowSize = 2 + sizeOfText1 * 2 + 1 + 1\
- \
- \009xStart, yStart = correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
- \
- \009for i=1,sizeOfText1 do\
- \009\009Inputs[i]=arg[i+4][2]\
- \009end\
- \
- \009local Objects = {}\
- \009local function newObj(class,name,x1,y1,width,height)\
- \009\009Objects[class] = Objects[class] or {}\
- \009\009Objects[class][name] = {}\
- \009\009Objects[class][name][\"x1\"]=x1\
- \009\009Objects[class][name][\"y1\"]=y1\
- \009\009Objects[class][name][\"x2\"]=x1+width-1\
- \009\009Objects[class][name][\"y2\"]=y1+height-1\
- \009end\
- \
- \009emptyWindow(0,yStart,xSize,yWindowSize,title)\
- \
- \009--BUTTON\
- \009local function drawButton(color,color2)\
- \009\009for x=(xStart+xWindowSize-8),(xStart+xWindowSize-3) do\
- \009\009\009paintutils.drawPixel(x,yStart+yWindowSize-2,color)\
- \009\009end\
- \009\009colorText(xStart+xWindowSize-6,yStart+yWindowSize-2,\"OK\",color2)\
- \009end\
- \009\
- \009local function drawInputs()\
- \009\009for i=1,sizeOfText1 do\
- \009\009\009local xPosOfInput = xStart+xWindowSize - 2 - sizeOfInputRow\
- \009\009\009local yPosOfInput = yStart+i*2\
- \
- \009\009\009local inputArgument = arg[i+4]\
- \
- \009\009\009term.setBackgroundColor(colors.white)\
- \009\009\009if inputCounter == i then\
- \009\009\009\009colorText(xStart+2,yPosOfInput,inputArgument[1],colors.gray)\
- \009\009\009else\
- \009\009\009\009colorText(xStart+2,yPosOfInput,inputArgument[1],colors.lightGray)\
- \009\009\009end\
- \
- \009\009\009square(xPosOfInput,yPosOfInput,sizeOfInputRow,1,colors.lightGray)\
- \009\009\009newObj(\"inputs\",i,xPosOfInput,yPosOfInput,sizeOfInputRow,1)\
- \
- \009\009\009if Inputs[i] ~= nil then\
- \009\009\009\009if inputArgument[3] == nil then\
- \009\009\009\009\009colorText(xPosOfInput,yPosOfInput,stringLimit(\"start\",Inputs[i],sizeOfInputRow),colors.black)\
- \009\009\009\009else\
- \009\009\009\009\009colorText(xPosOfInput,yPosOfInput,stringLimit(\"start\",string.rep(\"*\",#Inputs[i]),sizeOfInputRow),colors.black)\
- \009\009\009\009end\
- \009\009\009end\
- \009\009\009\
- \009\009\009if inputCounter > sizeOfText1 then allowToPressOk = true end\
- \009\009end\
- \
- \009\009if allowToPressOk then\
- \009\009\009drawButton(colors.lightBlue,colors.black)\
- \009\009else\
- \009\009\009drawButton(colors.lightGray,colors.black)\
- \009\009end\
- \009end\
- \
- \009drawInputs()\
- \009\
- \009local currentInput = \"\"\
- \
- \009while true do\
- \009\009if Inputs[inputCounter] ~= nil then currentInput = Inputs[inputCounter] end\
- \
- \009\009term.setCursorBlink(false)\
- \009\009drawInputs(inputCounter)\
- \009\009term.setCursorBlink(true)\
- \
- \009\009if #currentInput < sizeOfInputRow and inputCounter <= sizeOfText1 then\
- \009\009\009term.setCursorPos(xStart+xWindowSize-2-sizeOfInputRow+#currentInput,yStart+inputCounter*2)\
- \009\009elseif #currentInput >= sizeOfInputRow and inputCounter <= sizeOfText1 then\
- \009\009\009term.setCursorPos(xStart+xWindowSize-3,yStart+inputCounter*2)\
- \009\009else\
- \009\009\009term.setCursorBlink(false)\
- \009\009end\
- \
- \009\009local event,side,x,y = os.pullEvent()\
- \009\009if event == \"key\" then\
- \009\009\009if side == 28 then\
- \009\009\009\009if currentInput ~= \"\" then\
- \009\009\009\009\009currentInput = \"\"\
- \009\009\009\009else\
- \009\009\009\009\009Inputs[inputCounter] = currentInput\009\
- \009\009\009\009end\
- \
- \009\009\009\009if inputCounter < sizeOfText1 then\
- \009\009\009\009\009inputCounter = inputCounter + 1\
- \009\009\009\009else\
- \009\009\009\009\009term.setCursorBlink(false)\
- \009\009\009\009\009drawButton(colors.blue,colors.white)\
- \009\009\009\009\009sleep(0.2)\
- \009\009\009\009\009return Inputs\
- \009\009\009\009end\
- \009\009\009elseif side == 14 then\
- \009\009\009\009currentInput = string.sub(currentInput,1,-2)\
- \009\009\009\009Inputs[inputCounter] = currentInput\
- \009\009\009elseif side == 200 then\
- \009\009\009\009inputCounter = inputCounter - 1\
- \009\009\009\009if inputCounter < 1 then inputCounter = 1 end\
- \009\009\009elseif side == 208 then\
- \009\009\009\009inputCounter = inputCounter + 1\
- \009\009\009\009if inputCounter > #Inputs then inputCounter = #Inputs end\
- \009\009\009end\
- \009\009elseif event == \"mouse_click\" then\
- \009\009\009term.setCursorBlink(false)\
- \009\009\009if x>=xStart+xWindowSize-8 and x<=xStart+xWindowSize-3 and y == yStart+yWindowSize-2 and allowToPressOk == true then\
- \009\009\009\009drawButton(colors.blue,colors.white)\
- \009\009\009\009sleep(0.2)\
- \009\009\009\009return Inputs\
- \009\009\009end\
- \009\009\009for key,val in pairs(Objects[\"inputs\"]) do\
- \009\009\009\009if x>=Objects[\"inputs\"][key][\"x1\"] and x<=Objects[\"inputs\"][key][\"x2\"] and y==Objects[\"inputs\"][key][\"y1\"] then\
- \009\009\009\009\009inputCounter = key\
- \009\009\009\009\009break\
- \009\009\009\009end\
- \009\009\009end\
- \009\009elseif event == \"char\" then\
- \009\009\009currentInput = currentInput..side\
- \009\009\009Inputs[inputCounter] = currentInput\
- \009\009elseif event == \"paste\" then\
- \009\009\009currentInput = currentInput..side\
- \009\009\009Inputs[inputCounter] = currentInput\
- \009\009end\
- \009end\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------------\
- \
- function tv(speed)\
- \009term.setBackgroundColor(colors.black)\
- \009for i=1,centerY do\
- \009\009term.setCursorPos(1,i)\
- \009\009term.clearLine()\
- \009\009term.setCursorPos(1,ySize-i+1)\
- \009\009term.clearLine()\
- \009\009sleep(speed)\
- \009end\
- \009for i=1,centerX do\
- \009\009paintutils.drawPixel(i,centerY+1,colors.black)\
- \009\009paintutils.drawPixel(xSize-i+1,centerY+1,colors.black)\
- \009\009sleep(speed)\
- \009end\
- \009sleep(0.2)\
- \009clearScreen(colors.black)\
- \009term.setTextColor(colors.white)\
- \009term.setCursorPos(1,1)\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------------\
- \
- function select(...)\
- \
- \009local Objects = {}\
- \009local function newObj(class,name,x1,y1,width,height)\
- \009\009--if not Objects[class] then Objects[class] = {} end\
- \009\009Objects[class] = Objects[class] or {}\
- \009\009Objects[class][name] = {}\
- \009\009Objects[class][name][\"x1\"]=x1\
- \009\009Objects[class][name][\"y1\"]=y1\
- \009\009Objects[class][name][\"x2\"]=x1+width-1\
- \009\009Objects[class][name][\"y2\"]=y1+height-1\
- \009end\
- \
- \009local function drawButton(x,y,name,textColor,backColor)\
- \009\009local sizeOfButton = 2+#name+2\
- \009\009square(x,y,sizeOfButton,1,backColor)\
- \009\009colorText(x+2,y,name,textColor)\
- \009\009newObj(\"buttons\",name,x,y,sizeOfButton,1)\
- \009end\
- \
- \009local text1 = arg[1]\
- \009local text2 = arg[2]\
- \
- \009local sizeOfText1 = #text1\
- \009local sizeOfText2 = #text2\
- \009local hereIsOnlyOneElement = false\
- \009if sizeOfText1 == 0 then hereIsOnlyOneElement = true end\
- \
- \009local theLongestElement = 0\
- \009for i=1,sizeOfText1 do\
- \009\009if #text1[i] > theLongestElement then theLongestElement = #text1[i] end\
- \009end\
- \009for i=1,sizeOfText2 do\
- \009\009if #text2[i] > theLongestElement then theLongestElement = #text2[i] end\
- \009end\
- \
- \009local countOfButtons = #arg-2\
- \009local sizeOfAllButtons = 0\
- \009for i=1,countOfButtons do\
- \009\009sizeOfAllButtons = sizeOfAllButtons + 2+#arg[2+i][1]+2 + 1\
- \009end\
- \009sizeOfAllButtons = sizeOfAllButtons - 1\
- \009if sizeOfAllButtons>theLongestElement then theLongestElement=sizeOfAllButtons end\
- \
- \009local xWindowSize = 2 + theLongestElement + 2\
- \009local yWindowSize = nil\
- \009if hereIsOnlyOneElement then\
- \009\009yWindowSize = 2 + sizeOfText2 + 3\
- \009else\
- \009\009yWindowSize = 2 + sizeOfText1 + 1 + sizeOfText2 + 3\
- \009end\
- \
- \009local xStart = math.floor(xSize/2-xWindowSize/2)\
- \009local yStart = math.floor(ySize/2-yWindowSize/2)\
- \009\
- \009sampleWindow(0,yStart,xSize,yWindowSize,\" \")\
- \
- \009--TEXTS\
- \009term.setBackgroundColor(colors.white)\
- \009for i=1,sizeOfText1 do\
- \009\009colorText(xStart+3,yStart+1+i,text1[i],colors.gray)\
- \009end\
- \009for i=1,sizeOfText2 do\
- \009\009if hereIsOnlyOneElement then\
- \009\009\009colorText(xStart+3,yStart+1+sizeOfText1+i,text2[i],colors.lightGray)\
- \009\009else\
- \009\009\009colorText(xStart+3,yStart+2+sizeOfText1+i,text2[i],colors.lightGray)\
- \009\009end\
- \009end\
- \
- \009local xStartForButtons = xStart+xWindowSize-1 - sizeOfAllButtons - 1\
- \009local yStartForButtons = yStart+yWindowSize-2\
- \009for i=1,countOfButtons do\
- \009\009local text = arg[2+i][1]\
- \009\009local textColor = tonumber(arg[2+i][3])\
- \009\009local backColor = tonumber(arg[2+i][2])\
- \
- \009\009drawButton(xStartForButtons+1,yStartForButtons,text,textColor,backColor)\
- \009\009xStartForButtons = xStartForButtons + 2+#arg[2+i][1]+2+1\
- \009end\
- \
- \009while true do\
- \009\009local event,side,x,y = os.pullEvent()\
- \009\009if event == \"mouse_click\" then\
- \009\009\009for key,val in pairs(Objects[\"buttons\"]) do\
- \009\009\009\009if x>=Objects[\"buttons\"][key][\"x1\"] and x<=Objects[\"buttons\"][key][\"x2\"] and y==Objects[\"buttons\"][key][\"y1\"] then\
- \009\009\009\009\009drawButton(Objects[\"buttons\"][key][\"x1\"],Objects[\"buttons\"][key][\"y1\"],key,colors.white,colors.blue)\
- \009\009\009\009\009sleep(0.2)\
- \009\009\009\009\009return key\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------------\
- \
- function aboutFile(x,y,xWindowSize,path)\
- \009os.loadAPI(\"System/API/image\")\
- \
- \009local name = fs.getName(path)\
- \009local limitOfText = xWindowSize - 2\
- \009local yWindowSize = 16\
- \
- \009local Objects = {}\
- \009local function newObj(class,name,x1,y1,width,height)\
- \009\009Objects[class] = Objects[class] or {}\
- \009\009Objects[class][name] = {}\
- \009\009Objects[class][name][\"x1\"]=x1\
- \009\009Objects[class][name][\"y1\"]=y1\
- \009\009Objects[class][name][\"x2\"]=x1+width-1\
- \009\009Objects[class][name][\"y2\"]=y1+height-1\
- \009end\
- \
- \009local function drawButton(x,y,name,textColor,backColor)\
- \009\009local sizeOfButton = 2+#name+2\
- \009\009square(x,y,sizeOfButton,1,backColor)\
- \009\009colorText(x+2,y,name,textColor)\
- \009\009newObj(\"buttons\",name,x,y,sizeOfButton,1)\
- \009end\
- \
- \
- \009local info = {}\
- \
- \009info[\"fileFormat\"] = getFileFormat(path)\
- \
- \009info[\"fileType\"] = getFileType(path)\
- \
- \009info[\"fileSize\"] = math.ceil(getFileSize(path)/1024)..\"KB\"\
- \
- \009info[\"readOnly\"] = tostring(fs.isReadOnly(path))\
- \009\
- \009if y+yWindowSize - 1 >= ySize then y = y - (y+yWindowSize - 1 - ySize) - 1 end\
- \009if x+xWindowSize - 1 >= xSize then x = x - (x+xWindowSize - 1 - xSize) - 1 end\
- \
- \009emptyWindow(x,y,xWindowSize,yWindowSize,\"Properties\")\
- \
- \009drawOSIcon(x+1,y+2,path,name,info[\"fileFormat\"])\
- \
- \009square(x,y+7,xWindowSize,1,colors.lightGray)\
- \009colorText(x+1,y+7,\"Info\",colors.white)\
- \
- \009term.setBackgroundColor(colors.white)\
- \009colorText(x+8,y+3,stringLimit(\"start\",name,xWindowSize-9),colors.gray)\
- \009colorText(x+8,y+4,info[\"fileSize\"],colors.lightGray)\
- \
- \009local textStart = y+9\
- \009colorText(x+1,textStart,\"Type:\",colors.gray)\
- \009usualText(x+1,textStart+1,\"Size:\",colors.gray)\
- \009usualText(x+1,textStart+2,\"Path:\",colors.gray)\
- \009usualText(x+1,textStart+3,\"Read only:\",colors.gray)\
- \
- \009colorText(x+7,textStart,info[\"fileType\"],colors.lightGray)\
- \009usualText(x+7,textStart+1,info[\"fileSize\"])\
- \009usualText(x+7,textStart+2,stringLimit(\"start\",path,xWindowSize-8))\
- \009usualText(x+12,textStart+3,info[\"readOnly\"])\
- \
- \009drawButton(x+xWindowSize-11,y+yWindowSize-2,\"Close\",colors.black,colors.lightBlue)\
- \
- \009while true do\
- \009\009local event,side,x,y = os.pullEvent()\
- \009\009if event == \"mouse_click\" then\
- \009\009\009for key,val in pairs(Objects[\"buttons\"]) do\
- \009\009\009\009if x>=Objects[\"buttons\"][key][\"x1\"] and x<=Objects[\"buttons\"][key][\"x2\"] and y==Objects[\"buttons\"][key][\"y1\"] then\
- \009\009\009\009\009drawButton(Objects[\"buttons\"][key][\"x1\"],Objects[\"buttons\"][key][\"y1\"],key,colors.white,colors.blue)\
- \009\009\009\009\009sleep(0.2)\
- \009\009\009\009\009return key\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------------\
- \
- function progressBar(xStart,yStart,xWindowSize,title,text,speed)\
- \009if xWindowSize < 4+#text then\
- \009\009xWindowSize = 4+#text\
- \009end\
- \
- \009local yWindowSize = 6\
- \009local sizeOfProgressBar = xWindowSize - 4\
- \
- \009xStart,yStart = correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
- \
- \009emptyWindow(xStart,yStart,xWindowSize,yWindowSize,title)\
- \
- \009term.setBackgroundColor(colors.white)\
- \009colorText(math.floor(xStart+(xWindowSize/2-#text/2)),yStart+2,text,colors.gray)\
- \
- \009local xProgressBarPos = xStart+2\
- \009local yProgressBarPos = yStart+4\
- \009drawProgressBar(xProgressBarPos,yProgressBarPos,sizeOfProgressBar,1,colors.lightBlue,colors.lightGray,0)\
- \009sleep(0)\
- \009for i=1,100,speed do\
- \009\009drawProgressBar(xProgressBarPos,yProgressBarPos,sizeOfProgressBar,1,colors.lightBlue,colors.lightGray,i)\
- \009\009sleep(0)\
- \009end\
- \009drawProgressBar(xProgressBarPos,yProgressBarPos,sizeOfProgressBar,1,colors.lightBlue,colors.lightGray,100)\
- end\
- \
- ---------------------------------------------------------------------------------------------------------------------\
- \
- function search(xStart,yStart,xWindowSize,limitOfElements,searchText)\
- \
- \009os.loadAPI(\"System/API/image\")\
- \
- \009local searchList = {}\
- \
- \009local sizeOfOneElement = 5\
- \009local yWindowSize = 4 + sizeOfOneElement*limitOfElements\
- \009local sizeOfSearchBar = xWindowSize - #searchText - 3\
- \009local xStartOfSearchBar = xStart + 2 + #searchText\
- \009local yStartOfSearchBar = yStart + 1\
- \009local limitOfAllText = xWindowSize - 10\
- \009local xWindowEnd = xStart + xWindowSize - 1\
- \009local yWindowEnd = yStart + yWindowSize - 1\
- \
- \009local fromElement = 1\
- \009local searchInput = \"\"\
- \
- \009local Objects = {}\
- \009local function newObj(class,name,x1,y1,width,height,fileType,fileSize,path,fileName,fileFormat)\
- \009\009Objects[class] = Objects[class] or {}\
- \009\009Objects[class][name] = {}\
- \009\009Objects[class][name][\"x1\"]=x1\
- \009\009Objects[class][name][\"y1\"]=y1\
- \009\009Objects[class][name][\"x2\"]=x1+width-1\
- \009\009Objects[class][name][\"y2\"]=y1+height-1\
- \009\009Objects[class][name][\"fileType\"]=fileType\
- \009\009Objects[class][name][\"fileSize\"]=fileSize\
- \009\009Objects[class][name][\"path\"]=path\
- \009\009Objects[class][name][\"fileName\"]=fileName\
- \009\009Objects[class][name][\"fileFormat\"]=fileFormat\
- \009end\
- \
- \009local function drawConcretnoIcon(xStart,yStart,path,name,fileType,fileSize,backColor,fileFormat)\
- \009\009drawOSIcon(xStart,yStart,path,name,fileFormat)\
- \009\009term.setBackgroundColor(backColor)\
- \009\009colorText(xStart+8,yStart,stringLimit(\"end\",name,limitOfAllText),colors.gray)\
- \009\009colorText(xStart+8,yStart+1,stringLimit(\"start\",path,limitOfAllText),colors.lightGray)\
- \009\009colorText(xStart+8,yStart+2,stringLimit(\"start\",\"Type: \"..fileType,limitOfAllText),colors.lightGray)\
- \009\009colorText(xStart+8,yStart+3,stringLimit(\"start\",\"Size: \"..math.ceil(fileSize/1024)..\"KB\",limitOfAllText),colors.lightGray)\
- \
- \009\009newObj(\"icon\",path..\"/\"..name,xStart,yStart,xWindowSize,4,fileType,fileSize,path,name,fileFormat)\
- \009end\
- \
- \009local function drawSearches(fromElement)\
- \009\009Objects = {}\
- \009\009newObj(\"icon\",\"cykaBlyad\",-5,-5,1,1,\"hehe\",5)\009\009\
- \
- \009\009square(xStart,yStart+3,xWindowSize-1,yWindowSize-3,colors.white)\
- \
- \009\009if #searchList == 0 then\
- \009\009\009colorText(xStart+1,yStart+4,\"No mathes found.\",colors.lightGray)\
- \009\009else\
- \009\009\009local iconCounter = 1\
- \009\009\009for i=fromElement,#searchList do\
- \009\009\009\009local yIconPos = yStart+4 + iconCounter*sizeOfOneElement - sizeOfOneElement\
- \009\009\009\009\
- \009\009\009\009drawConcretnoIcon(xStart+1,yIconPos,searchList[i][\"path\"],searchList[i][\"name\"],searchList[i][\"fileType\"],searchList[i][\"fileSize\"],colors.white,searchList[i][\"fileFormat\"])\
- \
- \009\009\009\009iconCounter = iconCounter + 1\
- \009\009\009\009if iconCounter > limitOfElements then break end\
- \009\009\009end\
- \009\009end\
- \
- \009\009scrollBar(xWindowEnd,yStart+3,yWindowSize-3,#searchList,fromElement,colors.lightGray,colors.lightBlue)\
- \009end\
- \
- \009local function textOnSearchBar()\
- \009\009term.setBackgroundColor(colors.white)\
- \009\009usualText(xStartOfSearchBar,yStartOfSearchBar,string.rep(\" \",sizeOfSearchBar))\
- \009\009colorText(xStartOfSearchBar,yStartOfSearchBar,stringLimit(\"start\",searchInput,sizeOfSearchBar),colors.black)\
- \009end\
- \
- \009sampleWindow(xStart,yStart,xWindowSize,yWindowSize)\
- \009square(xStart,yStart,xWindowSize,3,colors.blue)\
- \009colorText(xStart+1,yStart+1,searchText,colors.white)\
- \009square(xStartOfSearchBar,yStartOfSearchBar,sizeOfSearchBar,1,colors.white)\
- \
- \009drawSearches(fromElement)\
- \
- \009while true do\
- \009\009textOnSearchBar(searchInput)\
- \009\009if #searchInput > sizeOfSearchBar then\
- \009\009\009term.setCursorPos(xStartOfSearchBar+sizeOfSearchBar-1,yStartOfSearchBar)\
- \009\009else\
- \009\009\009term.setCursorPos(xStartOfSearchBar+#searchInput,yStartOfSearchBar)\
- \009\009end\
- \
- \009\009term.setCursorBlink(true)\
- \
- \009\009local event,side,x,y = os.pullEvent()\
- \009\009if event == \"mouse_scroll\" then\
- \009\009\009term.setCursorBlink(false)\
- \009\009\009if side == 1 then\
- \009\009\009\009fromElement = fromElement + 1\
- \009\009\009\009if fromElement > #searchList then\
- \009\009\009\009\009fromElement = #searchList\
- \009\009\009\009else\
- \009\009\009\009\009drawSearches(fromElement)\
- \009\009\009\009end\
- \009\009\009else\
- \009\009\009\009fromElement = fromElement - 1\
- \009\009\009\009if fromElement < 1 then\
- \009\009\009\009\009fromElement = 1\
- \009\009\009\009else\
- \009\009\009\009\009drawSearches(fromElement)\
- \009\009\009\009end\
- \009\009\009end\
- \009\009elseif event == \"mouse_click\" then\
- \009\009\009for key,val in pairs(Objects[\"icon\"]) do\
- \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\
- \009\009\009\009\009square(Objects[\"icon\"][key][\"x1\"]-1,Objects[\"icon\"][key][\"y1\"],xWindowSize-1,4,colors.blue)\
- \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\"])\
- \009\009\009\009\009sleep(0.3)\
- \009\009\009\009\009term.setCursorBlink(false)\
- \009\009\009\009\009return string.sub(key,2,-1)\
- \009\009\009\009end\
- \009\009\009end\
- \009\009\009term.setCursorBlink(false)\
- \009\009\009return nil\
- \
- \009\009elseif event == \"char\" then\
- \009\009\009fromElement = 1\
- \009\009\009searchInput = searchInput..side\
- \009\009\009searchList = searchInAllFiles(\"/\",searchInput)\
- \009\009\009drawSearches(fromElement)\
- \009\009elseif event == \"key\" then\
- \009\009\009if side == 14 then\
- \009\009\009\009fromElement = 1\
- \009\009\009\009searchInput = string.sub(searchInput,1,-2)\
- \009\009\009\009searchList = searchInAllFiles(\"/\",searchInput)\
- \009\009\009\009drawSearches(fromElement)\
- \009\009\009end\
- \009\009end\
- \009end\
- end\
- \
- --print(\"You selected: \"..search(2,2,28,2,\"Search\"))\
- \
- \
- ---------------------------------------------------------------------------------------------------------------------\
- \
- function info(xStart,yStart,title,text)\
- \009local sizeOfText = #text\
- \009local xWindowSize = 4+sizeOfText\
- \009local yWindowSize = 4\
- \009local xStart,yStart = correctStartCoords(xStart,yStart,xWindowSize,yWindowSize)\
- \
- \009emptyWindow(xStart,yStart,xWindowSize,yWindowSize,title)\
- \
- \009term.setBackgroundColor(colors.white)\
- \009colorText(xStart+2,yStart+2,text,colors.gray)\
- end",
- path = "//System/API/windows",
- },
- {
- text = "function archive(chto,vochto)\
- \009local Massiv2 = {}\
- \009local function FileList(path)\
- \009\009local Massiv = fs.list(path)\
- \009\009if #Massiv==0 then\
- \009\009\009local Massiv2Id = #Massiv2 + 1\
- \009\009\009Massiv2[Massiv2Id] = {}\
- \009\009\009Massiv2[Massiv2Id][\"path\"] = path\
- \009\009\009Massiv2[Massiv2Id][\"text\"] = \"@empty@empty\"\
- \009\009else\
- \009\009\009for i=1,#Massiv do\
- \009\009\009\009if fs.isDir(path..\"/\"..Massiv[i]) and Massiv[i] ~= \"/rom\" and Massiv[i] ~= \"rom\" then\
- \009\009\009\009\009FileList(path..\"/\"..Massiv[i])\
- \009\009\009\009elseif not fs.isDir(path..\"/\"..Massiv[i]) and Massiv[i] ~= \"/rom\" and Massiv[i] ~= \"rom\" then\
- \009\009\009\009\009local Massiv2Id = #Massiv2 + 1\
- \009\009\009\009\009Massiv2[Massiv2Id] = {}\
- \009\009\009\009\009Massiv2[Massiv2Id][\"path\"] = path..\"/\"..Massiv[i]\
- \009\009\009\009\009local file = fs.open(path..\"/\"..Massiv[i],\"r\")\
- \009\009\009\009\009Massiv2[Massiv2Id][\"text\"] = file.readAll()\
- \009\009\009\009\009file.close()\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- \009FileList(chto)\
- \009file=fs.open(vochto..\".zip\",\"w\")\
- \009file.write(textutils.serialise(Massiv2))\
- \009file.close()\
- \009return Massiv2\
- end\
- \
- function unarchive(chto,kuda)\
- \009local file = fs.open(chto,\"r\")\
- \009Massiv = textutils.unserialise(file.readAll())\
- \009file.close()\
- \009for i=1,#Massiv do\
- \009\009if Massiv[i][\"text\"] == \"@empty@empty\" then\
- \009\009\009fs.makeDir(kuda..\"/\"..Massiv[i][\"path\"])\
- \009\009else\
- \009\009\009local file = fs.open(kuda..\"/\"..Massiv[i][\"path\"],\"w\")\
- \009\009\009file.write(Massiv[i][\"text\"])\
- \009\009\009file.close()\
- \009\009end\
- \009end\
- end",
- path = "//System/API/zip",
- },
- {
- text = " 05 0d 0d 0d\
- a05p05p0ds0d\
- 05 05 05 0d",
- path = "//System/app.png",
- },
- {
- text = " 02 02 0c 02\
- 0b 0b[0c 0b\
- 0d 0d 0c 0d",
- path = "//System/archive.png",
- },
- {
- text = " 70 70 70 70 70 70\
- 70<70-70-70 70 70\
- 70 70-70-70>70 70\
- 80 80 80 80 80 80",
- path = "//System/back_ico.png",
- },
- {
- text = " 00 00 00 00\
- 00###### 00\
- 00###### 00\
- 00###### 00\
- 00###### 00\
- 00 00 00 00",
- path = "//System/clocks/0.png",
- },
- {
- text = "###### 00 00\
- ######### 00\
- ######### 00\
- ######### 00\
- ######### 00\
- ######### 00",
- path = "//System/clocks/1.png",
- },
- {
- text = "### 00 00###\
- 00###### 00\
- ######### 00\
- ###### 00###\
- ### 00######\
- 00 00 00 00",
- path = "//System/clocks/2.png",
- },
- {
- text = "### 00 00###\
- 00###### 00\
- ######### 00\
- ###### 00###\
- 00###### 00\
- ### 00 00###",
- path = "//System/clocks/3.png",
- },
- {
- text = " 00###### 00\
- 00###### 00\
- 00###### 00\
- 00 00 00 00\
- ######### 00\
- ######### 00",
- path = "//System/clocks/4.png",
- },
- {
- text = " 00 00 00 00\
- 00#########\
- 00 00 00###\
- ######### 00\
- 00###### 00\
- ### 00 00###",
- path = "//System/clocks/5.png",
- },
- {
- text = "### 00 00 00\
- 00#########\
- 00 00 00###\
- 00###### 00\
- 00###### 00\
- ### 00 00###",
- path = "//System/clocks/6.png",
- },
- {
- text = " 00 00 00 00\
- 00###### 00\
- ######### 00\
- ###### 00###\
- ### 00######\
- ### 00######",
- path = "//System/clocks/7.png",
- },
- {
- text = " 00 00 00 00\
- 00###### 00\
- 00###### 00\
- ### 00 00###\
- 00###### 00\
- 00 00 00 00",
- path = "//System/clocks/8.png",
- },
- {
- text = "### 00 00###\
- 00###### 00\
- 00###### 00\
- ### 00 00 00\
- ######### 00\
- ### 00 00###",
- path = "//System/clocks/9.png",
- },
- {
- text = "######\
- 00 00\
- ######\
- ######\
- 00 00\
- ######",
- path = "//System/clocks/dots.png",
- },
- {
- text = "{...}",
- path = "//System/desks/desk.back",
- },
- {
- text = "os.loadAPI(\"/System/API/image\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/rom/apis/gps\")\
- local run = true\
- local xSize, ySize = term.getSize()\
- local xCenter = math.floor(xSize/2)\
- local yCenter = math.floor(ySize/2)\
- local obj = {}\
- local arg = {...}\
- local cursor = 3 \
- local check = -4\
- local p_login = \"\"\
- local p_password = \"\"\
- local pword = \"\"\
- \
- local newObj = function(name,x1,y1,x2,y2)\
- obj[name] = {}\
- obj[name][\"x1\"] = x1\
- obj[name][\"y1\"] = y1\
- obj[name][\"x2\"] = x2\
- obj[name][\"y2\"] = y2\
- end\
- \
- local clear = function(color)\
- term.setBackgroundColor(color)\
- term.clear()\
- term.setCursorPos(1,1)\
- end\
- \
- local text = function(string,xPos,yPos)\
- term.setCursorPos(xPos,yPos)\
- term.write(string)\
- end\
- \
- local pastebin = function(paste,filename)\
- local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
- if file then\
- file = file.readAll()\
- h=fs.open(filename,\"w\")\
- h.write(file)\
- h.close()\
- else\
- windows.error(\"Unable to connect to the Internet\")\
- end\
- end\
- \
- local delik = function(y,color)\
- for i=2,xSize-2 do\
- term.setBackgroundColor(colors.wite)\
- term.setTextColor(color)\
- text(\"-\",i,y)\
- end\
- end\
- \
- local redraw = function()\
- clear(colors.lightGray)\
- term.setTextColor(colors.gray)\
- text(\" Skip \",2,ySize-1)\
- term.setTextColor(colors.white)\
- text(\"Hello!\",xCenter-2,3)\
- text(\"Username:\",4,13)\
- text(\"Password:\",4,15) \
- if p_login~=\"\" and p_password~=\"\" then \
- term.setBackgroundColor(colors.lime)\
- text(\" Create \",xSize-8,ySize-1)\
- else\
- term.setBackgroundColor(colors.gray)\
- text(\" Create \",xSize-8,ySize-1)\
- end\
- for i=1,4 do\
- paintutils.drawLine(1,6+i,xSize,6+i,colors.white)\
- end\
- term.setTextColor(colors.black)\
- text(\"Please, create\",xCenter-6,8)\
- text(\"your new account\",xCenter-7,9)\
- paintutils.drawLine(13,13,xSize-3,13,colors.white)\
- paintutils.drawLine(13,15,xSize-3,15,colors.white)\
- term.setTextColor(colors.black)\
- text(p_login,6+(xCenter-#p_login/2),13)\
- text(pword,6+(xCenter-#p_password/2),15)\
- end\
- \
- local pullEvent = function()\
- \009local event, side, x, y = os.pullEventRaw()\
- \009if event == \"terminate\" then\
- \009\009windows.error('You can`t use \"Ctrl+T\"')\
- \009\009redraw()\
- \009else\
- \009\009return event, side, x, y\
- \009end\
- end\
- \
- local running = function()\
- while run do\
- event, side, x, y = pullEvent()\
- if event == \"mouse_click\" then\
- if x>=2 and x<=7 and y==ySize-1 then\
- term.clear()\
- clear(colors.white)\
- term.setCursorPos(1,1)\
- l_login = \"...\"\
- run = false\
- elseif y==13 then\
- paintutils.drawLine(3,13,xSize-3,13,colors.white)\
- term.setCursorPos(3,13)\
- p_login = read()\
- l_login = p_login\
- redraw()\
- elseif y==15 then\
- paintutils.drawLine(3,15,xSize-3,15,colors.white)\
- term.setCursorPos(3,15)\
- p_password = read(string.char(7))\
- pword=\"\"\
- for i=1, #p_password do\
- pword = pword..string.char(7)\
- end\
- redraw()\
- elseif x>=xSize-8 and x<=xSize-1 and y==ySize-1 and p_login~=\"\" and p_password~=\"\" then\
- local f = fs.open(\"/System/accounts/\"..p_login,\"w\")\
- local conf = fs.open(\"/System/accounts/\"..p_login,\"w\")\
- conf.writeLine('autoPassEnter = 0 autoLogin = 0 password = \"'..p_password..'\"')\
- conf.close()\
- local conf = fs.open(\"/System/accounts/\"..p_login,\"a\")\
- conf.writeLine('style = colors.lightBlue')\
- conf.writeLine('colored = 0')\
- conf.close()\
- fs.makeDir('/.ds/'..p_login)\
- fs.makeDir('/System/desks')\
- local desk = {}\
- desk[1] = {}\
- desk[1][1] = {}\
- desk[1][1]['name']='sys/Store@.apk'\
- desk[1][1]['x']=3\
- desk[1][1]['y']=ySize-6\
- local file = fs.open('/System/desks/'..p_login,\"w\")\
- file.write(textutils.serialize(desk))\
- file.close()\
- run=false\
- os.reboot()\
- end\
- end\
- end\
- end\
- redraw()\
- running()\
- clear(colors.white)\
- term.setCursorPos(1,1)",
- path = "//System/FirstStart",
- },
- {
- text = " 04 04#########\
- -04-04-04-04###\
- -04-04-04-04###",
- path = "//System/folder.png",
- },
- {
- text = " 00 00 00 00 00 00\
- 00 00n80o80 00 00\
- 80i80c80o80n80 00\
- 00 00 00 00 00 00",
- path = "//System/noico.png",
- },
- {
- text = " 04 03 03 03###\
- 03 03 03 03###\
- 0dp0di0dc0d###",
- path = "//System/picture.png",
- },
- {
- text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/System/API/sysbar\")\
- os.loadAPI(\"/System/API/contexts\")\
- local xSize, ySize = term.getSize()\
- local centerX = math.floor(xSize/2)\
- local centerY = math.floor(ySize/2)\
- \
- local fileImage = 0\
- local fileDocument = 0\
- local fileOther = 0\
- local fileApps = 0\
- local newLabel = {}\
- local egg = 0\
- local draw = true\
- \
- --------------------MODEM FIND----------------------------\
- function findModem()\
- \009local PeriList = peripheral.getNames()\
- \009for i=1,#PeriList do\
- \009\009if peripheral.getType(PeriList[i]) == \"modem\" then\
- \009\009\009return PeriList[i]\
- \009\009end\
- \009end\
- end\
- \
- local computerModem = findModem()\
- if computerModem == nil then computerModem = \"not found\" end\
- \
- local function clearScreen(color)\
- \009term.setBackgroundColor(color)\
- \009term.clear()\
- end\
- \
- local function fadeOut(time)\
- for i=0,xSize do\
- paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
- paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
- sleep(time)\
- end\
- \009term.setCursorPos(1,1)\
- \009term.setTextColor(colors.white)\
- end\
- \
- local function writeText(text,x,y)\
- \009term.setCursorPos(x,y)\
- \009term.write(text)\
- end\
- \
- local drawBar = function()\
- \009while true do\
- \009\009if draw then\
- \009\009\009sysbar.draw(colors.white,colors.black,noty,true,true)\
- \009\009end\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local function infoText(key,keyColor,value,x,y)\
- \009term.setCursorPos(x,y)\
- \009term.setTextColor(keyColor)\
- \009term.write(key..\": \")\
- \009term.setTextColor(colors.lightGray)\
- \009term.setCursorPos(xSize-#value,y)\
- \009term.write(value)\
- end\
- \
- local function lines()\
- term.setBackgroundColor(colors.lightGray)\
- end\
- \
- local function redraw()\
- clearScreen(colors.white)\
- for i=3,5 do\
- \009paintutils.drawLine(1,i,xSize,i,colors.white)\
- end\
- term.setTextColor(colors.lightGray)\
- writeText('Vedroid',centerX-4,4)\
- term.setTextColor(colors.lime)\
- writeText('OS',centerX+3,4)\
- if egg < 4 then\
- local computerLabel = os.getComputerLabel()\
- if computerLabel == nil then computerLabel = \"not set\" end\
- sysbar.header(' < About',mainTextCol,mainColor)\
- for i=6,8 do\
- \009paintutils.drawLine(1,i,xSize,i,mainColor)\
- end\
- term.setTextColor(colors.black)\
- term.setBackgroundColor(colors.white)\
- infoText(\"Computer label\",colors.black,computerLabel,2,10)\
- infoText(\"Computer ID\",colors.black,tostring(os.getComputerID()),2,11)\
- infoText(\"Connected modem\",colors.black,computerModem,2,12)\
- infoText(\"Developer\",colors.black,\"DECE\",2,17)\
- term.setTextColor(colors.black)\
- writeText(\"Your OS version:\",2,14)\
- writeText(\"Last OS version:\",2,15)\
- if version == lastVer then\
- term.setTextColor(colors.lime)\
- elseif version < lastVer then\
- term.setTextColor(colors.red)\
- elseif version > lastVer then\
- term.setTextColor(colors.lightBlue)\
- end\
- writeText(version,xSize-#version,14)\
- term.setTextColor(colors.lime)\
- writeText(lastVer,xSize-#lastVer,15)\
- else\
- for i=6,ySize-1 do\
- paintutils.drawLine(1,i,xSize,i,colors.white)\
- end\
- writeText(osLogo,centerX-math.floor(#osLogo/2),centerY+1)\
- writeText('just because',centerX-5,ySize-2)\
- end\
- end\
- \
- local function touch()\
- while true do\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- draw = false\
- if x==xSize and y==ySize and egg < 4 then\
- term.setBackgroundColor(colors.gray)\
- term.setTextColor(colors.lightGray)\
- writeText(\"|\",xSize,ySize)\
- local budka = contexts.main(xSize,ySize-1,'Set label')\
- \009if budka == 'Set label' then\
- \009 redraw()\
- \009 local newLabel = windows.input(\"auto\",\"auto\",\"Set label\",14,{\"New label\",os.getComputerLabel()})\
- os.setComputerLabel(newLabel[1])\
- \009 if newLabel[1] == nil or newLabel[1] == '' or newLabel[1] == ' ' then\
- \009 os.setComputerLabel(nil)\
- \009 end\
- \009end\
- redraw()\
- elseif sysbar.back(x,y) or y==1 then\
- if egg < 4 then\
- break\
- \009else\
- \009 egg = 0\
- \009end\
- elseif sysbar.home(x,y) then\
- home = true\
- break\
- elseif y==4 and egg < 4 then\
- egg = egg + 1\
- end\
- redraw()\
- draw = true\
- sysbar.draw(colors.white,colors.black,noty,true,true)\
- end\
- end\
- end\
- redraw()\
- parallel.waitForAny(drawBar,touch)\
- clearScreen(colors.black)",
- path = "//System/prog/about",
- },
- {
- text = "os.loadAPI(\"/System/API/image\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/rom/apis/gps\")\
- os.loadAPI(\"/System/API/sysbar\")\
- local run = true\
- local xSize, ySize = term.getSize()\
- local xCenter = math.floor(xSize/2)\
- local yCenter = math.floor(ySize/2)\
- local obj = {}\
- local screen = 1\
- local maxScreen = 1\
- local xp = 3\
- local yp = 3\
- local pos = -1\
- local files = {}\
- local lenthScroll = 0\
- local posScroll = 0\
- local step = 0\
- local lenthPage = 0\
- local screen = window.create(term.current(),1,3,xSize-1,ySize-3)\
- \
- local function refreshFiles()\
- \009files = fs.list('/.ds/'..l_login)\
- \009return files\
- end\
- \
- local newObj = function(name,x1,y1,x2,y2)\
- obj[name] = {}\
- obj[name][\"x1\"] = x1\
- obj[name][\"y1\"] = y1\
- obj[name][\"x2\"] = x2\
- obj[name][\"y2\"] = y2\
- end\
- \
- local delApp = function()\
- files = refreshFiles()\
- for i=1,#files do\
- newObj(files[i],-1,-1,-1,-1)\
- end\
- end\
- \
- local clear = function(color)\
- term.setBackgroundColor(color)\
- term.clear()\
- term.setCursorPos(1,1)\
- end\
- \
- local text = function(string,xPos,yPos)\
- term.setCursorPos(xPos,yPos)\
- term.write(string)\
- end\
- \
- local function fadeOut(time)\
- clear(colors.white)\
- term.setCursorPos(1,1)\
- term.setTextColor(colors.white)\
- end\
- \
- local sysBar = function()\
- \009while true do\
- \009\009files = refreshFiles()\
- \009\009sysbar.header(\" < Applications\",mainTextCol,mainColor)\
- \009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local app = function(name,ico,x,y)\
- image.draw(x,y,ico)\
- term.setBackgroundColor(colors.white)\
- term.setTextColor(colors.black)\
- text(name,x+7,y+1)\
- text(\" \",x+#name+3,y+1)\
- newObj(name,xSize-10,y+5,xSize-2,y+5)\
- local size = fs.getSize(\"/.ds/\"..l_login..'/'..name..\"/main\")\
- size = math.floor(size/1024)\
- term.setTextColor(colors.gray)\
- text(\"Size: \"..size..\" KB\",x+7,y+2)\
- term.setTextColor(colors.red)\
- text(\"Delete\",xSize-7,y+3)\
- end\
- \
- local redraw = function()\
- term.redirect(screen)\
- clear(colors.white)\
- files = refreshFiles()\
- maxScreen = math.floor(#files/3+1)\
- for i=1,#files do\
- app(files[i],\"/.ds/\"..l_login..'/'..files[i]..\"/Resources/icon.png\",1,i*5+pos-2)\
- end\
- term.redirect(term.native())\
- step = sysbar.scrollBar(#files,5,posScroll,2)\
- end\
- \
- local running = function()\
- while run and l_login ~= '$test' do\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_scroll\" then\
- if #files>3 then\
- if side == 1 then\
- if pos>-#files*5+15 then\
- posScroll = posScroll-step\
- pos = pos-2\
- else\
- pos = -#files*5+15\
- end \
- elseif side == -1 then\
- if pos<-1 then \
- pos = pos+2\
- posScroll = posScroll+step\
- else\
- pos = -1\
- end\
- end\
- redraw()\
- end\
- elseif event == \"key\" then\
- if side == 208 then\
- if pos>-#files*5+15 then\
- posScroll = posScroll-step\
- pos = pos-2\
- else\
- pos = -#files*5+15\
- end \
- elseif side == 200 then\
- if pos<-1 then \
- pos = pos+2\
- posScroll = posScroll+step\
- else\
- pos = -1\
- end\
- end\
- redraw()\
- elseif event == \"mouse_click\" then\
- if sysbar.back(x,y) or y==1 then\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif sysbar.home(x,y) then\
- home = true\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- else\
- files = refreshFiles()\
- for i=1,#files do\
- 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\
- local but = windows.select({\"Delete\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
- if but == \"Yes\" then\
- shell.run(\"rm /.ds/\"..l_login..'/'..files[i])\
- redraw()\
- break\
- elseif but == \"No\" then redraw() end\
- end\
- end\
- end\
- end\
- end\
- end\
- \
- clear(colors.white)\
- redraw()\
- parallel.waitForAny(sysBar,running)\
- fadeOut(0)",
- path = "//System/prog/applications",
- },
- {
- text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
- os.loadAPI(\"/System/API/context\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/System/API/sysbar\")\
- os.loadAPI(\"/System/API/image\")\
- local xSize, ySize = term.getSize()\
- local xCenter, yCenter = math.floor(xSize/2), math.floor(ySize/2)\
- local run = true\
- local digits = {'0.png','1.png','2.png','3.png','4.png','5.png','6.png','7.png','8.png','9.png','dots.png'}\
- local comp = 0\
- if xSize > 30 then comp = 1 end\
- \
- local function clear(color)\
- \009term.setBackgroundColor(color)\
- \009term.clear()\
- end\
- \
- local function fadeIn(time)\
- for i=1,ySize-1 do\
- paintutils.drawLine(1,i,xSize,i,mainColor)\
- sleep(time)\
- end\
- end\
- \
- local function fadeOut(time)\
- for i=0,xSize do\
- paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
- paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
- sleep(time)\
- end\
- \009term.setCursorPos(1,1)\
- \009term.setTextColor(colors.white)\
- end\
- \
- local function text(text,x,y)\
- \009term.setCursorPos(x,y)\
- \009term.write(text)\
- end\
- \
- local sysBar = function()\
- term.setTextColor(colors.black)\
- term.setBackgroundColor(colors.white)\
- sysbar.draw(colors.white,colors.black,noty,true,false,false)\
- end\
- \
- local formatTime = function(nTime)\
- local nHour = math.floor(nTime)\
- local nMinute = math.floor((nTime - nHour)*60)\
- return nHour, nMinute\
- end\
- \
- local drawDots = function()\
- \009while true do\
- \009\009image.draw(xCenter,yCenter-3,'/System/clocks/'..digits[11])\
- \009\009sleep(0.5)\
- \009\009paintutils.drawFilledBox(xCenter,yCenter-3,xCenter+1,yCenter+3,style)\
- \009\009sleep(0.5)\
- \009end\
- end\
- \
- local globalClock = function(time)\
- \009while true do\
- \009\009local globalTime = os.time()\
- \009\009local hour, minute = formatTime(globalTime)\
- \009\009paintutils.drawFilledBox(xCenter-10,yCenter-3,xCenter-1,yCenter+3,style)\
- \009\009paintutils.drawFilledBox(xCenter+3,yCenter-3,xCenter+11,yCenter+3,style)\
- \009\009image.draw(xCenter-10,yCenter-3,'/System/clocks/'..digits[math.floor(hour/10)+1])\
- \009\009image.draw(xCenter-5,yCenter-3,'/System/clocks/'..digits[math.floor(hour%10)+1])\
- \009\009image.draw(xCenter+3,yCenter-3,'/System/clocks/'..digits[math.floor(minute/10)+1])\
- \009\009image.draw(xCenter+8,yCenter-3,'/System/clocks/'..digits[math.floor(minute%10)+1])\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local function redraw()\
- clear(style)\
- sysBar()\
- end\
- \
- local function touch()\
- while true do\
- --clock()\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- if sysbar.back(x,y) then\
- break\
- elseif sysbar.home(x,y) then\
- home = true\
- break\
- end\
- end\
- end\
- end\
- \
- redraw()\
- parallel.waitForAny(globalClock,touch,drawDots)\
- clear(colors.black)",
- path = "//System/prog/clock",
- },
- {
- text = "os.loadAPI(\"/System/API/image\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/rom/apis/gps\")\
- os.loadAPI(\"/System/API/sysbar\")\
- \
- local pastebin = function(paste,filename)\
- local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
- if file then\
- file = file.readAll()\
- h=fs.open(filename,\"w\")\
- h.write(file)\
- h.close()\
- else\
- windows.error(\"Unable to connect to the Internet\")\
- end\
- end\
- \
- local find = false\
- local file = fs.list(\"/System/accounts\")\
- for I=1,#file do\
- if file[I] == l_login then find = true end\
- end\
- if find == false and l_login ~= '...' then\
- local conf = fs.open(\"/System/accounts/\"..l_login,\"w\")\
- conf.writeLine('autoPassEnter = 0 autoLogin = 0')\
- conf.close()\
- elseif l_login ~= '...' and log == true then\
- pastebin(\"AH3k8DMa\",\"/ver\")\
- shell.run(\"/ver\")\
- shell.run(\"/System/accounts/\"..l_login)\
- end\
- local run = true\
- local xSize, ySize = term.getSize()\
- local xCenter = math.floor(xSize/2)\
- local yCenter = math.floor(ySize/2)\
- local obj = {}\
- local arg = {...}\
- local cursor = 3 \
- local check = -4\
- find = true\
- local p_login = \"\"\
- local p_password = \"\"\
- local pword = \"\"\
- local ico = false\
- local back = false\
- local pull = false\
- shell.run(\"mkdir /System/accounts\")\
- file = fs.list(\"System/accounts\")\
- local autopass = autoPassEnter\
- local autolog = autoLogin\
- \
- local newObj = function(name,x1,y1,x2,y2)\
- obj[name] = {}\
- obj[name][\"x1\"] = x1\
- obj[name][\"y1\"] = y1\
- obj[name][\"x2\"] = x2\
- obj[name][\"y2\"] = y2\
- end\
- \
- local clear = function(color)\
- term.setBackgroundColor(color)\
- term.clear()\
- term.setCursorPos(1,1)\
- end\
- \
- local text = function(string,xPos,yPos)\
- term.setCursorPos(xPos,yPos)\
- term.write(string)\
- end\
- \
- local function fadeOut(time)\
- clear(colors.lightGray)\
- sleep(time)\
- clear(colors.gray)\
- sleep(time)\
- clear(colors.black)\
- sleep(time)\
- term.setCursorPos(1,1)\
- term.setTextColor(colors.black)\
- end\
- \
- local sysBar = function()\
- \009while true do\
- \009\009sysbar.header(\" < Security\",mainTextCol,mainColor)\
- \009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local redraw = function()\
- clear(colors.white)\
- term.setTextColor(colors.black)\
- if #file == 0 then \
- find = false \
- elseif #file > 0 then\
- find = true\
- end\
- if find == false and log == false then\
- clear(colors.white)\
- term.setTextColor(colors.gray)\
- text(\"New account\",3,4)\
- term.setTextColor(colors.black)\
- text(\"Username:\",6,6)\
- text(\"Password:\",6,8)\
- paintutils.drawLine(15,6,xSize-5,6,colors.lightGray)\
- paintutils.drawLine(15,8,xSize-5,8,colors.lightGray)\
- term.setTextColor(colors.white)\
- text(p_login,6+(xCenter-#p_login/2),6)\
- text(pword,6+(xCenter-#p_password/2),8)\
- if p_login~=\"\" and p_password~=\"\" then\
- term.setBackgroundColor(colors.lime)\
- term.setTextColor(colors.white)\
- text(\" Create \",xCenter-3,10)\
- end\
- elseif find == true and log == false then\
- clear(colors.white)\
- term.setTextColor(colors.gray)\
- text(\"Enter account\",3,4)\
- term.setTextColor(colors.black)\
- text(\"Username:\",6,6)\
- text(\"Password:\",6,8)\
- paintutils.drawLine(15,6,xSize-5,6,colors.lightGray)\
- paintutils.drawLine(15,8,xSize-5,8,colors.lightGray)\
- term.setTextColor(colors.white)\
- if l_login~=nil then\
- text(l_login,xCenter-#l_login/2+6,6)\
- end\
- text(pword,xCenter-#p_password/2+6,8)\
- text(\"v\",xSize-5,6)\
- if l_login~=\"\" and p_password~=\"\" then\
- term.setBackgroundColor(colors.lime)\
- term.setTextColor(colors.white)\
- text(\" Log In \",xCenter-3,10)\
- end\
- elseif log == true then\
- clear(colors.white)\
- term.setTextColor(colors.gray)\
- text(\"Account settings\",3,4)\
- local icon = fs.list(\"/System\")\
- for i=1,#icon do\
- if icon[i]==l_login..\".png\" then\
- image.draw(3,6,\"/System/\"..l_login..\".png\")\
- ico = true\
- end\
- end\
- if ico == false then\
- image.draw(3,6,\"/System/acc.png\")\
- end\
- ico = false\
- term.setTextColor(colors.black)\
- term.setBackgroundColor(colors.white)\
- text(\"Auto enter\",3,12)\
- text(\"Auto login\",3,14)\
- term.setTextColor(colors.gray)\
- text(\"Exit to CraftOS\",3,16)\
- term.setBackgroundColor(colors.red)\
- term.setTextColor(colors.white)\
- text(\" Delete \",12,8)\
- term.setBackgroundColor(colors.lightGray)\
- text(\" Logout \",12,6)\
- sysbar.switch(12,autoPassEnter,mainSwitchCol)\
- sysbar.switch(14,autoLogin,mainSwitchCol)\
- end\
- end\
- \
- local pullEvent = function()\
- \009local event, side, x, y = os.pullEventRaw()\
- \009if event == \"terminate\" then\
- \009\009windows.error('You can`t use \"Ctrl+T\"')\
- \009\009redraw()\
- \009else\
- \009\009return event, side, x, y\
- \009end\
- end \
- \
- local running = function()\
- while run do\
- event, side, x, y = pullEvent()\
- if event == \"mouse_click\" then\
- if log == false then\
- if x==xSize-5 and y==6 then\
- if pull == true then\
- pull = false\
- redraw()\
- elseif pull == false then\
- file = fs.list(\"/System/accounts\")\
- for i=1,#file do\
- paintutils.drawLine(15,6,xSize-5,6,colors.lightGray)\
- term.setTextColor(colors.white)\
- text(\"^\",xSize-5,6)\
- text(\"...\",xCenter-3/2+6,6)\
- paintutils.drawLine(15,6+i,xSize-5,6+i,colors.lightGray)\
- paintutils.drawLine(15,7+i,xSize-5,7+i,colors.lightGray)\
- text(file[i],xCenter-#file[i]/2+6,6+i)\
- term.setTextColor(colors.gray)\
- text(\"New\",xCenter-3/2+6,7+i)\
- end\
- pull = true\
- end\
- elseif y>6 and y-6<=#file and pull==true then\
- l_login = file[y-6]\
- shell.run(\"/System/accounts/\"..file[y-6])\
- pull = false\
- redraw()\
- elseif y-6==#file+1 and pull==true then\
- l_login = \"$test\"\
- file = {}\
- find = false\
- pull = false\
- redraw()\
- elseif y==6 and find==false then\
- paintutils.drawLine(6,6,xSize-5,6,colors.lightGray)\
- \009 term.setTextColor(colors.white)\
- term.setCursorPos(6,6)\
- p_login = read()\
- redraw()\
- elseif y==8 and pull==false then\
- paintutils.drawLine(6,8,xSize-5,8,colors.lightGray)\
- term.setCursorPos(6,8)\
- \009 term.setTextColor(colors.white)\
- p_password = read(\"o\")\
- pword=\"\"\
- for i=1, #p_password do\
- pword = pword..\"o\"\
- end\
- redraw()\
- elseif y==10 and ((p_login~=\"\" or l_login~=\"\") and l_login ~= '$test') and p_password~=\"\" then\
- if find==false then\
- local f = fs.open(\"/System/accounts/\"..p_login,\"w\")\
- local conf = fs.open(\"/System/accounts/\"..p_login,\"w\")\
- conf.writeLine('autoPassEnter = 0 autoLogin = 0 password = \"'..p_password..'\"')\
- conf.close()\
- local conf = fs.open(\"/System/accounts/\"..p_login,\"a\")\
- conf.writeLine('style = colors.lightBlue')\
- conf.writeLine('colored = 0')\
- conf.close()\
- p_password = \"\"\
- pword = \"\"\
- \009 fs.makeDir('/.ds/'..p_login)\
- file = fs.list(\"System/accounts\")\
- else\
- if p_password == password then\
- log = true\
- else\
- paintutils.drawLine(6,7,xSize-5,7,colors.red)\
- term.setTextColor(colors.white)\
- text(\"Wrong password\",xCenter-6,7)\
- sleep(1)\
- end\
- end\
- redraw()\
- elseif sysbar.back(x,y) or y==1 then\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif sysbar.home(x,y) then\
- \009 home = true\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- end\
- elseif log == true then\
- if y==6 and x>=12 and x<=21 then\
- log = false\
- p_password = \"\"\
- pword = \"\"\
- \009 password = \"\"\
- l_login = \"$test\"\
- \009 style = colors.lightBlue\
- \009 colored = 0\
- \009 mainColor = colors.lightGray\
- \009 mainTextCol = colors.gray\
- \009 mainSwitchCol = colors.lightBlue\
- redraw()\
- elseif y==8 and x>=12 and x<=21 then\
- \009 local but = windows.select({\"Delete account\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
- if but == \"Yes\" then\
- shell.run(\"rm /System/accounts/\"..l_login)\
- \009 shell.run(\"rm /System/desks/\"..l_login)\
- \009 shell.run('rm /.ds/'..l_login)\
- log = false\
- p_password = \"\"\
- pword = \"\"\
- \009 password = \"\"\
- l_login = \"$test\"\
- \009 style = colors.lightBlue\
- \009 colored = 0\
- \009 mainColor = colors.lightGray\
- \009 mainTextCol = colors.gray\
- \009 mainSwitchCol = colors.lightBlue\
- \009 end\
- redraw()\
- elseif sysbar.back(x,y) or y==1 then\
- clear(colors.black)\
- term.setCursorPos(1,1)\
- run = false\
- elseif sysbar.home(x,y) then\
- term.clear()\
- term.setCursorPos(1,1)\
- \009 home = true\
- run = false\
- elseif x>=1 and x<=xSize and y==12 and autoPassEnter == 0 then\
- autoPassEnter = 1\
- redraw()\
- elseif x>=1 and x<=xSize and y==12 and autoPassEnter == 1 then\
- autoPassEnter = 0 \
- redraw()\
- elseif x>=1 and x<=xSize and y==14 and autoLogin == 0 then\
- autoLogin = 1\
- redraw()\
- elseif x>=1 and x<=xSize and y==14 and autoLogin == 1 then\
- autoLogin = 0\
- redraw()\
- \009elseif y==16 then\
- local but = windows.select({\"Exit to CraftOS\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
- if but == \"Yes\" then\
- \009 osexit = true\
- clear(colors.black)\
- term.setCursorPos(1,1)\
- \009 home = true\
- run = false\
- \009 break\
- elseif but == \"No\" then\
- \009 redraw()\
- \009 end\
- end\
- end\
- end\
- end\
- end\
- \
- redraw()\
- parallel.waitForAny(sysBar,running)\
- if l_login ~= '...' and l_login ~= '$test' and log == true then\
- local conf = fs.open(\"/System/accounts/\"..l_login,\"w\")\
- conf.writeLine('autoPassEnter = '..autoPassEnter..' autoLogin = '..autoLogin..' password = \"'..password..'\"')\
- conf.close()\
- local conf = fs.open(\"/System/accounts/\"..l_login,\"a\")\
- conf.writeLine('style = '..style)\
- conf.writeLine('colored = '..colored)\
- conf.close()\
- elseif log == false then\
- l_login = \"$test\"\
- style = colors.lightBlue\
- colored = 0\
- mainColor = colors.lightGray\
- mainTextCol = colors.gray\
- mainSwitchCol = colors.lightBlue\
- shell.run('mkdir /System/desks')\
- local file = fs.open('/System/desks/'..l_login,\"w\")\
- file.write('{}')\
- file.close()\
- end",
- path = "//System/prog/security",
- },
- {
- text = "os.loadAPI(\"/System/API/image\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/rom/apis/gps\")\
- os.loadAPI(\"/System/apis/sysbar\")\
- local run = true\
- local xSize, ySize = term.getSize()\
- local xCenter = math.floor(xSize/2)\
- local yCenter = math.floor(ySize/2)\
- local obj = {}\
- local arg = {...}\
- local screen = window.create(term.current(),1,3,xSize,ySize-3)\
- local draw = true\
- \
- function findModem()\
- \009local PeriList = peripheral.getNames()\
- \009for i=1,#PeriList do\
- \009\009if peripheral.getType(PeriList[i]) == \"modem\" then\
- \009\009\009return PeriList[i]\
- \009\009end\
- \009end\
- end\
- \
- local computerModem = findModem()\
- \
- local newObj = function(name,x1,y1,x2,y2)\
- obj[name] = {}\
- obj[name][\"x1\"] = x1\
- obj[name][\"y1\"] = y1\
- obj[name][\"x2\"] = x2\
- obj[name][\"y2\"] = y2\
- end\
- \
- local clear = function(color)\
- term.setBackgroundColor(color)\
- term.clear()\
- term.setCursorPos(1,1)\
- end\
- \
- local text = function(string,xPos,yPos)\
- term.setCursorPos(xPos,yPos)\
- term.write(string)\
- end\
- \
- local fadeIn = function()\
- for i=1,xSize do\
- paintutils.drawLine(i,1,i,ySize-1,colors.black)\
- sleep(0)\
- end\
- end\
- \
- local function fadeOut(time)\
- clear(colors.lightGray)\
- sleep(time)\
- clear(colors.gray)\
- sleep(time)\
- clear(colors.black)\
- sleep(time)\
- term.setCursorPos(1,1)\
- term.setTextColor(colors.black)\
- end\
- \
- local sysBar = function()\
- \009while true do\
- \009\009if draw then\
- \009\009\009sysbar.header(\"Settings\",mainTextCol,mainColor)\
- \009\009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
- \009\009end\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local menu = function(...)\
- term.setBackgroundColor(colors.white)\
- term.setTextColor(colors.black)\
- local cursor = 4\
- for i=1,#arg do\
- text(arg[i],2,cursor-2)\
- newObj(arg[i],2,cursor,xSize,cursor)\
- cursor=cursor+2\
- end\
- end\
- \
- local redraw = function()\
- term.redirect(screen)\
- clear(colors.white)\
- menu(\"RedNet\",\"Applications\",\"Customization\",\"Security\",\"Storage\",\"Update\",\"About\")\
- paintutils.drawLine(xSize-7,2,xSize-2,2,colors.gray)\
- term.setTextColor(colors.white)\
- if wifi == \"off\" then\
- paintutils.drawLine(xSize-7,2,xSize-5,2,colors.lightGray)\
- elseif wifi == \"on\" then\
- paintutils.drawLine(xSize-4,2,xSize-2,2,mainSwitchCol)\
- end\
- term.redirect(term.native())\
- end\
- \
- \
- local running = function()\
- while run == true and home == false do\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- draw = false\
- if sysbar.back(x,y) == true then\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif sysbar.home(x,y) == true then\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif x>=1 and x<=xSize and y==4 and wifi==\"off\" then\
- \009if computerModem ~= nil then\
- \009 rednet.open(computerModem)\
- \009 wifi = \"on\"\
- \009end\
- redraw()\
- elseif x>=1 and x<=xSize and y==4 and wifi==\"on\" then\
- \009if computerModem ~= nil then\
- \009 rednet.close(computerModem)\
- \009 wifi = \"off\"\
- \009end\
- redraw()\
- elseif x>=obj[\"About\"][\"x1\"] and x<=obj[\"About\"][\"x2\"] and y>=obj[\"About\"][\"y1\"] and y<=obj[\"About\"][\"y2\"] then\
- paintutils.drawLine(1,obj[\"About\"][\"y1\"],xSize,obj[\"About\"][\"y2\"],colors.lightGray)\
- \009term.setTextColor(colors.white)\
- \009text('About',2,obj[\"About\"][\"y1\"])\
- shell.run(\"/System/prog/about\")\
- redraw()\
- elseif x>=obj[\"Applications\"][\"x1\"] and x<=obj[\"Applications\"][\"x2\"] and y>=obj[\"Applications\"][\"y1\"] and y<=obj[\"Applications\"][\"y2\"] then\
- paintutils.drawLine(1,obj[\"Applications\"][\"y1\"],xSize,obj[\"Applications\"][\"y2\"],colors.lightGray)\
- \009term.setTextColor(colors.white)\
- \009text('Applications',2,obj[\"Applications\"][\"y1\"])\
- shell.run(\"/System/prog/applications\")\
- redraw()\
- elseif x>=obj[\"Customization\"][\"x1\"] and x<=obj[\"Customization\"][\"x2\"] and y>=obj[\"Customization\"][\"y1\"] and y<=obj[\"Customization\"][\"y2\"] then\
- paintutils.drawLine(1,obj[\"Customization\"][\"y1\"],xSize,obj[\"Customization\"][\"y2\"],colors.lightGray)\
- \009term.setTextColor(colors.white)\
- \009text('Customization',2,obj[\"Customization\"][\"y1\"])\
- shell.run(\"/System/prog/style\")\
- redraw()\
- elseif x>=obj[\"Storage\"][\"x1\"] and x<=obj[\"Storage\"][\"x2\"] and y>=obj[\"Storage\"][\"y1\"] and y<=obj[\"Storage\"][\"y2\"] then\
- paintutils.drawLine(1,obj[\"Storage\"][\"y1\"],xSize,obj[\"Storage\"][\"y2\"],colors.lightGray)\
- \009term.setTextColor(colors.white)\
- \009text('Storage',2,obj[\"Storage\"][\"y1\"])\
- shell.run(\"/System/prog/storage\")\
- redraw()\
- elseif x>=obj[\"Update\"][\"x1\"] and x<=obj[\"Update\"][\"x2\"] and y>=obj[\"Update\"][\"y1\"] and y<=obj[\"Update\"][\"y2\"] then\
- paintutils.drawLine(1,obj[\"Update\"][\"y1\"],xSize,obj[\"Update\"][\"y2\"],colors.lightGray)\
- \009term.setTextColor(colors.white)\
- \009text('Update',2,obj[\"Update\"][\"y1\"])\
- shell.run(\"/System/prog/update\")\
- redraw()\
- elseif x>=obj[\"Security\"][\"x1\"] and x<=obj[\"Security\"][\"x2\"] and y>=obj[\"Security\"][\"y1\"] and y<=obj[\"Security\"][\"y2\"] then\
- paintutils.drawLine(1,obj[\"Security\"][\"y1\"],xSize,obj[\"Security\"][\"y2\"],colors.lightGray)\
- \009term.setTextColor(colors.white)\
- \009text('Security',2,obj[\"Security\"][\"y1\"])\
- shell.run(\"/System/prog/security\")\
- redraw()\
- end\
- sysbar.header(\"Settings\",mainTextCol,mainColor)\
- sysbar.draw(colors.white,colors.black,noty,true,false)\
- draw = true\
- end\
- end\
- end\
- \
- clear(colors.white)\
- redraw()\
- parallel.waitForAny(sysBar,running)\
- fadeOut(0)",
- path = "//System/prog/settings",
- },
- {
- text = "--???????? ?? ????? ?? ECS http://pastebin.com/Xn8THcUC\
- os.loadAPI(\"/System/API/contexts\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/System/API/sysbar\")\
- local xSize, ySize = term.getSize()\
- \
- local fileImage = 0\
- local fileDocument = 0\
- local fileOther = 0\
- local fileApps = 0\
- local context = false\
- local file = {}\
- local appsColor = colors.green\
- local otherColor = colors.lime\
- local docsColor = colors.red\
- local imagesColor = colors.orange\
- local draw = true\
- \
- local function writeText(text,x,y)\
- \009term.setCursorPos(x,y)\
- \009term.write(text)\
- end\
- \
- local function clearScreen(color)\
- \009term.setBackgroundColor(color)\
- \009term.clear()\
- end\
- \
- local function fadeIn(time)\
- for i=1,ySize-1 do\
- paintutils.drawLine(1,i,xSize,i,mainColor)\
- sleep(time)\
- end\
- end\
- \
- local function fadeOut(time)\
- for i=0,xSize do\
- paintutils.drawLine(xSize-i,0,xSize-i,ySize-1,colors.black)\
- paintutils.drawLine(xSize-i,1,xSize,1,colors.black)\
- sleep(time)\
- end\
- \009term.setCursorPos(1,1)\
- \009term.setTextColor(colors.white)\
- end\
- \
- local function getSizeOfAll()\
- \009local sizeOfAll1 = 0\
- \009local function files(path)\
- \009\009local massiv = fs.list(path)\
- \009\009for i=1,#massiv do\
- \009\009\009if fs.isDir(massiv[i]) then\
- \009\009\009\009files(path..\"/\"..massiv[i])\
- \009\009\009else\
- \009\009\009\009sizeOfAll1 = sizeOfAll1 + fs.getSize(path..\"/\"..massiv[i])\
- \009\009\009end\
- \009\009end\
- \009end\
- \009files(\"\")\
- \009sizeOfAll1 = sizeOfAll1 + fileApps\
- \009return sizeOfAll1\
- end\
- \
- local function getFileFormat(file)\
- \009local start,ending = string.find(file,\"%.%w*$\")\
- \009if start == nil then\
- \009\009return nil\
- \009else\
- \009\009return string.sub(file,start,ending)\
- \009end\
- end\
- \
- local function getSizeOfFormat()\
- \009local sizeOfAll1 = 0\
- \009local function files(path)\
- \009\009local massiv = fs.list(path)\
- \009\009for i=1,#massiv do\
- \009\009\009if fs.isDir(massiv[i]) then\
- \009\009\009\009files(path..\"/\"..massiv[i])\
- \009\009\009else\
- \009\009\009\009local f = getFileFormat(path..\"/\"..massiv[i])\
- \009\009\009\009local s = fs.getSize(path..\"/\"..massiv[i])\
- \009\009\009\009if f == \".png\" or f == \".pic\" or f == \".jpg\" then\
- \009\009\009\009\009fileImage = fileImage + s\
- \009\009\009\009elseif f == \".cfg\" or f == \".log\" or f == \".txt\" or f == \".md\" then\
- \009\009\009\009\009fileDocument = fileDocument + s\
- \009\009\009\009else\
- \009\009\009\009\009fileOther = fileOther + s\
- \009\009\009\009end\
- \009\009\009end\
- \009\009end\
- \009end\
- \009local file1 = fs.list('/.ds')\
- \009 ii = 1\
- \009 for i=1,#file1 do\
- \009\009if fs.isDir('/.ds/'..file1[i]) then\
- \009\009 local file2 = fs.list('/.ds/'..file1[i])\
- \009\009 for ii=1,#file2 do\
- \009\009 file[#file+1] = file1[i]..'/'..file2[ii]\
- \009\009 end\
- \009\009end\
- \009 end \
- \009for i=1, #file do\
- \009 fileApps = fileApps + fs.getSize(\"/.ds/\"..file[i]..\"/main\")\
- \009\009local res = fs.list(\"/.ds/\"..file[i]..\"/Resources\")\
- \009\009 \009for ii=1,#res do fileApps = fileApps + fs.getSize(\"/.ds/\"..file[i]..\"/Resources/\"..res[ii])\
- \009\009end\
- \009end\
- \
- \009files(\"\")\
- \009return sizeOfAll1\
- end\
- \
- local drawBar = function()\
- \009while true do\
- \009\009if draw then\
- \009\009\009sysbar.header(' < Storage',mainTextCol,mainColor)\
- \009\009\009sysbar.draw(colors.white,colors.black,noty,true,true)\
- \009\009end\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local function infoText(key,keyColor,value,x,y)\
- \009term.setCursorPos(x,y)\
- \009term.setTextColor(keyColor)\
- \009term.write(key..\": \")\
- \009term.setTextColor(colors.lightGray)\
- \009term.setCursorPos(xSize-#value,y)\
- \009term.write(value)\
- end\
- \
- getSizeOfFormat()\
- \
- local sizeOfAll = getSizeOfAll()\
- local freeSpace = fs.getFreeSpace(\"\")\
- local totalSpace = freeSpace + sizeOfAll\
- local lengthOfPolosa = xSize-2\
- local lengthOfAll = math.floor(lengthOfPolosa*(math.ceil(sizeOfAll/totalSpace*100))/100)\
- local lengthOfDocuments = math.floor(lengthOfPolosa*math.ceil(fileDocument/sizeOfAll*100)/100)\
- local lengthOfImages = math.floor(lengthOfPolosa*math.ceil(fileImage/sizeOfAll*100)/100)\
- local lengthOfApps = math.floor(lengthOfPolosa*math.ceil(fileApps/sizeOfAll*100)/100)\
- \
- local xStart = math.floor(xSize/2-lengthOfPolosa/2)\
- local yStart = ySize-3\
- \
- local function displayBarAll(yStart)\
- \009for y=yStart,(yStart+1) do\
- \009\009for x=(xStart+1),(xStart+lengthOfPolosa) do\
- \009\009\009paintutils.drawPixel(x,y,colors.gray)\
- \009\009end\
- \009end\
- \009for y=yStart,(yStart+1) do\
- \009\009for x=(xStart+1),(xStart+lengthOfAll) do\
- \009\009\009paintutils.drawPixel(x,y,colors.blue)\
- \009\009end\
- \009end\
- end\
- \
- local function displayBarOne(yStart)\
- \009for y=yStart,(yStart+1) do\
- \009\009for x=(xStart+1),(xStart+lengthOfPolosa) do\
- \009\009\009paintutils.drawPixel(x,y,otherColor)\
- \009\009end\
- \009end\
- \009for y=yStart,(yStart+1) do\
- \009\009for x=(xStart+1),(xStart+lengthOfDocuments) do\
- \009\009\009paintutils.drawPixel(x,y,docsColor)\
- \009\009end\
- \009end\
- \009for y=yStart,(yStart+1) do\
- \009\009for x=(xStart+1+lengthOfDocuments),(xStart+lengthOfDocuments+lengthOfImages) do\
- \009\009\009paintutils.drawPixel(x,y,imagesColor)\
- \009\009end\
- \009end\
- \009for y=yStart,(yStart+1) do\
- \009\009for x=(xStart+1+lengthOfDocuments+lengthOfImages),(xStart+lengthOfDocuments+lengthOfImages+lengthOfApps) do\
- \009\009\009paintutils.drawPixel(x,y,appsColor)\
- \009\009end\
- \009end\
- end\
- \
- \
- local function redraw()\
- clearScreen(colors.white)\
- term.setTextColor(colors.black)\
- term.setBackgroundColor(colors.white)\
- infoText(\"Availeble space\",colors.black,math.ceil(totalSpace/1024)..\" KB\",2,4)\
- infoText(\"Used space\",colors.blue,math.ceil(sizeOfAll/1024)..\" KB\",2,5)\
- infoText(\"Free space\",colors.gray,math.ceil(freeSpace/1024)..\" KB\",2,6)\
- infoText(\"Documents\",docsColor,math.ceil(fileDocument/1024)..\" KB\",2,11)\
- infoText(\"Images\",imagesColor,math.ceil(fileImage/1024)..\" KB\",2,12)\
- infoText(\"Apps\",appsColor,math.ceil(fileApps/1024)..\" KB\",2,13)\
- infoText(\"Other\",otherColor,math.ceil(fileOther/1024)..\" KB\",2,14)\
- term.setTextColor(colors.lightGray)\
- displayBarAll(8)\
- displayBarOne(16)\
- end\
- \
- redraw()\
- \
- local function touch()\
- while true do\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- draw = false\
- if x==xSize and y==ySize then\
- term.setBackgroundColor(colors.gray)\
- \009term.setTextColor(colors.lightGray)\
- \009writeText('|',xSize,ySize)\
- local budka = contexts.main(xSize,ySize-1,'Delete all')\
- \009if budka == 'Delete all' then\
- \009 draw = false\
- \009 term.setCursorPos(0,0)\
- \009 shell.run(\"pastebin run NuHsLAhr\")\
- \009 os.reboot()\
- \009end\
- redraw()\
- elseif sysbar.back(x,y) or y==1 then\
- break\
- elseif sysbar.home(x,y) then\
- home = true\
- break\
- end\
- draw = true\
- sysbar.header(' < Storage',mainTextCol,mainColor)\
- sysbar.draw(colors.white,colors.black,noty,true,true)\
- end\
- end\
- end\
- clearScreen(colors.white)\
- redraw()\
- parallel.waitForAny(drawBar,touch)\
- clearScreen(colors.black)",
- path = "//System/prog/storage",
- },
- {
- text = "os.loadAPI(\"/System/API/image\")\
- os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/rom/apis/gps\")\
- os.loadAPI(\"/System/API/sysbar\")\
- local run = true\
- local xSize, ySize = term.getSize()\
- local xCenter = math.floor(xSize/2)\
- local yCenter = math.floor(ySize/2)\
- local obj = {}\
- local arg = {...}\
- local cursor = 2 \
- local check = -4\
- local step = 0\
- local posScroll = 0\
- local screen = window.create(term.current(),1,3,xSize-1,ySize-3)\
- \
- local newObj = function(name,x1,y1,x2,y2)\
- obj[name] = {}\
- obj[name][\"x1\"] = x1\
- obj[name][\"y1\"] = y1\
- obj[name][\"x2\"] = x2\
- obj[name][\"y2\"] = y2\
- end\
- \
- local clear = function(color)\
- term.setBackgroundColor(color)\
- term.clear()\
- term.setCursorPos(1,1)\
- end\
- \
- local text = function(string,xPos,yPos)\
- term.setCursorPos(xPos,yPos)\
- term.write(string)\
- end\
- \
- local function fadeOut(time)\
- clear(colors.lightGray)\
- sleep(time)\
- clear(colors.gray)\
- sleep(time)\
- clear(colors.black)\
- sleep(time)\
- term.setCursorPos(1,1)\
- term.setTextColor(colors.black)\
- end\
- \
- local sysBar = function()\
- \009while true do\
- \009\009sysbar.header(\" < Customisation\",mainTextCol,mainColor)\
- \009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local setStyle = function(color)\
- style = color\
- end\
- \
- local redraw = function()\
- term.redirect(screen)\
- clear(colors.white)\
- term.setBackgroundColor(colors.white)\
- term.setTextColor(colors.gray)\
- text(\"Main color\",3,cursor)\
- term.setTextColor(colors.black)\
- text(\"Red\",6,cursor+2)\
- text(\"Orange\",6,cursor+4)\
- text(\"Yellow\",6,cursor+6)\
- text(\"Lime\",6,cursor+8)\
- text(\"Green\",6,cursor+10)\
- text(\"Cyan\",6,cursor+12)\
- text(\"Blue\",6,cursor+14)\
- text(\"Light Blue\",6,cursor+16)\
- text(\"Light Gray\",6,cursor+18)\
- text(\"Purple\",6,cursor+20)\
- text(\"Colored Headers\",3,cursor+22)\
- term.setTextColor(colors.lightGray)\
- text(\"( )\",xSize-4,cursor+2)\
- text(\"( )\",xSize-4,cursor+4)\
- text(\"( )\",xSize-4,cursor+6)\
- text(\"( )\",xSize-4,cursor+8)\
- text(\"( )\",xSize-4,cursor+10)\
- text(\"( )\",xSize-4,cursor+12)\
- text(\"( )\",xSize-4,cursor+14)\
- text(\"( )\",xSize-4,cursor+16)\
- text(\"( )\",xSize-4,cursor+18)\
- text(\"( )\",xSize-4,cursor+20)\
- term.setTextColor(mainColor)\
- if style == colors.red then check = 2\
- elseif style == colors.orange then check = 4\
- elseif style == colors.yellow then check = 6\
- elseif style == colors.lime then check = 8\
- elseif style == colors.green then check = 10\
- elseif style == colors.cyan then check = 12\
- elseif style == colors.blue then check = 14\
- elseif style == colors.lightBlue then check = 16\
- elseif style == colors.lightGray then check = 18\
- elseif style == colors.purple then check = 20\
- end\
- text(string.char(7),xSize-3,cursor+check)\
- paintutils.drawLine(3,cursor+2,4,cursor+2,colors.red)\
- paintutils.drawLine(3,cursor+4,4,cursor+4,colors.orange)\
- paintutils.drawLine(3,cursor+6,4,cursor+6,colors.yellow)\
- paintutils.drawLine(3,cursor+8,4,cursor+8,colors.lime)\
- paintutils.drawLine(3,cursor+10,4,cursor+10,colors.green)\
- paintutils.drawLine(3,cursor+12,4,cursor+12,colors.cyan)\
- paintutils.drawLine(3,cursor+14,4,cursor+14,colors.blue)\
- paintutils.drawLine(3,cursor+16,4,cursor+16,colors.lightBlue)\
- paintutils.drawLine(3,cursor+18,4,cursor+18,colors.lightGray)\
- paintutils.drawLine(3,cursor+20,4,cursor+20,colors.purple)\
- sysbar.switch(cursor+22,colored,mainSwitchCol)\
- term.setBackgroundColor(colors.white)\
- if wallp then\
- term.setTextColor(colors.red)\
- else\
- term.setTextColor(colors.lightGray)\
- end\
- text(\"Remove Wallpapers\",3,cursor+24)\
- term.redirect(term.native())\
- step = sysbar.scrollBar(13,2.7,posScroll,2)\
- end\
- \
- \
- local running = function()\
- while run and l_login ~= '$test' do\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- if sysbar.back(x,y) or y==1 then\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif sysbar.home(x,y) then\
- home = true \
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif y==cursor+4 then\
- setStyle(colors.red)\
- elseif y==cursor+6 then\
- setStyle(colors.orange)\
- elseif y==cursor+8 then\
- setStyle(colors.yellow)\
- elseif y==cursor+10 then\
- setStyle(colors.lime)\
- elseif y==cursor+12 then\
- setStyle(colors.green)\
- elseif y==cursor+14 then\
- setStyle(colors.cyan)\
- elseif y==cursor+16 then\
- setStyle(colors.blue)\
- elseif y==cursor+18 then\
- setStyle(colors.lightBlue)\
- elseif y==cursor+20 then\
- setStyle(colors.lightGray)\
- elseif y==cursor+22 then\
- setStyle(colors.purple)\
- elseif y==cursor+24 and (colored == 0 or colored == nil) then\
- colored = 1\
- \009redraw()\
- elseif y==cursor+24 and colored == 1 then\
- colored = 0\
- \009redraw()\
- elseif y==cursor+26 and wallp then\
- local but = windows.select({\"Delete\"},{\"Are you sure?\"},{\"Yes\",colors.red,colors.white},{\"No\",colors.gray,colors.white})\
- if but == \"Yes\" then\
- local f=fs.list(\"/system\")\
- for i=0,#f do\
- if f[i] == \"wallp.png\" then\
- shell.run(\"rm /System/wallp.png\")\
- \009 wallp = false\
- \009 break\
- end\
- end\
- redraw()\
- elseif but == \"No\" then redraw()\
- end\
- end\
- redraw()\
- elseif event == \"mouse_scroll\" then\
- if side == 1 then\
- if cursor>(-9) then\
- cursor = cursor-1\
- \009 posScroll = posScroll - step\
- end\
- elseif side == -1 then\
- if cursor<2 then\
- cursor = cursor+1\
- \009 posScroll = posScroll + step\
- end\
- end\
- redraw()\
- end\
- end\
- end\
- \
- clear(colors.white)\
- redraw()\
- parallel.waitForAny(sysBar,running)\
- local conf = fs.open(\"/System/accounts/\"..l_login,\"w\")\
- conf.writeLine('autoPassEnter = '..autoPassEnter..' autoLogin = '..autoLogin..' password = \"'..password..'\"')\
- conf.close()\
- local conf = fs.open(\"/System/accounts/\"..l_login,\"a\")\
- conf.writeLine('style = '..style)\
- conf.writeLine('colored = '..colored)\
- conf.close()",
- path = "//System/prog/style",
- },
- {
- text = "os.loadAPI(\"/System/API/windows\")\
- os.loadAPI(\"/System/API/sysbar\")\
- local run = true\
- local xSize, ySize = term.getSize()\
- local xCenter = math.floor(xSize/2)\
- local yCenter = math.floor(ySize/2)\
- local obj = {}\
- local arg = {...}\
- local cursor = 3 \
- local check = -4\
- local draw = true\
- \
- local clear = function(color)\
- term.setBackgroundColor(color)\
- term.clear()\
- term.setCursorPos(1,1)\
- end\
- \
- local text = function(string,xPos,yPos)\
- term.setCursorPos(xPos,yPos)\
- term.write(string)\
- end\
- \
- local pastebin = function(paste,filename)\
- local file = http.get(\"http://pastebin.com/raw.php?i=\"..paste)\
- if file then\
- file = file.readAll()\
- h=fs.open(filename,\"w\")\
- h.write(file)\
- h.close()\
- else\
- windows.error(\"Unable to connect to the Internet\")\
- end\
- end\
- \
- local sysBar = function()\
- \009while true do\
- \009\009if draw then\
- \009\009\009sysbar.header(\" < Update\",mainTextCol,mainColor)\
- \009\009\009sysbar.draw(colors.white,colors.black,noty,true,false)\
- \009\009end\
- \009\009sleep(1)\
- \009end\
- end\
- \
- local redraw = function()\
- clear(colors.white)\
- term.setTextColor(colors.black)\
- text(\"Your OS version:\",2,6)\
- text(\"Last OS version:\",2,4)\
- if version == lastVer then\
- term.setTextColor(colors.lime)\
- elseif version < lastVer then\
- term.setTextColor(colors.red)\
- elseif version > lastVer then\
- term.setTextColor(colors.lightBlue)\
- end\
- text(version,xSize-#version,6)\
- term.setTextColor(colors.lime)\
- text(lastVer,xSize-#lastVer,4)\
- term.setTextColor(colors.white)\
- term.setBackgroundColor(colors.lime)\
- text(\" Update \",xCenter-3,ySize-3)\
- end\
- \
- \
- local running = function()\
- while run == true and l_login ~= '...' and l_login ~= nil and l_login ~= '' and l_login ~= '$test' do\
- event, side, x, y = os.pullEvent()\
- if event == \"mouse_click\" then\
- draw = false\
- if sysbar.back(x,y) or y==1 then\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif sysbar.home(x,y) then\
- home = true\
- term.clear()\
- term.setCursorPos(1,1)\
- run = false\
- elseif y==ySize-3 then\
- clear(colors.white)\
- pastebin(\"GSn51ZQM\",\"/System/prog/up\")\
- shell.run(\"/System/prog/up\")\
- end\
- draw = true\
- end\
- end\
- end\
- \
- pastebin(\"AH3k8DMa\",\"/ver\")\
- shell.run(\"/ver\")\
- if l_login ~= '...' and l_login ~= nil and l_login ~= '' then\
- \009redraw()\
- \009parallel.waitForAny(sysBar,running)\
- end",
- path = "//System/prog/update",
- },
- {
- text = " 0f 0f 0f 0f\
- 0f>1f_1f 0f\
- 0f 0f 0f 0f",
- path = "//System/prog.png",
- },
- {
- text = " 80-80-80>80\
- <80-80-80 80\
- .80r80o80m80",
- path = "//System/rom.png",
- },
- {
- text = "t80e80x80t80###\
- -80-80-80-80###\
- -80-80-80-80###",
- path = "//System/text.png",
- },
- {
- text = "/f0 f0 f0\\f0\
- f0?f0?f0 f0\
- \\f0 f0 f0/f0",
- path = "//System/unknown.png",
- },
- }
Add Comment
Please, Sign In to add comment