summaryrefslogtreecommitdiff
path: root/beescroll.lua
blob: 674288cfebfc24004f8cf0ba686439287f223e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
local m = peripheral.find"monitor"
m.setTextScale(0.5)

local W,H = m.getSize()

local cities = {}
local fp = assert(fs.open("/cities.txt","r"))
repeat
	local line = fp.readLine()
	table.insert(cities,line)
until not line
fp.close()

local verbs = {
	"recovered",
	"extinguished",
	"exsanguinated",
	"defenestrated",
	"obtained",
	"recovered",
	"mistreated",
	"relocated",
	"enraptured",
	"found",
	"seen",
	"heard",
	"devestated",
	"trusted",
	"distrusted",
	"promoted",
	"extended",
	"stretched",
	"squished",
	"moved",
	"rotated",
	"frozen",
	"unfrozen",
	"deployed",
	"redeployed",
	"shaken",
	"stirred",
	"discovered",
	"defeated",
	"thwarted",
	"confounded",
	"separated",
	"dissected",
	"submerged",
	"extracted",
	"zereod",
	"reset",
	"hidden",
	"concealed",
	"remade",
	"detected",
	"skolemized",
	"reinterpreted",
	"unfazed",
}

local function choice(list)
	return list[math.random(#list)]
end

local function slow_write(m,s)
	for i = 1,#s do
		m.write(s:sub(i,i))
		os.sleep(0.1)
	end
end

local function slow_write_f(m, t)
	for _,val in ipairs(t) do
		if type(val) == "string" then
			slow_write(m,val)
		else
			m.setTextColor(val)
		end
	end
end

local function write_f(m,t)
	for _,val in ipairs(t) do
		if type(val) == "string" then
			m.write(val)
		else
			m.setTextColor(val)
		end
	end
end


local norm_color = colors.gray
local function make_entry()
	return {
		choice{colors.yellow, colors.red, colors.cyan},
		string.format("%5d",math.random(0,99999)),
		norm_color, " bees ", choice{"have been ","were "},
		choice{colors.lime, colors.lightBlue, colors.pink},
		choice(verbs),
		norm_color, " in ",
		choice{colors.orange, colors.yellow, colors.purple},
		choice(cities),
		norm_color, "."}
end
for _ = 1,H do
	m.scroll(1)
	m.setCursorPos(1,H)
	write_f(m,make_entry())
end
while true do
	m.scroll(1)
	m.setCursorPos(1,H)
	slow_write_f(m, make_entry())
	os.sleep(math.random(5,100)/10)

end