Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local internet = require("internet")
- local gpu = require("component").gpu
- local unicode = require("unicode")
- local io = require("io")
- local fs = require("filesystem")
- local computer = require("computer")
- local PClose = false
- local version = "AdvancedOS V2.3"
- local function get(URL)
- local req = internet.request(URL)
- local text = ""
- for line in req do
- text = text .. line
- end
- return text
- end
- local function download(paste, path)
- local file, reason = io.open(path, "w")
- if not file then
- error("Failed to open file wor writing: " .. reason)
- end
- file:write(get("https://pastebin.com/raw/" .. paste))
- file:close()
- end
- local local_require = function(name)
- local result, reason = loadfile("/lib/"..name..".lua")
- if result then
- return result()
- else
- return nil, reason
- end
- end
- ss = {
- unicode.char(9474),
- unicode.char(8730),
- unicode.char(9587),
- unicode.char(8681),
- unicode.char(74214)
- }
- ------------------------------------------------
- print("Downloading files links...")
- download("FUFz0Wmg", "/lib/timelessPaths.lua")
- local links = local_require("timelessPaths")
- print("Downloading programs links...")
- download(links.programs, "/lib/files.lua")
- local files = local_require("files")
- print("Downloading ExtraUtilits library...")
- download(links.ExtraUtilits, "/lib/ExtraUtilits.lua")
- fs.makeDirectory("/lib/ExtraUtilitsModules")
- download(links.Modules, "/Modules.lua")
- local modules = loadfile("/Modules.lua")()
- for i = 1, #modules do
- print("Downloading ExtraUtilits modules #" .. tostring(i))
- download(modules[i][1], modules[i][2])
- end
- local EU = local_require("ExtraUtilits")
- print("")
- print("Successful!")
- ------------------------------------------------
- buttons = {}
- y = 21
- for i = 1, #files do
- local function func()
- if files[i].mode then
- buttons[i][6] = 0xff0000
- buttons[i][7] = ss[3]
- files[i].mode = false
- EU.draw(buttons)
- elseif not files[i].mode then
- buttons[i][6] = 0x00ff00
- buttons[i][7] = ss[2]
- files[i].mode = true
- EU.draw(buttons)
- end
- end
- buttons[i] = {61, y, 1, 1, 0x323232, 0x00ff00, ss[2], func, mode = true}
- if not files[i].mode then
- buttons[i][6] = 0xff0000
- buttons[i][7] = ss[3]
- end
- y = y + 1
- end
- local function wind()
- gpu.setBackground(0x323232)
- gpu.fill(60, 20, 40, 20, " ")
- gpu.setForeground(0xff9326)
- gpu.set(160 / 2 - unicode.wlen(version) / 2, 20, version)
- y = 21
- for i = 1, #files do
- gpu.set(62, y, ss[1])
- y = y + 1
- end
- y = 21
- gpu.setForeground(0xffffff)
- for i = 1, #files do
- if files[i].text then
- gpu.set(63, y, files[i].text)
- else
- gpu.set(63, y, files[i][1])
- end
- y = y + 1
- end
- end
- close = function()
- PClose = true
- buttons.close = true
- end
- done = function()
- buttons.close = true
- end
- buttons[#buttons + 1] = {99, 20, 1, 1, 0x323232, 0xff0000, ss[3], close}
- buttons[#buttons + 1] = {99, 39, 1, 1, 0x323232, 0x00ff00, ss[4], done}
- ------------------------------------------------
- local function install()
- gpu.setBackground(0x323232)
- if not PClose then
- for i = 1, #files do
- if files[i].mode then
- gpu.setForeground(0xffffff)
- gpu.set(60, 39, "Installing " .. files[i][1] .. "...")
- x = {}
- if files[i].text then
- x[i] = 63 + unicode.wlen(files[i].text)
- else
- x[i] = 63 + unicode.wlen(files[i][1])
- end
- gpu.setForeground(0x00ff00)
- --if i ~= 1 then gpu.set(x[i - 1], i + 19, " ") end
- gpu.set(x[i], i + 20, ss[5])
- download(files[i][2], files[i][1])
- if files[i].code ~= nil then
- load(files[i].code)()
- end
- os.sleep(1)
- end
- end
- gpu.fill(60, 39, 40, 1, " ")
- end
- end
- ------------------------------------------------
- local function clear()
- fs.remove("/lib/timelessPaths.lua")
- fs.remove("/lib/prog.lua")
- fs.remove("/Modules.lua")
- if PClose then
- fs.remove("/lib/ExtraUtilits.lua")
- else
- for i = 1, #files do
- if files[i].timeless then
- fs.remove(files[i][1])
- end
- end
- computer.shutdown(true)
- end
- end
- ------------------------------------------------
- local function main()
- wind()
- EU.draw(buttons)
- EU.buttonPress(buttons)
- install()
- os.sleep(1)
- end
- ------------------------------------------------
- local function intro()
- local gpu = require("component").gpu
- local EU = require("ExtraUtilits")
- local function body()
- color = 0x000000
- repeat
- gpu.setBackground(color)
- gpu.setForeground(0xffffff - color)
- gpu.fill(68, 22, 24, 5, " ")
- gpu.set(69, 24, "Calhoz Inc Tehnologies")
- gpu.set(68, 26, "2019")
- color = color + 0x111111
- os.sleep(0.1)
- until color == 0xffffff
- os.sleep(1)
- end
- EU.screenBackup(body)
- end
- ------------------------------------------------
- intro()
- EU.screenBackup(main)
- clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement