altered callback functionality

This commit is contained in:
Redo
2019-04-16 19:33:24 -05:00
parent 43b4db151f
commit cf23667afd
6 changed files with 103 additions and 213 deletions

View File

@@ -1,13 +1,13 @@
return function(gate)
if gate.ports[1]:isrising() then
gate.tickStarted = gate:gettick()
elseif gate.ports[1]:isfalling() then
local ticksOn = gate:gettick() - gate.tickStarted
local printid = ((ticksOn-1) % #textbrick_idxToPrint)
local printname = textbrick_idxToPrint[printid]
gate:cb("1\t" .. printname)
end
end
return function(gate)
if gate.ports[1]:isrising() then
gate.tickStarted = gate:gettick()
elseif gate.ports[1]:isfalling() then
local ticksOn = gate:gettick() - gate.tickStarted
local printid = ((ticksOn-1) % #textbrick_idxToPrint)
local printname = textbrick_idxToPrint[printid]
gate:cb(printname)
end
end