Advertisement
HappySunChild

.boot without moderation?

Oct 13th, 2022
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. local args = { ... }
  2.  
  3. local method = args[1]
  4.  
  5. local w, h = term.getSize()
  6.  
  7. local function printCenter(y, text, slow)
  8.     if not slow then
  9.         term.setCursorPos(math.floor((w - string.len(text)) / 2), y)
  10.         term.write(text)
  11.     else
  12.         term.setCursorPos(math.floor((w - string.len(text)) / 2), y)
  13.         textutils.slowPrint(text, 7)
  14.     end
  15. end
  16.  
  17. local function install()
  18.     fs.makeDir("os")
  19.     fs.makeDir("os/programs")
  20.  
  21.     local basePrograms = {
  22.  
  23.     }
  24.  
  25.     for program, pastecode in pairs(basePrograms) do
  26.         shell.run(string.format("wget https://pastebin.com/raw/%s %s", pastecode, program))
  27.     end
  28. end
  29.  
  30. if method == nil then
  31.     if not fs.exists("os") then
  32.         install()
  33.  
  34.         fs.move(".boot", "os/.boot")
  35.     end
  36.  
  37.     term.clear()
  38.     term.setCursorPos(1, 1)
  39.  
  40.     printCenter(2, "Loading SPHERE-OS")
  41.     printCenter(3, "--------")
  42.     sleep(0.1)
  43.     printCenter(3, "########", true)
  44.  
  45.     shell.run(".main")
  46. elseif method == "update" then
  47.     fs.delete("os")
  48.  
  49.     install()
  50. end
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement