Compare commits
2 Commits
6c45180119
...
be8ba0a40b
Author | SHA1 | Date | |
---|---|---|---|
be8ba0a40b | |||
7347c93988 |
@ -26,11 +26,20 @@ setmetatable(shenv,{__index=function(_,k)
|
|||||||
if _G[k] then
|
if _G[k] then
|
||||||
return _G[k]
|
return _G[k]
|
||||||
elseif fs.exists("/boot/exec/"..k..".lua") then
|
elseif fs.exists("/boot/exec/"..k..".lua") then
|
||||||
|
local rqid = string.format("shell-%d",math.random(1,99999))
|
||||||
return function(...)
|
return function(...)
|
||||||
local tA = {...}
|
local tA = {...}
|
||||||
local pid = os.spawn(function() loadfile("/boot/exec/"..k..".lua")(table.unpack(tA)) end,"/boot/exec/"..k..".lua")
|
local pid = os.spawn(function() computer.pushSignal(rqid,pcall(loadfile("/boot/exec/"..k..".lua"),table.unpack(tA))) end,"/boot/exec/"..k..".lua")
|
||||||
|
local tE = {}
|
||||||
repeat
|
repeat
|
||||||
coroutine.yield()
|
tE = {coroutine.yield()}
|
||||||
|
if tE[1] == rqid then
|
||||||
|
table.remove(tE,1)
|
||||||
|
if tE[1] == true then
|
||||||
|
table.remove(tE,1)
|
||||||
|
end
|
||||||
|
return table.unpack(tE)
|
||||||
|
end
|
||||||
until tTasks[pid] == nil
|
until tTasks[pid] == nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user