From cba57081c790ca95b1390d04b1df86399ec3b79f Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 2 Apr 2024 03:10:15 +0100 Subject: launch beescroll --- beescroll.lua | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'beescroll.lua') diff --git a/beescroll.lua b/beescroll.lua index 547aa11..674288c 100644 --- a/beescroll.lua +++ b/beescroll.lua @@ -79,13 +79,20 @@ local function slow_write_f(m, t) end end -local norm_color = colors.gray +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 -while true do - local x = math.random(0,99999) - m.scroll(1) - m.setCursorPos(1,H) - slow_write_f(m, { + +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 "}, @@ -94,7 +101,17 @@ while true do norm_color, " in ", choice{colors.orange, colors.yellow, colors.purple}, choice(cities), - norm_color, "."}) - os.sleep(1) + 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 -- cgit v1.2.3