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