--- Somewhat safely loads "run.lua" module into a global variable RUN. Loaded module itself should be a function. If --- everything seems fine, true is returned. function init () wifi.setmode(wifi.NULLMODE, false) local l, r = pcall(require, "run") if not l then print("Could not load run.lua:", r) return end RUN = r l, r = node.bootreason() if l == 2 and (r == 2 or r == 4) then print("Most likely an exception restarted last boot, run.lua loaded into RUN and left as is") return end return true end if init() then RUN() end