From 6b48ddc8b3ff66122534c46822b816146fdf5e55 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Thu, 19 Feb 2026 23:31:44 -0500 Subject: [PATCH] feat: Update dashboard header to display the count of online turtles --- webbridge.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/webbridge.lua b/webbridge.lua index 1ccb6c3..7069279 100644 --- a/webbridge.lua +++ b/webbridge.lua @@ -89,12 +89,18 @@ local function drawDashboard() monitor.setBackgroundColor(colors.black) monitor.clear() + -- Count turtles + local turtleCount = 0 + for _ in pairs(turtles) do + turtleCount = turtleCount + 1 + end + -- Simple header monitor.setBackgroundColor(colors.blue) monitor.setTextColor(colors.white) monitor.setCursorPos(1, 1) monitor.clearLine() - centerText(1, "TURTLE BRIDGE - " .. #turtles .. " TURTLES ONLINE", colors.white, colors.blue) + centerText(1, "TURTLE BRIDGE - " .. turtleCount .. " ONLINE", colors.white, colors.blue) -- Status line monitor.setBackgroundColor(colors.gray) @@ -108,7 +114,7 @@ local function drawDashboard() monitor.setBackgroundColor(colors.black) local startY = 4 - if #turtles == 0 then + if turtleCount == 0 then monitor.setTextColor(colors.gray) monitor.setCursorPos(2, startY) monitor.write("No turtles connected. Waiting for signals...")