Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w, h = term.getSize()
- local fwrite = function(path, text)
- local file = assert(io.open(path, "w"))
- file:write(text)
- file:close()
- end
- local folders = {
- "System";
- "Programs";
- "APIs";
- "Documents";
- "System/Images";
- "System/Images/Icons";
- ".firstTime";
- "Documents/Pictures";
- "Documents/Downloads";
- "Documents/Pictures/Wallpapers";
- "Documents/Projects";
- }
- local files = {
- "APIs/fLib";
- "desktop";
- "conf";
- "startup";
- "/Programs/LuaIDE";
- "/System/crash";
- "FileBrowser";
- "task";
- ".first";
- "/System/kernel";
- "version";
- "desktop.cfg";
- "settings.cfg";
- }
- local URLs = {
- "http://pastebin.com/raw.php?i=kLRPGier";
- "http://pastebin.com/raw.php?i=Xt6XC1J6";
- "http://pastebin.com/raw.php?i=hrbrU8LD";
- "http://pastebin.com/raw.php?i=ht1xnfV7";
- "http://pastebin.com/raw.php?i=kGQZ95se";
- "http://pastebin.com/raw.php?i=8WqUjs6m";
- "http://pastebin.com/raw.php?i=9MR8HHBR";
- "http://pastebin.com/raw.php?i=vJbDHVMu";
- "http://pastebin.com/raw.php?i=mL9aB25F";
- "http://pastebin.com/raw.php?i=WgrW0t5v";
- "http://pastebin.com/raw.php?i=PzTHYtEX";
- "http://pastebin.com/raw.php?i=rjqBiQrN";
- "http://pastebin.com/raw.php?i=tZBEW7fY";
- }
- local draw = function()
- term.setBackgroundColour(colors.white)
- term.clear()
- term.setTextColour(colors.blue)
- term.setCursorPos(math.floor(w-#"Installing TimeOS")/2,math.floor(h)/2-2)
- write("Installing TimeOS")
- term.setCursorPos(math.floor(w-#"Please wait...")/2,math.floor(h)/2)
- write("Please wait...")
- end
- draw()
- for i,v in pairs(folders) do
- if fs.exists(v) then
- fs.delete(v)
- end
- end
- for i,v in pairs(files) do
- if fs.exists(v) then
- fs.delete(v)
- end
- end
- for i,v in pairs(folders) do
- if not fs.exists(v) then
- fs.makeDir(v)
- end
- end
- for i,v in pairs(files) do
- download = http.get(URLs[i])
- fwrite(v, download.readAll())
- end
- os.loadAPI ("APIs/fLib")
- term.setBackgroundColor (colors.white)
- term.setTextColor (colors.blue)
- term.clear()
- term.setBackgroundColor (colors.gray)
- term.setCursorPos (1,1)
- term.clearLine()
- term.setBackgroundColor (colors.white)
- term.setCursorPos (1,2)
- print ("Enter an Username:")
- term.setCursorPos (1,3)
- input = read()
- fLib.replaceLine ("/conf", 1, input)
- term.setCursorPos (1,5)
- print ("Enter a password:")
- term.setCursorPos (1,6)
- passinput = read("*")
- fLib.replaceLine ("/conf", 2, passinput)
- sleep (2)
- term.clear()
- term.setBackgroundColour(colors.white)
- term.clear()
- term.setTextColour(colors.blue)
- term.setCursorPos(math.floor(w-#"Installation complete!")/2,math.floor(h)/2-2)
- write("Installation complete!")
- term.setCursorPos(math.floor(w-#"Rebooting in 1 second...")/2,math.floor(h)/2)
- write("Rebooting in 1 second...")
- sleep (1)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement