Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scr_x, scr_y = term.getSize()
- midPoint = {
- scr_x / 2,
- scr_y / 2,
- }
- message = {
- "EldidiStroyrr",
- }
- spinSpeed = 1
- spinPoint = 1
- spinner = {
- "|",
- "/",
- "-",
- "\\",
- }
- normalColor = colors.white
- normalTextColor = colors.black
- function writeMessages(quick)
- if not quick then
- totalLength = math.floor(midPoint[1]-(#message[1]/2))
- for a = 1, totalLength do
- megaBackground(math.floor((a/totalLength)*(midPoint[2]-1)))
- for c = 1, spinSpeed do
- spinPoint = spinPoint + 1
- if spinPoint > #spinner then
- spinPoint = 1
- end
- term.setCursorPos(a,math.floor(midPoint[2]-(#message/2))+1)
- term.setTextColor(normalTextColor)
- term.setBackgroundColor(normalColor)
- term.clearLine()
- write(spinner[spinPoint])
- sleep(0)
- end
- end
- end
- totalLength = 0
- progress = 0
- for a = 1, #message do
- totalLength = totalLength + #message[a]
- end
- for a = 1, #message do
- if not quick then
- for b = 1, #message[a] do
- progress = progress + 1
- -- megaBackground(math.ceil((progress/totalLength)*(midPoint[2]-(#message/2)-1)))
- term.setBackgroundColor(normalColor)
- term.setTextColor(colors.orange)
- term.setCursorPos(midPoint[1]-(#message[a])/2,math.floor(midPoint[2]-(#message/2)+a))
- term.clearLine()
- write(string.sub(message[a], 1, b))
- term.setBackgroundColor(normalColor)
- term.setTextColor(normalTextColor)
- for c = 1, spinSpeed do
- spinPoint = spinPoint + 1
- if spinPoint > #spinner then
- spinPoint = 1
- end
- if b < #message[a] then
- term.setCursorPos((midPoint[1]-(string.len(message[a])/2))+b,math.floor(midPoint[2]-(#message/2)+a))
- write(spinner[spinPoint])
- sleep(0)
- end
- end
- end
- sleep(0.03)
- else
- term.setCursorPos(midPoint[1]-(string.len(message[a])/2),math.floor(midPoint[2]-(#message/2)+a))
- term.setTextColor(colors.orange)
- term.setBackgroundColor(normalColor)
- term.clearLine()
- write(message[a])
- end
- end
- end
- function megaBackground(depth)
- for b = 1, math.ceil(depth) do
- term.setCursorPos(1,math.ceil(b))
- if b == math.ceil(depth) then
- term.setBackgroundColor(colors.black)
- else
- term.setBackgroundColor(colors.blue)
- end
- term.clearLine()
- end
- for b = 1, math.floor(depth) do
- term.setCursorPos(1,math.floor(scr_y-(b-1)))
- if b == math.floor(depth) then
- term.setBackgroundColor(colors.black)
- else
- term.setBackgroundColor(colors.blue)
- end
- term.clearLine()
- end
- end
- function flashScreen(flashes)
- for a = 1, flashes do
- term.setBackgroundColor(colors.white)
- term.clear()
- sleep(0.1)
- term.setBackgroundColor(colors.black)
- term.clear()
- sleep(0.1)
- end
- return true
- end
- function closeMegaBackground(depth)
- for a = 1, depth do
- megaBackground(a)
- sleep(0.1)
- end
- end
- function display()
- flashScreen(2)
- term.setBackgroundColor(colors.white)
- term.clear()
- writeMessages(false)
- end
- display()
- sleep(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement