Added wait() function.
This commit is contained in:
@@ -72,6 +72,14 @@ package.preload("computer")
|
|||||||
package.preload("log")
|
package.preload("log")
|
||||||
package.preload("event")
|
package.preload("event")
|
||||||
|
|
||||||
|
local computer = require("computer")
|
||||||
|
function wait(seconds)
|
||||||
|
local oldTime = computer.uptime()
|
||||||
|
while computer.uptime() < oldTime + seconds do
|
||||||
|
coroutine.yield()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not filesystem.exists("/halyde/config/startupapps.json") then
|
if not filesystem.exists("/halyde/config/startupapps.json") then
|
||||||
filesystem.copy("/halyde/config/generate/startupapps.json", "/halyde/config/startupapps.json")
|
filesystem.copy("/halyde/config/generate/startupapps.json", "/halyde/config/startupapps.json")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ function module.init()
|
|||||||
"checkArg",
|
"checkArg",
|
||||||
"utf8",
|
"utf8",
|
||||||
"convert",
|
"convert",
|
||||||
|
"wait"
|
||||||
}
|
}
|
||||||
for _, value in ipairs(publicTable) do
|
for _, value in ipairs(publicTable) do
|
||||||
_G._PUBLIC[value] = table.copy(_G[value])
|
_G._PUBLIC[value] = table.copy(_G[value])
|
||||||
|
|||||||
Reference in New Issue
Block a user