summaryrefslogtreecommitdiff
path: root/beescroll.lua
blob: 8257081ddf2c58287f749c6cd0ffa9742dc92dd6 (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
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 norm_color = colors.gray

while true do
	local x = math.random(0,99999)
	m.scroll(1)
	m.setCursorPos(1,H)
	slow_write_f(mon, {
		colors.white, string.format("%5d",math.random(0,99999)),
		norm_color, " bees ", choice{"have been ","were "},
		colors.lime, choice(verbs),
		norm_color, " in ", colors.lightBlue, choice(cities),
		norm_color, "."})
	os.sleep(1)

end