diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-01 04:36:56 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-01 04:36:56 +0100 |
commit | 4aa33c21da808c79046b5fb85c6873d88bd589c9 (patch) | |
tree | b8bcb1c197a4113d2e5cca7e2d3ef1cb0889e3b7 | |
parent | e94740c9a4cf94a100a1e6bf6ecce361cb10a668 (diff) |
launch john
-rw-r--r-- | john.lua | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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) |