34 lines
644 B
Lua
34 lines
644 B
Lua
local maxValue = 100
|
|
local minValue = 0
|
|
|
|
local function getValue()
|
|
return (reactor.getCoolantFilledPercentage() or 0) * 100
|
|
end
|
|
|
|
local function color()
|
|
local coolantLevel = getValue()
|
|
return colors.black
|
|
end
|
|
|
|
|
|
local function watch()
|
|
while true do
|
|
checkCoolantLevel()
|
|
end
|
|
end
|
|
|
|
function checkCoolantLevel()
|
|
local coolantLevel = getValue()
|
|
return true
|
|
end
|
|
|
|
local function report()
|
|
local value = getValue()
|
|
local color = color()
|
|
monitor.setBackgroundColor(color)
|
|
monitor.clearLine()
|
|
monitor.write("Coolant: " .. value .. "%")
|
|
end
|
|
|
|
|
|
return { report = report, watch = watch} |