v0.3.0 - Nothing works. I'm confused as hell. I can't figure this out.

This commit is contained in:
TheWahlolly
2025-04-05 16:21:58 +03:00
parent 7b8e237abe
commit 198b56e64a
8 changed files with 208 additions and 21 deletions
+17 -10
View File
@@ -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