QuickMuffin8782-Alt

alt-igp-install

Nov 7th, 2020 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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("Auto install iGP OS Beta to this computer?") then
  27. local dir = http.get("https://gitlab.com/xenussoft-computercraft-organization/igp-os/-/raw/master/installer/dir.lua")
  28. local files = textutils.unserialize(dir)
  29. for a, b in pairs(files) do
  30. autoShell("wget https://gitlab.com/xenussoft-computercraft-organization/igp-os/-/raw/master/" .. b .. " " .. b)
  31. end
  32. else
  33. printError("Canceled installation.")
  34. end
Add Comment
Please, Sign In to add comment