-- ARASAKA FLASH AD — MIT BLOCKBUCHSTABEN, MULTICOLOR & LOOP -- Für Rezeption: hypnotisch, intensiv, unübersehbar if not peripheral then error("API 'peripheral' benötigt.") end local monitor = peripheral.find("monitor") or peripheral.find("advanced_monitor") if not monitor then error("Kein Monitor gefunden!") end local m = monitor local w, h = m.getSize() local setCursorPos = m.setCursorPos local setTextColor = m.setTextColor local setBackgroundColor = m.setBackgroundColor local write = m.write local clear = m.clear local isColor = m.isColor and m.isColor() -- Farben (mit Fallback für BW-Monitore) local function getColor(name) if not isColor then return colors.black end local map = { red = colors.red, cyan = colors.cyan, yellow = colors.yellow, magenta = colors.magenta, orange = colors.orange, green = colors.lime, blue = colors.blue } return map[name] or colors.white end local BG = isColor and colors.black or colors.white -- ========== BLOCKSCHRIFT ========== local FONT = { A = { " AAA ", "A A", "AAAAA", "A A", "A A" }, R = { "RRRR ", "R R", "RRRR ", "R R ", "R R" }, S = { " SSSS", "S ", " SSS ", " S", "SSSS " }, K = { "K K", "K K ", "KKK ", "K K ", "K K" } } -- Farben pro Buchstabe local COLOR_MAP = { A = getColor("red"), R = getColor("cyan"), S = getColor("yellow"), K = getColor("magenta") } -- ========== HILFSFUNKTIONEN ========== local function safeWrite(x, y, text) if x < 1 or y < 1 or y > h then return end for i = 1, #text do local cx = x + i - 1 if cx <= w then setCursorPos(cx, y) write(text:sub(i, i)) end end end local function drawLetter(letter, color, offsetX, offsetY) local lines = FONT[letter] or FONT.A setBackgroundColor(BG) setTextColor(color) for dy = 1, #lines do safeWrite(offsetX, offsetY + dy - 1, lines[dy]) end end local function drawWord(word, offsetX, offsetY) setBackgroundColor(BG) for i = 1, #word do local ch = word:sub(i, i) local color = COLOR_MAP[ch] or getColor("white") setTextColor(color) -- Einfach zentriert als Einzelbuchstaben (wie im Flash) local x = offsetX + (i - 1) * 6 safeWrite(x, offsetY, ch) end end local function fillScreen(color) setBackgroundColor(color) for y = 1, h do setCursorPos(1, y) write((" "):rep(w)) end end -- ========== MAIN LOOP ========== local TEXT = "ARASAKA" local LIGHT_BG = isColor and colors.white or colors.black while true do -- Jeden Buchstaben flashen for i = 1, #TEXT do local char = TEXT:sub(i, i) local color = COLOR_MAP[char] or getColor("white") -- 1. Heller Blitz fillScreen(LIGHT_BG) os.sleep(0.12) -- 2. Dunkel fillScreen(BG) os.sleep(0.05) -- 3. Großen Buchstaben anzeigen fillScreen(BG) local letterLines = FONT[char] or FONT.A local letterWidth = #letterLines[1] local letterHeight = #letterLines local x = math.max(1, math.floor((w - letterWidth) / 2)) local y = math.max(1, math.floor((h - letterHeight) / 2)) drawLetter(char, color, x, y) os.sleep(0.25) end -- Finale: Ganzes Wort in Multicolor fillScreen(BG) local wordWidth = #TEXT * 6 - 1 local startX = math.max(1, math.floor((w - wordWidth) / 2)) local startY = math.max(1, math.floor(h / 2)) drawWord(TEXT, startX, startY) os.sleep(1.8) -- Pause vor Neustart end