local m = peripheral.find"monitor" m.setTextScale(0.5) local W,H = m.getSize() local function read_lines(fname) local out = {} local fp = assert(fs.open(fname,"r")) repeat local line = fp.readLine() table.insert(out, line) until not line fp.close() return out end local cities = read_lines("/cities.txt") local verbs = read_lines("/verbs.txt") 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