1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2026-01-09 16:02:26 -05:00
OC-PsychOS2/service/wolbeacon.lua
2025-09-08 12:38:20 +00:00

23 lines
508 B
Lua

local delay = 60
local port = 3442
local message = "WoLBeacon"
for modem in component.list("modem") do
component.invoke(modem,"setWakeMessage",message)
end
function start()
return os.spawn(function()
local ltime = computer.uptime()
while true do
if computer.uptime() > ltime+delay then
for modem in component.list("modem") do
component.invoke(modem,"broadcast",port,message)
end
ltime=computer.uptime()
end
coroutine.yield()
end
end, "WoLBeacon")
end
return {start=start}