Update sPhone.lua
This commit is contained in:
parent
0388834c0e
commit
5ac2fa1151
1 changed files with 18 additions and 0 deletions
|
@ -434,6 +434,24 @@ end
|
|||
end
|
||||
end
|
||||
|
||||
function sPhone.run(_rApp)
|
||||
if not fs.exists(_rApp) or fs.isDir(_rApp) then
|
||||
sPhone.winOk("App not found")
|
||||
return
|
||||
end
|
||||
local f = fs.open(_rApp, "r")
|
||||
local script = f.readAll()
|
||||
f.close()
|
||||
local ok, err = pcall(function() setfenv(loadstring(script),getfenv())() end)
|
||||
if not ok then
|
||||
f.open("/crash/".._rApp,"a")
|
||||
f.write(err.."\n")
|
||||
f.close()
|
||||
sPhone.winOk(_rApp.." crashed","Check /crash")
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local function lChat()
|
||||
clear()
|
||||
local w, h = term.getSize()
|
||||
|
|
Loading…
Reference in a new issue