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