Added wait() function.

This commit is contained in:
WahPlus
2025-10-28 19:14:16 +02:00
parent 8144d44deb
commit 51124da54b
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -72,6 +72,14 @@ package.preload("computer")
package.preload("log")
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
filesystem.copy("/halyde/config/generate/startupapps.json", "/halyde/config/startupapps.json")
end
+1
View File
@@ -39,6 +39,7 @@ function module.init()
"checkArg",
"utf8",
"convert",
"wait"
}
for _, value in ipairs(publicTable) do
_G._PUBLIC[value] = table.copy(_G[value])