diff --git a/programs/roulette.lua b/programs/roulette.lua index 4798cbb..58b2715 100644 --- a/programs/roulette.lua +++ b/programs/roulette.lua @@ -20,7 +20,21 @@ local tris = { { 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, } -local gpu = peripheral.wrap("tm_gpu_0") +print("Scanning peripherals...") +for _, name in ipairs(peripheral.getNames()) do + print(name .. " = " .. peripheral.getType(name)) +end + +local gpu +for _, name in ipairs(peripheral.getNames()) do + local t = peripheral.getType(name) + if t and t:find("gpu") then + gpu = peripheral.wrap(name) + print("Found GPU: " .. name) + break + end +end +if not gpu then error("No GPU peripheral found.") end gpu.refreshSize() gpu.setSize(64) local pw, ph, bx, by, sb = gpu.getSize()