added escape sequences to arbitrary strings; reworked callback system

This commit is contained in:
Redo
2019-04-12 23:58:04 -05:00
parent d47e6a50dc
commit 518deaca68
4 changed files with 190 additions and 152 deletions

View File

@ -1,11 +1,11 @@
return function(gate, argv)
if #argv == 1 then
gate.ports[1]:setstate(toboolean(argv[1]))
gate.ports[2]:setstate(toboolean(argv[1]))
else
gate.ports[1]:setstate(not gate.ports[1].state)
gate.ports[2]:setstate(not gate.ports[2].state)
end
gate:cb("1\t" .. bool_to_int[gate.ports[1].state])
end
return function(gate, argv)
if #argv == 1 then
gate.ports[1]:setstate(toboolean(argv[1]))
gate.ports[2]:setstate(toboolean(argv[1]))
else
gate.ports[1]:setstate(not gate.ports[1].state)
gate.ports[2]:setstate(not gate.ports[2].state)
end
gate:cb(bool_to_int[gate.ports[1].state])
end