OC-MultICE/modules/base/virt.lua

27 lines
548 B
Lua

do
local fs=component.proxy(computer.bootAddress())
local fi=fs.open("/boot.lua","rb")
local nc,ls,ne="","",{}
repeat
ls=ls..nc
nc=fs.read(fi,2048)
until nc == "" or nc == nil
fs.close(fi)
setmetatable(ne,{__index=_G})
ne.computer = _G.computer
function ne.computer.pullSignal(n)
local et = computer.uptime()+n
while true do
local eT = {C.yield()}
if eT ~= {} then
return table.unpack(eT)
elseif computer.uptime() >= et then
break
end
end
end
local fscr=load(ls)
setfenv(ls,ne)
s("virt process",fscr)
end