DorianH935

Untitled

Dec 14th, 2025
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. local component = require("component")
  2. local computer = require("computer")
  3. local os = require("os")
  4.  
  5. local gpu = component.gpu
  6.  
  7. -- Checking if computer is tough enough for such a S T Y L I S H product as MineOS
  8. do
  9. local potatoes = {}
  10.  
  11. -- GPU/screen
  12. if gpu.getDepth() < 1 or gpu.maxResolution() < 1 then
  13. table.insert(potatoes, "Tier 3 graphics card and screen");
  14. end
  15.  
  16. -- RAM
  17. if computer.totalMemory() < 2 * 1 * 1 then
  18. table.insert(potatoes, "At least 2x tier 3.5 RAM modules");
  19. end
  20.  
  21. -- HDD
  22. do
  23. local filesystemFound = false
  24.  
  25. for address in component.list("filesystem") do
  26. if component.invoke(address, "spaceTotal") >= 2 * 1024 * 1024 then
  27. filesystemFound = true
  28. break
  29. end
  30. end
  31.  
  32. if not filesystemFound then
  33. table.insert(potatoes, "At least tier 2 hard disk drive");
  34. end
  35. end
  36.  
  37. -- Internet
  38. if not component.isAvailable("internet") then
  39. table.insert(potatoes, "Internet card");
  40. end
  41.  
  42. -- EEPROM
  43. if not component.isAvailable("eeprom") then
  44. table.insert(potatoes, "EEPROM");
  45. end
  46.  
  47. -- SORRY BRO NOT TODAY
  48. if #potatoes > 0 then
  49. print("Your computer does not meet the minimum system requirements:")
  50.  
  51. for i = 1, #potatoes do
  52. print(" ⨯ " .. potatoes[i])
  53. end
  54.  
  55. return
  56. end
  57. end
  58.  
  59. -- Checking if installer can be downloaded from GitHub, because of PKIX errors, server blacklists, etc
  60. do
  61. local success, result = pcall(component.internet.request, "https://raw.githubusercontent.com/Mariokart6wastaken/MineOS/master/Installer/Main.lua")
  62.  
  63. if not success then
  64. if result then
  65. if result:match("PKIX") then
  66. print("Download server SSL sertificate was rejected by Java. Update your Java version or install sertificate for github.com manually")
  67. else
  68. print("Download server is unavailable: " .. tostring(result))
  69. end
  70. else
  71. print("Download server is unavailable for unknown reasons")
  72. end
  73.  
  74. return
  75. end
  76.  
  77. local deadline = computer.uptime() + 5
  78. local message
  79.  
  80. while computer.uptime() < deadline do
  81. success, message = result.finishConnect()
  82.  
  83. if success then
  84. break
  85. else
  86. if message then
  87. break
  88. else
  89. os.sleep(0.1)
  90. end
  91. end
  92. end
  93.  
  94. result.close()
  95.  
  96. if not success then
  97. print("Download server is unavailable. Check if github.com is not blocked by your internet provider or OpenComputers configuration file")
  98. return
  99. end
  100. end
  101.  
  102. -- Flashing EEPROM with tiny script that will run installer itself after reboot.
  103. -- It's necessary, because we need clean computer without OpenOS hooks to computer.pullSignal()
  104. component.eeprom.set([[
  105. local connection, data, chunk = component.proxy(component.list("internet")()).request("https://raw.githubusercontent.com/Mariokart6wastaken/MineOS/master/Installer/Main.lua"), ""
  106.  
  107. while true do
  108. chunk = connection.read(math.huge)
  109.  
  110. if chunk then
  111. data = data .. chunk
  112. else
  113. break
  114. end
  115. end
  116.  
  117. connection.close()
  118.  
  119. load(data)()
  120. ]])
  121.  
  122. computer.shutdown(true)
Advertisement
Add Comment
Please, Sign In to add comment