Advertisement
ComputerMan123

TextUI Setup

Nov 26th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. local files = {
  2. [1] = {
  3. "bios",
  4. "https://raw.githubusercontent.com/CoolMan119/TextUI/master/bios.lua"
  5. },
  6. [2] = {
  7. "startup",
  8. "https://raw.githubusercontent.com/CoolMan119/TextUI/master/startup"
  9. },
  10. [3] = {
  11. "/textui/apis/component",
  12. "https://raw.githubusercontent.com/CoolMan119/TextUI/master/textui/apis/component.lua"
  13. },
  14. [4] = {
  15. "/textui/apis/cpu",
  16. "https://raw.githubusercontent.com/CoolMan119/TextUI/master/textui/apis/cpu.lua"
  17. },
  18. [5] = {
  19. "/textui/apis/gpu",
  20. "https://raw.githubusercontent.com/CoolMan119/TextUI/master/textui/apis/gpu.lua"
  21. },
  22. [6] = {
  23. "/textui/programs/shell",
  24. "https://raw.githubusercontent.com/CoolMan119/TextUI/master/textui/programs/shell.lua"
  25. }
  26. }
  27.  
  28. term.clear()
  29. term.setCursorPos(1,1)
  30. print("Welcome to TextUI!")
  31. print("A fast, easy, and secure OS")
  32. print()
  33. write("Install? (Y/N): ")
  34. result = read()
  35. if result == "y" or result == "Y" then
  36. term.clear()
  37. term.setCursorPos(1,1)
  38. print("Installing TextUI...")
  39. for k,v in pairs(files) do
  40. print(v[1])
  41. local req = http.get(v[2])
  42. file = fs.open(v[1], "w")
  43. file.write(req.readAll())
  44. file.close()
  45. end
  46. print("Sucessfully installed TextUI!")
  47. os.sleep(1)
  48. os.reboot()
  49. elseif result == "n" or result == "N" then
  50. os.queueEvent("terminate")
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement