fixed bad typing on schedule
This commit is contained in:
@@ -11,7 +11,7 @@ local debugger = true
|
|||||||
|
|
||||||
local projectDirectory = fs.getDir(table.pack(...)[2] or "")
|
local projectDirectory = fs.getDir(table.pack(...)[2] or "")
|
||||||
|
|
||||||
local activeKey, frames, monFrames, variables, shedules = {}, {}, {}, {}, {}
|
local activeKey, frames, monFrames, variables, schedules = {}, {}, {}, {}, {}
|
||||||
local mainFrame, activeFrame, focusedObject, updaterActive
|
local mainFrame, activeFrame, focusedObject, updaterActive
|
||||||
|
|
||||||
if not term.isColor or not term.isColor() then
|
if not term.isColor or not term.isColor() then
|
||||||
@@ -122,13 +122,13 @@ local basaltError = function(errMsg)
|
|||||||
baseTerm.setCursorPos(1,yPos+1)
|
baseTerm.setCursorPos(1,yPos+1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function handleShedules(event, p1, p2, p3, p4)
|
local function handleSchedules(event, p1, p2, p3, p4)
|
||||||
if(#shedules>0)then
|
if(#schedules>0)then
|
||||||
local finished = {}
|
local finished = {}
|
||||||
for n=1,#shedules do
|
for n=1,#schedules do
|
||||||
if(shedules[n]~=nil)then
|
if(schedules[n]~=nil)then
|
||||||
if (coroutine.status(shedules[n]) == "suspended")then
|
if (coroutine.status(schedules[n]) == "suspended")then
|
||||||
local ok, result = coroutine.resume(shedules[n], event, p1, p2, p3, p4)
|
local ok, result = coroutine.resume(schedules[n], event, p1, p2, p3, p4)
|
||||||
if not(ok)then
|
if not(ok)then
|
||||||
basaltError(result)
|
basaltError(result)
|
||||||
end
|
end
|
||||||
@@ -138,7 +138,7 @@ local function handleShedules(event, p1, p2, p3, p4)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
for n=1,#finished do
|
for n=1,#finished do
|
||||||
table.remove(shedules, finished[n]-(n-1))
|
table.remove(schedules, finished[n]-(n-1))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -197,7 +197,7 @@ local function basaltUpdateEvent(event, p1, p2, p3, p4)
|
|||||||
for _, v in pairs(frames) do
|
for _, v in pairs(frames) do
|
||||||
v:eventHandler(event, p1, p2, p3, p4)
|
v:eventHandler(event, p1, p2, p3, p4)
|
||||||
end
|
end
|
||||||
handleShedules(event, p1, p2, p3, p4)
|
handleSchedules(event, p1, p2, p3, p4)
|
||||||
drawFrames()
|
drawFrames()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -205,7 +205,6 @@ local basalt = {}
|
|||||||
basalt = {
|
basalt = {
|
||||||
setTheme = setTheme,
|
setTheme = setTheme,
|
||||||
getTheme = getTheme,
|
getTheme = getTheme,
|
||||||
stopUpdate = stop,
|
|
||||||
getVersion = function()
|
getVersion = function()
|
||||||
return version
|
return version
|
||||||
end,
|
end,
|
||||||
@@ -273,13 +272,13 @@ basalt = {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
shedule = function(f)
|
schedule = function(f)
|
||||||
assert(f~="function", "Shedule needs a function in order to work!")
|
assert(f~="function", "Schedule needs a function in order to work!")
|
||||||
return function(...)
|
return function(...)
|
||||||
local co = coroutine.create(f)
|
local co = coroutine.create(f)
|
||||||
local ok, result = coroutine.resume(co, ...)
|
local ok, result = coroutine.resume(co, ...)
|
||||||
if(ok)then
|
if(ok)then
|
||||||
table.insert(shedules, co)
|
table.insert(schedules, co)
|
||||||
else
|
else
|
||||||
basaltError(result)
|
basaltError(result)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user