v0.3.0 - Nothing works. I'm confused as hell. I can't figure this out.
This commit is contained in:
+17
-10
@@ -17,6 +17,21 @@ function handleError(errormsg)
|
||||
assert(false, errormsg)
|
||||
end
|
||||
|
||||
local function runCoroutines()
|
||||
for i = 1, #_G.cormgr.corList do
|
||||
local result, errorMessage = coroutine.resume(_G.cormgr.corList[i])
|
||||
if not result then
|
||||
handleError(errorMessage)
|
||||
end
|
||||
if coroutine.status(_G.cormgr.corList[i]) == "dead" then
|
||||
table.remove(_G.cormgr.corList, i)
|
||||
break
|
||||
end
|
||||
--computer.pullSignal(0)
|
||||
--coroutine.yield()
|
||||
end
|
||||
end
|
||||
|
||||
local handle = filesystem.open("/halyde/config/startupapps.txt", "r")
|
||||
local data = ""
|
||||
local tmpdata
|
||||
@@ -27,21 +42,13 @@ until not tmpdata
|
||||
for line in data:gmatch("([^\n]*)\n?") do
|
||||
if line ~= "" then
|
||||
_G.cormgr.loadCoroutine(line)
|
||||
runCoroutines()
|
||||
end
|
||||
end
|
||||
_G.cormgr.loadCoroutine("/halyde/core/shell.lua")
|
||||
|
||||
while true do
|
||||
for i = 1, #_G.cormgr.corList do
|
||||
local result, errormsg = coroutine.resume(_G.cormgr.corList[i])
|
||||
if coroutine.status(_G.cormgr.corList[i]) == "dead" then
|
||||
table.remove(_G.cormgr.corList, i)
|
||||
if not result then
|
||||
handleError(errormsg)
|
||||
end
|
||||
end
|
||||
computer.pullSignal(0)
|
||||
end
|
||||
runCoroutines()
|
||||
if #_G.cormgr.corList == 0 then
|
||||
computer.shutdown()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user