Update sPhone.lua
This commit is contained in:
parent
90da268753
commit
3376717f6e
1 changed files with 15 additions and 1 deletions
|
@ -47,7 +47,21 @@ local function kernel()
|
||||||
end
|
end
|
||||||
|
|
||||||
for k, v in pairs(fs.list("/.sPhone/autorun")) do
|
for k, v in pairs(fs.list("/.sPhone/autorun")) do
|
||||||
dofile("/.sPhone/autorun/"..v)
|
if not fs.isDir("/.sPhone/autorun/"..v) then
|
||||||
|
local f = fs.open("/.sPhone/autorun/"..v,"r")
|
||||||
|
local script = f.readAll()
|
||||||
|
f.close()
|
||||||
|
print("Loading script "..v)
|
||||||
|
sleep(0)
|
||||||
|
local ok, err = pcall(function() setfenv(loadstring(script),getfenv())() end)
|
||||||
|
if not ok then
|
||||||
|
printError("Script error: "..v..": "..err)
|
||||||
|
fs.move("/.sPhone/autorun/"..v, "/.sPhone/autorun/disabled/"..v)
|
||||||
|
printError(v.." disabled to prevent errors")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if runningOnStartup then
|
if runningOnStartup then
|
||||||
|
|
Loading…
Reference in a new issue