SHOW:
|
|
- or go back to the newest paste.
1 | - | term.setCursorBlink(false) |
1 | + | scr_x, scr_y = term.getSize() |
2 | - | local message = { |
2 | + | midPoint = { |
3 | - | "Welcome", |
3 | + | |
4 | - | "to", |
4 | + | |
5 | - | "LDDestroier's", |
5 | + | |
6 | - | "Personal", |
6 | + | |
7 | - | "Download Site!", |
7 | + | message = { |
8 | "EldidiStroyrr", | |
9 | - | local spinner = { |
9 | + | |
10 | ||
11 | spinSpeed = 1 | |
12 | spinPoint = 1 | |
13 | spinner = { | |
14 | "|", | |
15 | - | local spinPoint = 1 |
15 | + | |
16 | - | local normalColor = colors.gray |
16 | + | |
17 | - | local normalTextColor = colors.white |
17 | + | |
18 | - | local backgroundFlashes = { |
18 | + | |
19 | - | colors.lightGray, |
19 | + | |
20 | - | colors.white, |
20 | + | normalColor = colors.white |
21 | - | colors.black, |
21 | + | normalTextColor = colors.black |
22 | - | colors.white, |
22 | + | |
23 | - | colors.lightGray, |
23 | + | function writeMessages(quick) |
24 | if not quick then | |
25 | - | term.setTextColor(normalTextColor) |
25 | + | totalLength = math.floor(midPoint[1]-(#message[1]/2)) |
26 | - | term.setBackgroundColor(normalColor) |
26 | + | for a = 1, totalLength do |
27 | - | term.clear() |
27 | + | megaBackground(math.floor((a/totalLength)*(midPoint[2]-1))) |
28 | - | local scr_x, scr_y = term.getSize() |
28 | + | |
29 | - | local midPoint = { |
29 | + | |
30 | if spinPoint > #spinner then | |
31 | spinPoint = 1 | |
32 | end | |
33 | - | local spinSpeed = 1 |
33 | + | |
34 | term.setTextColor(normalTextColor) | |
35 | - | local function megaBackground(depth) |
35 | + | |
36 | term.clearLine() | |
37 | write(spinner[spinPoint]) | |
38 | sleep(0) | |
39 | end | |
40 | end | |
41 | end | |
42 | totalLength = 0 | |
43 | progress = 0 | |
44 | for a = 1, #message do | |
45 | totalLength = totalLength + #message[a] | |
46 | end | |
47 | for a = 1, #message do | |
48 | if not quick then | |
49 | for b = 1, #message[a] do | |
50 | progress = progress + 1 | |
51 | -- megaBackground(math.ceil((progress/totalLength)*(midPoint[2]-(#message/2)-1))) | |
52 | term.setBackgroundColor(normalColor) | |
53 | term.setTextColor(colors.orange) | |
54 | term.setCursorPos(midPoint[1]-(#message[a])/2,math.floor(midPoint[2]-(#message/2)+a)) | |
55 | term.clearLine() | |
56 | - | local function writeMessages(quick) |
56 | + | |
57 | term.setBackgroundColor(normalColor) | |
58 | - | for a = 1, math.floor(midPoint[1]-(#message[1]/2)) do |
58 | + | |
59 | for c = 1, spinSpeed do | |
60 | spinPoint = spinPoint + 1 | |
61 | if spinPoint > #spinner then | |
62 | spinPoint = 1 | |
63 | end | |
64 | if b < #message[a] then | |
65 | term.setCursorPos((midPoint[1]-(string.len(message[a])/2))+b,math.floor(midPoint[2]-(#message/2)+a)) | |
66 | write(spinner[spinPoint]) | |
67 | sleep(0) | |
68 | end | |
69 | end | |
70 | end | |
71 | sleep(0.03) | |
72 | else | |
73 | term.setCursorPos(midPoint[1]-(string.len(message[a])/2),math.floor(midPoint[2]-(#message/2)+a)) | |
74 | term.setTextColor(colors.orange) | |
75 | term.setBackgroundColor(normalColor) | |
76 | term.clearLine() | |
77 | write(message[a]) | |
78 | end | |
79 | end | |
80 | - | megaBackground(math.ceil((progress/totalLength)*(midPoint[2]-(#message/2)-1))) |
80 | + | |
81 | ||
82 | function megaBackground(depth) | |
83 | for b = 1, math.ceil(depth) do | |
84 | term.setCursorPos(1,math.ceil(b)) | |
85 | if b == math.ceil(depth) then | |
86 | term.setBackgroundColor(colors.black) | |
87 | else | |
88 | term.setBackgroundColor(colors.blue) | |
89 | end | |
90 | term.clearLine() | |
91 | end | |
92 | for b = 1, math.floor(depth) do | |
93 | term.setCursorPos(1,math.floor(scr_y-(b-1))) | |
94 | if b == math.floor(depth) then | |
95 | term.setBackgroundColor(colors.black) | |
96 | else | |
97 | term.setBackgroundColor(colors.blue) | |
98 | end | |
99 | term.clearLine() | |
100 | end | |
101 | end | |
102 | ||
103 | function flashScreen(flashes) | |
104 | for a = 1, flashes do | |
105 | term.setBackgroundColor(colors.white) | |
106 | term.clear() | |
107 | sleep(0.1) | |
108 | term.setBackgroundColor(colors.black) | |
109 | term.clear() | |
110 | sleep(0.1) | |
111 | - | local function flashScreen() |
111 | + | |
112 | - | for a = 1, 2 do |
112 | + | |
113 | end | |
114 | ||
115 | function closeMegaBackground(depth) | |
116 | for a = 1, depth do | |
117 | megaBackground(a) | |
118 | sleep(0.1) | |
119 | end | |
120 | end | |
121 | ||
122 | function display() | |
123 | - | local function exitAnimation() |
123 | + | flashScreen(2) |
124 | - | term.setBackgroundColor(colors.black) |
124 | + | term.setBackgroundColor(colors.white) |
125 | term.clear() | |
126 | - | exitMessage = "Goodbye!" |
126 | + | writeMessages(false) |
127 | - | for a = 1, midPoint[2]-3 do |
127 | + | |
128 | ||
129 | - | term.setCursorPos(math.floor((scr_x-a)/1.4)+2,midPoint[2]) |
129 | + | display() |
130 | ||
131 | - | write(exitMessage) |
131 | + | sleep(5) |