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("Are you sure you want to install MBS?") then
- autoShell("wget https://raw.githubusercontent.com/SquidDev-CC/mbs/master/mbs.lua mbs")
- autoShell("mbs download")
- print("MBS is installed.")
- else
- printError("Canceled installation.")
- end
Add Comment
Please, Sign In to add comment