Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local driveSide
- for _, side in ipairs(rs.getSides()) do
- if peripheral.isPresent(side) and peripheral.getType(side) == "drive" then
- driveSide = side
- break
- end
- end
- apichek = fs.exists("/disk/tom")
- if apichek == false then
- shell.run("pastebin", "get", "nRVEA7zM","/disk/tom")
- shell.run("pastebin", "get", "igXUE29e","/disk/button")
- shell.run("label", "set", driveside, "TomOS Installer")
- shell.run("/disk/installer")
- elseif apichek == true then
- os.loadAPI("/disk/tom")
- os.loadAPI("/disk/button")
- tom.gui()
- tom.header("Do you wish to install TomOS?")
- buty = 6
- button.makeButton(buty, "YES")
- buty = buty + 2
- button.makeButton(buty, "NO")
- local opt = button.selectButton(6,2)
- if opt == 1 then
- tom.gui()
- tom.header("Enter unique label for computer")
- tom.newl("")
- local lab = read()
- shell.run("label", "set", lab)
- tom.gui()
- tom.header("Please create first user:")
- tom.newl("")
- local name = read()
- tom.gui()
- tom.header("Please enter your password:")
- tom.newl("")
- local passwd = read()
- tom.gui()
- tom.header("Generating new user file")
- fs.makeDir("/os/.users")
- fpath = ("/os/.users/" .. name)
- local fuse = fs.open(fpath,"w")
- fuse.write(passwd)
- sleep(1)
- tom.gui()
- tom.header("User file created, installing TomOS")
- fs.makeDir("/os/api")
- fs.copy("/disk/tom", "/os/api/tom")
- fs.copy("/disk/button", "/os/api/button")
- shell.run("pastebin", "get", "6AHrNpfW", "clc")
- shell.run("pastebin", "get", "LjMsFYju", "/os/term")
- shell.run("pastebin", "get", "QjkpmgZD", "/os/.menu")
- shell.run("pastebin", "get", "gJWsdXJq", "startup")
- shell.run("pastebin", "get", "4BwVAH9J", "/os/progms")
- shell.run("pastebin", "get", "nFCN3FjE", "/os/shut")
- shell.run("pastebin", "get", "SfHY9j9i", "back")
- fs.makeDir("prog")
- sleep(2)
- tom.gui()
- tom.header("TomOS installed. Rebooting")
- sleep(3)
- disk.eject(driveside)
- os.reboot()
- elseif opt == 2 then
- tom.centre("Ok, rebooting")
- sleep(1)
- os.reboot()
- end
- end
Add Comment
Please, Sign In to add comment