This commit is contained in:
2026-06-14 02:27:37 +03:00
parent 2ecb2298be
commit 5ef9eb1cb5
4 changed files with 254 additions and 176 deletions
+11 -13
View File
@@ -4,9 +4,7 @@
-- out[3] = display_color → Terminal
-- out[4] = cmd_tx → CMC.in[1] (IN|command)
-- in[1] = user_input ← Terminal
-- in[2] = text_rx ← CMC.out[1] (OUT|text)
-- in[3] = clear_rx ← CMC.out[2] (1 = clear)
-- in[4] = color_rx ← CMC.out[3] (R,G,B)
-- in[2] = cmd_rx ← CMC.out[1] (OUT|text / CLR / COL|R,G,B)
local txActive = false
@@ -23,16 +21,16 @@ function upd()
if inp[2] ~= nil then
local msg = tostring(inp[2])
local _, arg = msg:match("^(%w+)%|(.+)$")
if arg then out[1] = arg end
end
if inp[3] ~= nil and tonumber(inp[3]) == 1 then
out[2] = 1
end
if inp[4] ~= nil then
out[3] = tostring(inp[4])
local pipe = msg:find("|")
local op = pipe and msg:sub(1, pipe - 1) or msg
local arg = pipe and msg:sub(pipe + 1) or nil
if op == "OUT" and arg then
out[1] = arg
elseif op == "CLR" then
out[2] = 1
elseif op == "COL" and arg then
out[3] = arg
end
end
table.clear(inp)