feat: add error handling for unloaded peripherals

Future work: cap the number of retries
This commit is contained in:
Emerson Rosen-Jones 2025-12-20 22:02:37 -05:00
parent 2867cb434e
commit 0be62dbccc

View file

@ -141,5 +141,10 @@ if arg ~= nil and arg[1] == "run" then
local requester = peripheral.wrap(MAIN_REQUESTER)
requester.setAddress(FACTORY_ADDRESS)
local ticker = peripheral.wrap(SUBNET_TICKER)
run(requester, ticker)
local ran = false
while not ran do
ran, result = run(ticker, requester)
if not ran then print(result) end
os.sleep(SLEEP_T)
end
end