diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-02 03:10:15 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-02 03:10:15 +0100 |
commit | cba57081c790ca95b1390d04b1df86399ec3b79f (patch) | |
tree | 0eaa952329988b62833e19b8b78170ae1230685b | |
parent | 28559e85b7863458529d527c1e3ea3c1b81177ce (diff) |
launch beescroll
-rw-r--r-- | beescroll.lua | 33 |
1 files changed, 25 insertions, 8 deletions
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 |