fix: Correctly calculate time since turtle was last seen in dashboard display

This commit is contained in:
MayaTheShy
2026-02-19 23:33:56 -05:00
parent 6b48ddc8b3
commit 31b2c8f61a

View File

@@ -126,7 +126,11 @@ local function drawDashboard()
if y >= h - 5 then break end -- Leave room for activity log
local statusColor = getStatusColor(turtle)
local timeSince = math.floor((os.epoch("utc") - (turtle.lastSeen or 0)) / 1000)
local timeSince = 0
if turtle.lastSeen then
local currentTime = os.epoch("utc") or 0
timeSince = math.floor((currentTime - turtle.lastSeen) / 1000)
end
monitor.setCursorPos(2, y)
monitor.setTextColor(statusColor)