updated
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
local function getValue()
|
local function getValue(env)
|
||||||
return environment.getRadiation().radiation
|
local value = env.getRadiation()
|
||||||
|
local stringValue = value.radiation .. value.unit
|
||||||
|
return stringValue
|
||||||
end
|
end
|
||||||
|
|
||||||
local function watch()
|
local function watch()
|
||||||
@@ -16,11 +18,12 @@ local function shutdown()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function report()
|
local function report()
|
||||||
local value = getValue()
|
|
||||||
local color = colors.black
|
local color = colors.black
|
||||||
monitor.setBackgroundColor(color)
|
monitor.setBackgroundColor(color)
|
||||||
|
|
||||||
setNewLine()
|
setNewLine()
|
||||||
monitor.write("Radiation Level: " .. tostring(value))
|
monitor.write("Internal Radiation Level: " .. getValue(internalEnvironment))
|
||||||
|
setNewLine()
|
||||||
|
monitor.write("External Radiation Level: " .. getValue(externalEnvironment))
|
||||||
end
|
end
|
||||||
return { report = report, watch = watch, startUp = startUp, shutdown = shutdown }
|
return { report = report, watch = watch, startUp = startUp, shutdown = shutdown }
|
||||||
4
main.lua
4
main.lua
@@ -3,7 +3,9 @@ reactor = peripheral.find("fissionReactorLogicAdapter")
|
|||||||
turbine = peripheral.find("turbineValve")
|
turbine = peripheral.find("turbineValve")
|
||||||
turbineVent = peripheral.find("turbineVent")
|
turbineVent = peripheral.find("turbineVent")
|
||||||
monitor = peripheral.find("monitor")
|
monitor = peripheral.find("monitor")
|
||||||
environment = peripheral.find("environmentDetector")
|
internalEnvironment = peripheral.find("environmentDetector_0")
|
||||||
|
externalEnvironment = peripheral.find("environmentDetector_1")
|
||||||
|
|
||||||
tempDriver = kernel.addDriver("temperature_driver")
|
tempDriver = kernel.addDriver("temperature_driver")
|
||||||
coolantDriver = kernel.addDriver("coolant_driver")
|
coolantDriver = kernel.addDriver("coolant_driver")
|
||||||
statusDriver = kernel.addDriver("status_driver")
|
statusDriver = kernel.addDriver("status_driver")
|
||||||
|
|||||||
Reference in New Issue
Block a user