updated
This commit is contained in:
@@ -4,41 +4,37 @@ local function getValue()
|
||||
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()
|
||||
reactor.setBurnRate(2)
|
||||
local status = reactor.getStatus()
|
||||
if(not status) then
|
||||
reactor.activate()
|
||||
return
|
||||
end
|
||||
|
||||
while true do
|
||||
checkStatus()
|
||||
sleep(0.05) -- Update every tenth second
|
||||
end
|
||||
end
|
||||
|
||||
local function startUp()
|
||||
reactor.setBurnRate(2)
|
||||
local status = reactor.getStatus()
|
||||
if(not status) then
|
||||
reactor.activate()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local function shutdown()
|
||||
reactor.setBurnRate(0)
|
||||
reactor.deactivate()
|
||||
end
|
||||
|
||||
local function report()
|
||||
local value = getValue()
|
||||
local color = colors.black
|
||||
monitor.setBackgroundColor(color)
|
||||
monitor.clearLine()
|
||||
|
||||
setNewLine()
|
||||
monitor.write("Reactor Status: " .. tostring(value))
|
||||
end
|
||||
return { report = report, watch = watch }
|
||||
return { report = report, watch = watch, startUp = startUp, shutdown = shutdown }
|
||||
Reference in New Issue
Block a user