Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Local Variables ]]--
- -- Root Directories & Extentions --
- local Root = ".Network/"
- local iRoot = ".Network/Info/"
- --[[ Functions ]]--
- -- Misc --
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function Reset()
- clear()
- term.setTextColor(colors.red)
- write("Ungarscool1 OS")
- term.setTextColor(colors.yellow)
- printTR("- Installer -")
- term.setTextColor(colors.white)
- printTM("[ Computercraft \nEdition ]")
- w, h = term.getSize()
- print(string.rep("-", w)) write("\n")
- end
- function printTR( text )
- w, h = term.getSize()
- term.setCursorPos(w - #text, 1)
- write(text)
- end
- function printTM( text )
- local w, h = term.getSize()
- term.setCursorPos((w - #text) / 2, 1)
- write(text)
- end
- function printC( text )
- local x, y = term.getSize()
- term.setCursorPos(( x - string.len(text)) / 2, y / 2)
- write( text )
- end
- -- Interface --
- Reset()
- term.setTextColor(colors.yellow)
- print("Setting Up Directories...")
- os.sleep(1)
- fs.makeDir(Root)
- fs.makeDir(iRoot)
- print("Getting Needed Files...")
- Network = http.get("https://www.dropbox.com/s/jb45w1ygprw53ku/ungarscool1os.lua?dl=1")
- Startup = http.get("https://www.dropbox.com/s/5gnh5sc5tupsh91/Startup?dl=1")
- Update = http.get("https://www.dropbox.com/s/zoczv0xvnc7wolb/Update.lua?dl=1")
- f = fs.open("startup", "w")
- f.write(Startup.readAll())
- f.close()
- f = fs.open(Root .. "ungarscool1os.lua", "w")
- f.write(Network.readAll())
- f.close()
- f = fs.open("update", "w")
- f.write(update.readAll())
- f.close()
- term.setTextColor(colors.lime)
- print("\nDone!")
- os.sleep(1)
- Reset()
- print("Ungarscool1 OS Downloaded Successfully!\nEdition: Computercraft")
- term.setTextColor(colors.yellow)
- print("\n(-)Ok")
- term.setTextColor(colors.white)
- repeat
- event, key = os.pullEvent("key")
- os.sleep(0.1)
- until key == 28
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement