updated
This commit is contained in:
@@ -18,15 +18,11 @@ local function watch(reactor, monitor)
|
||||
end
|
||||
|
||||
local function report(reactor, monitor)
|
||||
if reactor then
|
||||
local value = getValue(reactor)
|
||||
local color = color(reactor)
|
||||
configureReport(monitor)
|
||||
monitor.setBackgroundColor(color)
|
||||
monitor.write("Coolant: " .. value .. "%")
|
||||
else
|
||||
return "No reactor found"
|
||||
end
|
||||
end
|
||||
|
||||
local function configureReport(monitor)
|
||||
|
||||
8
main.lua
8
main.lua
@@ -27,6 +27,14 @@ local function runDisplay()
|
||||
end
|
||||
|
||||
local function run()
|
||||
while not reactor do
|
||||
print("Waiting for reactor signal...")
|
||||
end
|
||||
|
||||
while not monitor do
|
||||
print("Waiting for monitor signal...")
|
||||
end
|
||||
|
||||
parallel.waitForAll(runMonitors, runDisplay)
|
||||
end
|
||||
|
||||
|
||||
@@ -14,15 +14,11 @@ local function color(reactor)
|
||||
end
|
||||
|
||||
local function report(reactor, monitor)
|
||||
if reactor then
|
||||
local value = getValue(reactor)
|
||||
local color = color(reactor)
|
||||
configureReport(monitor)
|
||||
monitor.setBackgroundColor(color)
|
||||
monitor.write("Coolant: " .. value .. "%")
|
||||
else
|
||||
return "No reactor found"
|
||||
end
|
||||
end
|
||||
|
||||
local function configureReport(monitor)
|
||||
|
||||
Reference in New Issue
Block a user