Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local slowWrite
- local coDone = false
- function resetWrite()
- slowWrite = coroutine.create(function (str, speed, delay)
- for i = 1, #str do
- local index = 1
- if not coDone then
- write(str:sub(i, i))
- coroutine.yield(1/speed)
- end
- end
- return true, delay
- end)
- end
- function blink(speed)
- if not speed then
- speed = .4
- end
- local a,b = term.getCursorPos()
- uWords(" ", a, b, _, colors.lime)
- coroutine.yield(speed)
- uWords(" ", a, b, _, colors.black)
- coroutine.yield(speed)
- term.setCursorPos(a,b)
- end
- local messages = {
- {"WELCOME TO ROBCO INDUSTRIES (TM) TERMLINK", 160, 1},
- {"SET TERMINAL/INQUIRE", 30, .75},
- {"\nRIT-V300", 30, 1},
- {"\nSET FILE/PROTECTION-OWNER:RWED ACCOUNTS.F", 30, 1},
- {"SET HALT RESTART/MAINT", 30, .5},
- {"\nInitializing Robco Industries(TM) MF Boot Agent", 160, .1},
- {"RETROS BIOS", 160, .1},
- {"RBIOS-4.02.08.00 52EE5.E7.E8", 160, .1},
- {"Copyright 2201-2201 Robco Ind.", 160, .1},
- {"Uppermem: 64 KB", 160, .1},
- {"Root (5AB)", 160, .1},
- {"Maintenance Mode", 160, 1},
- {"\nRUN DEBUG/ACCOUNTS.F", 30, 1}
- }
- local cMsg = 1
- local writeTimer, blinkTimer
- function txt()
- term.setCursorBlink(true)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.lime)
- term.clear()
- term.setCursorPos(1, 1)
- resetWrite()
- _, length = coroutine.resume(slowWrite, messages[cMsg][1], messages[cMsg][2], messages[cMsg][3])
- writeTimer = os.startTimer(length)
- while true do
- local events = {os.pullEvent()}
- if events[1] == "timer" then
- if events[2] == writeTimer then
- _, length, delay = coroutine.resume(slowWrite, messages[cMsg][1], messages[cMsg][2], messages[cMsg][3])
- if delay then
- writeTimer = os.startTimer(delay)
- cMsg = cMsg + 1
- if cMsg > #messages then
- sleep(delay)
- break
- end
- resetWrite()
- print()
- else
- writeTimer = os.startTimer(length)
- end
- end
- elseif events[1] == "key" or events[1] == "mouse_click" then
- os.cancelTimer(writeTimer)
- coDone = true
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- break
- end
- end
- end
- txt()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement