From 34b82abdabbe92aab5a1bcfb450e2f52c983c756 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 5 Aug 2022 23:36:41 +0100 Subject: vlorb --- img/better_disp.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'img') diff --git a/img/better_disp.lua b/img/better_disp.lua index 33c4104..dbf52e9 100644 --- a/img/better_disp.lua +++ b/img/better_disp.lua @@ -20,4 +20,20 @@ local function vlorb(onc,offc, g1,g2,g3,g4,g5,g6) return textc,bgc,string.char(vlorbchar) end -return {vlorb=vlorb} +local function test() + term.clear() + local gs = {false,false,false,false,false,false} + while true do + term.setCursorPos(1,1) + local tc,bgc,char = vlorb(colors.red,colors.black, table.unpack(gs)) + term.setTextColor(tc) + term.setBackgroundColor(bgc) + term.write(char) + local _,key = os.pullEvent"key" + if 65<=key and key<=70 then + local idx = key-64 + gs[idx] = not gs[idx] + end + end + +return {vlorb=vlorb,test=test} -- cgit v1.2.3