From 23c19dd66eeb5d636365d10c58dfbd5ec22f944a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 2 Apr 2024 03:02:29 +0100 Subject: launch beescroll --- beescroll.lua | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'beescroll.lua') diff --git a/beescroll.lua b/beescroll.lua index aca7916..8257081 100644 --- a/beescroll.lua +++ b/beescroll.lua @@ -69,13 +69,28 @@ local function slow_write(m,s) 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(m, ("%5d bees have been %s in %s."):format( - x, choice(verbs), choice(cities) - )) + 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 -- cgit v1.2.3