GLaDOS446

OC STARTUP

Jun 26th, 2026 (edited)
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.71 KB | Source Code | 0 0
  1. local component = require("component")
  2. local gpu = component.gpu
  3. local shell = require("shell")
  4. local os = require("os")
  5.  
  6. -- ============================================================
  7. -- KONFIGURATION
  8. -- ============================================================
  9. -- Welches Programm soll NACH der Animation starten?
  10. local NEXT_PROGRAM = "/home/REACTOR-CONTROL.lua"
  11.  
  12. -- Gesamtdauer der Hauptanimation (Rest für den coolen Launch-Effekt)
  13. local MAIN_DURATION = 56
  14. -- ============================================================
  15.  
  16. local w, h = gpu.getResolution()
  17. local logs = {}
  18. local max_logs = h - 5
  19. local time_elapsed = 0
  20.  
  21. -- Funktion zum zentrierten Zeichnen
  22. local function drawCentered(y, text, color)
  23. if color then gpu.setForeground(color) end
  24. if #text > w then text = string.sub(text, 1, w) end
  25. local x = math.floor((w - #text) / 2) + 1
  26. gpu.set(x, y, text)
  27. end
  28.  
  29. -- Linux-Style Zeilen-Renderer (Färbt [ OK ], [ INFO ], etc.)
  30. local function drawLogLine(x, y, line)
  31. if #line > (w - x) then
  32. line = string.sub(line, 1, w - x - 3) .. "..."
  33. end
  34.  
  35. local prefix = string.sub(line, 1, 8)
  36. if prefix == "[ OK ]" then
  37. gpu.setForeground(0x55FF55) -- Hellgrün
  38. gpu.set(x, y, "[ OK ]")
  39. gpu.setForeground(0xDDDDDD)
  40. gpu.set(x + 9, y, string.sub(line, 9))
  41. elseif prefix == "[ INFO ]" then
  42. gpu.setForeground(0x55FFFF) -- Cyan
  43. gpu.set(x, y, "[ INFO ]")
  44. gpu.setForeground(0xDDDDDD)
  45. gpu.set(x + 9, y, string.sub(line, 9))
  46. elseif prefix == "[ SCAN ]" then
  47. gpu.setForeground(0xFFFF55) -- Gelb
  48. gpu.set(x, y, "[ SCAN ]")
  49. gpu.setForeground(0xDDDDDD)
  50. gpu.set(x + 9, y, string.sub(line, 9))
  51. elseif string.sub(line, 1, 2) == "::" then
  52. gpu.setForeground(0xFF55FF) -- Magenta für Hauptphasen
  53. gpu.set(x, y, line)
  54. else
  55. gpu.setForeground(0xAAAAAA) -- Standard-Grau
  56. gpu.set(x, y, line)
  57. end
  58. end
  59.  
  60. -- Hilfsfunktion zum Zeichnen des Bildschirms (Logs + Progress)
  61. local function refreshScreen()
  62. gpu.fill(1, 1, w, h, " ")
  63. drawCentered(1, "--- OpenOS Advanced Linux-Kernel v5.10-Secure ---", 0x888888)
  64.  
  65. local log_y = 3
  66. for j = math.max(1, #logs - max_logs + 1), #logs do
  67. if log_y < h - 2 then
  68. drawLogLine(2, log_y, logs[j])
  69. log_y = log_y + 1
  70. end
  71. end
  72.  
  73. -- Fortschrittsbalken (Berechnet auf Basis von 120 Sek Gesamtlaufzeit)
  74. local percent = math.floor((time_elapsed / 120) * 100)
  75. if percent > 94 then percent = 94 end -- Deckel für die Log-Phasen
  76.  
  77. local bar_width = math.floor(w * 0.8)
  78. if bar_width < 10 then bar_width = w - 2 end
  79. local bar_x = math.floor((w - bar_width) / 2) + 1
  80. local filled = math.floor((percent / 100) * (bar_width - 2))
  81. local bar_str = "[" .. string.rep("#", filled) .. string.rep(" ", (bar_width - 2) - filled) .. "]"
  82.  
  83. gpu.setForeground(0x888888)
  84. gpu.set(bar_x, h, "BOOT: " .. percent .. "% " .. bar_str)
  85. end
  86.  
  87. -- Echte Hardware einlesen
  88. local real_components = {}
  89. for addr, name in component.list() do
  90. table.insert(real_components, {name = name:upper(), addr = string.sub(addr, 1, 4)})
  91. end
  92. local total_comps = #real_components
  93. local comp_index = 1
  94.  
  95. gpu.setBackground(0x000000)
  96.  
  97. -- ============================================================
  98. -- LANGSAME PHASEN 1-3 (Sekunde 1 bis 83 - Takt: 1.0 Sekunde)
  99. -- ============================================================
  100. for i = 1, 83 do
  101. time_elapsed = i
  102.  
  103. -- PHASE 1: UPDATE CHECK
  104. if i == 1 then table.insert(logs, ":: Phase 1: Remote Update Verification...") end
  105. if i == 3 then table.insert(logs, "[ INFO ] Initializing network interfaces (eth0)...") end
  106. if i == 5 then table.insert(logs, "[ INFO ] Requesting DHCP broadcast lease...") end
  107. if i == 8 then table.insert(logs, "[ OK ] Assigned IP 192.168.1.104 on eth0") end
  108. if i == 12 then table.insert(logs, "[ INFO ] Connecting to update.openos.org:443...") end
  109. if i == 16 then table.insert(logs, "[ OK ] Manifest signature verified (RSA-4096).") end
  110. if i == 20 then table.insert(logs, "[ OK ] Component firmware 'opensecurity' is up to date.") end
  111.  
  112. -- PHASE 2: HARDWARE SCAN
  113. if i == 25 then table.insert(logs, ":: Phase 2: Probing Component Hardware Bus...") end
  114. if i >= 28 and i <= 55 and comp_index <= total_comps then
  115. local step = math.floor((55 - 28) / total_comps)
  116. if step < 1 then step = 1 end
  117. if (i - 28) % step == 0 and comp_index <= total_comps then
  118. local c = real_components[comp_index]
  119. table.insert(logs, string.format("[ OK ] Found device: %s [ID: %s]", c.name, c.addr))
  120. comp_index = comp_index + 1
  121. end
  122. end
  123. if i == 58 then table.insert(logs, "[ OK ] Hardware bus scan finished. Devices locked.") end
  124.  
  125. -- PHASE 3: VIRENCHECK
  126. if i == 62 then table.insert(logs, ":: Phase 3: Launching System Integrity & Malware Scan...") end
  127. if i == 65 then table.insert(logs, "[ SCAN ] Checking core directories for modifications...") end
  128. if i == 68 then table.insert(logs, "[ SCAN ] /bin/checksums ... SECURE") end
  129. if i == 72 then table.insert(logs, "[ SCAN ] /lib/modules ... SECURE") end
  130. if i == 76 then table.insert(logs, "[ SCAN ] /boot/eeprom.bin ... SIGNATURE OK") end
  131. if i == 80 then table.insert(logs, "[ INFO ] Anti-Malware Database Version: 2026.06.08") end
  132. if i == 82 then table.insert(logs, "[ OK ] Integrity Check: 0 Threats detected.") end
  133.  
  134. refreshScreen()
  135. os.sleep(1.0)
  136. end
  137.  
  138. -- ============================================================
  139. -- HYPER-SPEED PHASE 4: LINUX SERVICES (Dauer: 30 Sek - Takt: 0.1 Sek)
  140. -- ============================================================
  141. table.insert(logs, ":: Phase 4: Initializing Linux System Services (Hyper-Drive)...")
  142.  
  143. local fast_services = {
  144. "Systemd-Journald", "Kernel-Variables", "Security-Framework", "Network-Time-Sync",
  145. "Crypto-Accelerator", "RFID-Driver-Stack", "Biometric-Handlers", "Perimeter-Sensors",
  146. "Maglock-Bridges", "Hardware-RNG", "Thermal-Monitor", "Motion-Detectors",
  147. "Keypad-Matrix", "Sound-Mixer", "Virtual-Terminal-1", "Virtual-Terminal-2",
  148. "Storage-Optimization", "OpenSecurity-Core", "Card-Reader-Bus", "Alarm-Siren-Daemon",
  149. "Laser-Grid-Controller", "DNA-Sequencer-Link", "Retina-Scanner-Sync", "Door-Lock-Registry",
  150. "Event-Logger-Service", "TTY-Listener", "IPC-Message-Bus", "User-Runtime-Directory",
  151. "System-D-Bus", "Policy-Kit-Daemon", "Cron-Scheduler", "Audit-Daemon", "AppArmor-Profiles"
  152. }
  153.  
  154. -- 30 Sekunden bei 0.1s Taktung = Genau 300 schnelle Textzeilen!
  155. for step = 1, 300 do
  156. time_elapsed = 83 + (step * 0.1)
  157.  
  158. -- Alle 8 Ticks einen neuen Hauptdienst durchwechseln, dazwischen Unter-Prozesse simulieren
  159. local svc_idx = math.floor((step - 1) / 8) + 1
  160. local sub_step = (step - 1) % 8
  161. local svc_name = fast_services[svc_idx] or "Security-Module-Extension-" .. step
  162.  
  163. if sub_step == 0 then
  164. table.insert(logs, "[ INFO ] Activating " .. svc_name .. " Subsystem...")
  165. elseif sub_step == 2 then
  166. table.insert(logs, "[ SCAN ] Verifying integrity signatures for " .. svc_name .. "...")
  167. elseif sub_step == 4 then
  168. table.insert(logs, "[ OK ] Allocated secured memory blocks for " .. svc_name .. ".")
  169. elseif sub_step == 6 then
  170. table.insert(logs, "[ OK ] Registered core environment hooks for " .. svc_name .. ".")
  171. elseif sub_step == 7 then
  172. table.insert(logs, "[ OK ] Started " .. svc_name .. ".")
  173. end
  174.  
  175. refreshScreen()
  176. os.sleep(0.1)
  177. end
  178.  
  179. -- ============================================================
  180. -- NEU: PHASE 4.5 - BETRIEBSSYSTEM ERFOLGREICH GESTARTET (2 Sekunden)
  181. -- ============================================================
  182. gpu.fill(1, 1, w, h, " ")
  183. local mid_y = math.floor(h / 2)
  184.  
  185. -- Edler, zentrierter Status-Bildschirm
  186. drawCentered(mid_y - 2, "========================================", 0x00FF00)
  187. drawCentered(mid_y - 1, " STATUS: SYSTEM BOOT COMPLETE", 0x00FF00)
  188. drawCentered(mid_y, "========================================", 0x00FF00)
  189. drawCentered(mid_y + 2, "OpenOS Kernel v5.10-Secure fully loaded.", 0xAAAAAA)
  190. drawCentered(mid_y + 3, "All security sandboxes are operational.", 0xAAAAAA)
  191.  
  192. os.sleep(2.0) -- Exakt 2 Sekunden Haltezeit
  193.  
  194. -- ============================================================
  195. -- PHASE 5: COOL LAUNCH EFFEKT (Exakt 5 Sekunden)
  196. -- ============================================================
  197. gpu.fill(1, 1, w, h, " ")
  198.  
  199. local box_w = math.min(w - 2, 38)
  200. local box_h = 5
  201. if box_w < 15 then box_w = w end
  202. local box_x = math.floor((w - box_w) / 2) + 1
  203. local box_y = math.floor((h - box_h) / 2) + 1
  204.  
  205. -- Neon-Cyan farbene Box
  206. gpu.setForeground(0x00FFFF)
  207. gpu.set(box_x, box_y, "+" .. string.rep("-", box_w - 2) .. "+")
  208. for ey = 1, box_h - 2 do
  209. gpu.set(box_x, box_y + ey, "|")
  210. gpu.set(box_x + box_w - 1, box_y + ey, "|")
  211. end
  212. gpu.set(box_x, box_y + box_h - 1, "+" .. string.rep("-", box_w - 2) .. "+")
  213.  
  214. local prog_display = NEXT_PROGRAM
  215. if #prog_display > box_w - 4 then
  216. prog_display = "..." .. string.sub(NEXT_PROGRAM, #NEXT_PROGRAM - (box_w - 8))
  217. end
  218.  
  219. -- 5-Sekunden-Blinkschleife (5 Durchgänge à genau 1 Sekunde)
  220. for flash = 1, 5 do
  221. drawCentered(box_y + 1, "EXECUTE PROGRAM:", 0x00FFFF)
  222. drawCentered(box_y + 2, "> " .. prog_display .. " <", 0xFFFFFF)
  223. os.sleep(0.7)
  224.  
  225. gpu.set(box_x + 1, box_y + 1, string.rep(" ", box_w - 2))
  226. gpu.set(box_x + 1, box_y + 2, string.rep(" ", box_w - 2))
  227. os.sleep(0.3)
  228. end
  229.  
  230. -- Bildschirm leeren und Übergabe
  231. gpu.setBackground(0x000000)
  232. gpu.setForeground(0xFFFFFF)
  233. gpu.fill(1, 1, w, h, " ")
  234.  
  235. shell.execute(NEXT_PROGRAM)
Advertisement
Add Comment
Please, Sign In to add comment