We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d95357 commit 71ec251Copy full SHA for 71ec251
lua/wire/gates/time.lua
@@ -317,4 +317,29 @@ GateActions["monostable"] = {
317
end
318
}
319
320
+
321
+GateActions["curtime"] = {
322
+ name = "CurTime",
323
+ description = "Outputs CurTime() when Clk is non-zero, otherwise holds last value.",
324
+ inputs = { "Clk" },
325
+ timed = true,
326
327
+ output = function(gate, Clk)
328
+ if Clk ~= 0 then
329
+ gate.Last = CurTime()
330
+ end
331
332
+ return gate.Last or 0
333
+ end,
334
335
+ reset = function(gate)
336
+ gate.Last = 0
337
338
339
+ label = function(Out, Clk)
340
+ return "Clk:" .. Clk .. " = " .. Out
341
342
+}
343
344
345
GateActions()
0 commit comments