From 4aa33c21da808c79046b5fb85c6873d88bd589c9 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 1 Apr 2024 04:36:56 +0100 Subject: launch john --- john.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/john.lua b/john.lua index fa6bd08..82f309c 100644 --- a/john.lua +++ b/john.lua @@ -15,8 +15,15 @@ if monitors == nil or #monitors < 1 then end fb:ppm(fs.open("img/john.pnm","rb")) -print("size!!",fb:get_size()) -local xoffs = 0 +local W,H = fb:get_size() + +local total_width = 0 +for ix,iname in ipairs(monitors) do + local mon = peripheral.wrap(iname) + total_width = total_width + (mon.getSize()) +end +local leftover = total_width - W +local xoffs = math.floor(leftover/2) for ix,iname in ipairs(monitors) do print("doing",ix,iname) -- cgit v1.2.3