QuickMuffin8782-Alt

Untitled

Oct 26th, 2020 (edited)
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function autoShell(cmd)
  2. term.setTextColor(colors.yellow)
  3. write("> ")
  4. term.setTextColor(colors.white)
  5. textutils.slowWrite(cmd, 50)
  6. shell.run(cmd)
  7. end
  8.  
  9. function ask(msg)
  10. local x, y = term.getCursorPos()
  11. while true do
  12. term.setCursorPos(1, y)
  13. term.clearLine()
  14. write(msg .. ": ")
  15. local out = read(nil)
  16. if out:len() == 1 then
  17. if out == "y" then
  18. return true
  19. elseif out == "n" then
  20. return false
  21. end
  22. end
  23. end
  24. end
  25.  
  26. if ask("Are you sure you want to install MBS?") then
  27. autoShell("wget https://raw.githubusercontent.com/SquidDev-CC/mbs/master/mbs.lua mbs")
  28. autoShell("mbs download")
  29. print("MBS is installed.")
  30. else
  31. printError("Canceled installation.")
  32. end
Add Comment
Please, Sign In to add comment