From 29026175b7eeca6d0ce39db8aaede584e9b727ad Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Thu, 26 Mar 2026 14:23:33 -0400 Subject: [PATCH] feat: enhance billboard monitor setup with explicit configuration and auto-detection --- manager/display.lua | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/manager/display.lua b/manager/display.lua index 588f3c2..0a5e90c 100644 --- a/manager/display.lua +++ b/manager/display.lua @@ -163,15 +163,30 @@ function D.setupSmelterMonitor() end function D.setupBillboardMonitor() - if not cfg.BILLBOARD_MONITOR or cfg.BILLBOARD_MONITOR == "" then + -- If explicitly configured, use that name + if cfg.BILLBOARD_MONITOR and cfg.BILLBOARD_MONITOR ~= "" then + local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR) + if mon and mon.setTextScale then + D.billboardMon = mon + D.billboardMonName = cfg.BILLBOARD_MONITOR + D.billboardMon.setTextScale(0.5) + return true + end return false end - local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR) - if mon and mon.setTextScale then - D.billboardMon = mon - D.billboardMonName = cfg.BILLBOARD_MONITOR - D.billboardMon.setTextScale(0.5) - return true + -- Auto-detect: find any monitor not already used by main/smelter + for _, name in ipairs(peripheral.getNames()) do + if peripheral.getType(name) == "monitor" + and name ~= D.monName + and name ~= D.smelterMonName then + local mon = peripheral.wrap(name) + if mon and mon.setTextScale then + D.billboardMon = mon + D.billboardMonName = name + D.billboardMon.setTextScale(0.5) + return true + end + end end return false end