local function getValue(reactor) local kelvin = reactor.getTemperature() or 0 local fahrenheit = (kelvin - 273.15) * 9 / 5 + 32 return math.floor(fahrenheit * 100 + 0.5) / 100 end local function color(reactor) local temperature = getValue(reactor) return colors.black end local function watch(reactor, monitor) print("Temperature: " .. getValue(reactor)) sleep(1) end local function report(reactor, monitor) local value = getValue(reactor) local color = color(reactor) monitor.setBackgroundColor(color) monitor.clearLine() monitor.write("Temperature: " .. value .. "°F") end return { report = report, watch = watch }