37 lines
730 B
Lua
37 lines
730 B
Lua
|
|
local function getValue()
|
|
return reactor.getStatus() or false
|
|
end
|
|
|
|
|
|
-- local function watch()
|
|
-- while true do
|
|
-- checkStatus()
|
|
-- sleep(0.05) -- Update every tenth second
|
|
-- end
|
|
-- end
|
|
|
|
local function checkStatus()
|
|
local value = getValue()
|
|
end
|
|
|
|
-- local function watch()
|
|
-- checkStatus()
|
|
-- end
|
|
|
|
local function watch()
|
|
while true do
|
|
checkStatus()
|
|
sleep(0.05) -- Update every tenth second
|
|
end
|
|
end
|
|
|
|
|
|
local function report()
|
|
local value = getValue()
|
|
local color = colors.black
|
|
monitor.setBackgroundColor(color)
|
|
monitor.clearLine()
|
|
monitor.write("Reactor Status: " .. tostring(value))
|
|
end
|
|
return { report = report, watch = watch } |