From 71ec25123bbc087070cacad98835b7c1d7180170 Mon Sep 17 00:00:00 2001 From: Gabriel-V-Maia Date: Thu, 1 Jan 2026 20:38:41 -0300 Subject: [PATCH 1/2] feat(gates): add curtime gate --- lua/wire/gates/time.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lua/wire/gates/time.lua b/lua/wire/gates/time.lua index 398a1d495d..4f93c4c024 100644 --- a/lua/wire/gates/time.lua +++ b/lua/wire/gates/time.lua @@ -317,4 +317,29 @@ GateActions["monostable"] = { end } + +GateActions["curtime"] = { + name = "CurTime", + description = "Outputs CurTime() when Clk is non-zero, otherwise holds last value.", + inputs = { "Clk" }, + timed = true, + + output = function(gate, Clk) + if Clk ~= 0 then + gate.Last = CurTime() + end + + return gate.Last or 0 + end, + + reset = function(gate) + gate.Last = 0 + end, + + label = function(Out, Clk) + return "Clk:" .. Clk .. " = " .. Out + end +} + + GateActions() From 252a84c90a6a8ca46d3e52169771ed6e70205e59 Mon Sep 17 00:00:00 2001 From: Gabriel-V-Maia Date: Fri, 2 Jan 2026 13:08:59 -0300 Subject: [PATCH 2/2] chore(gates): rename CurTime gate to Server Time for clarity and update description --- lua/wire/gates/time.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wire/gates/time.lua b/lua/wire/gates/time.lua index 4f93c4c024..7267631e41 100644 --- a/lua/wire/gates/time.lua +++ b/lua/wire/gates/time.lua @@ -318,9 +318,9 @@ GateActions["monostable"] = { } -GateActions["curtime"] = { - name = "CurTime", - description = "Outputs CurTime() when Clk is non-zero, otherwise holds last value.", +GateActions["servertime"] = { + name = "Server time", + description = "Returns the uptime of the server in seconds when CLK is non-zero, otherwise it outputs the last saved value", inputs = { "Clk" }, timed = true,