diff --git a/webbridge.lua b/webbridge.lua index 7069279..50ad2ed 100644 --- a/webbridge.lua +++ b/webbridge.lua @@ -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)