Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function autoShell(cmd)
- term.setTextColor(colors.yellow)
- write("> ")
- term.setTextColor(colors.white)
- textutils.slowWrite(cmd, 50)
- shell.run(cmd)
- end
- function ask(msg)
- local x, y = term.getCursorPos()
- while true do
- term.setCursorPos(1, y)
- term.clearLine()
- write(msg .. " ")
- local out = read(nil)
- if out:len() == 1 then
- if out == "y" then
- return true
- elseif out == "n" then
- return false
- end
- end
- end
- end
- if ask("Auto install iGP OS Beta to this computer?") then
- local dir = http.get("https://gitlab.com/xenussoft-computercraft-organization/igp-os/-/raw/master/installer/dir.lua")
- local files = textutils.unserialize(dir)
- for a, b in pairs(files) do
- autoShell("wget https://gitlab.com/xenussoft-computercraft-organization/igp-os/-/raw/master/" .. b .. " " .. b)
- end
- else
- printError("Canceled installation.")
- end
Add Comment
Please, Sign In to add comment