Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Load Sensor API
- os.loadAPI("ocs/apis/sensor")
- --Wrap Monitor
- mon = peripheral.wrap("monitor_13")
- --Find Sensor
- sensepwr = sensor.wrap("left")
- senseheat = sensor.wrap("bottom")
- --Redirect to Monitor
- term.redirect(mon)
- --Print Heat
- function printHeat()
- print(reactorheat.HeatPercentage)
- end
- --Find the heat
- function FindHeat()
- reactorheat = senseheat.getTargetDetails("0,2,2")
- end
- --Find the Power
- function FindPower()
- reactorpwr = sensepwr.getTargetDetails("0,3,1")
- end
- --Update Monitor power
- function UpdateMonPwr()
- os.startTimer(1)
- local event = os.pullEvent()
- if event == "timer" then
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- print(reactorpwr.EnergySunken)
- end
- --Update Monitor Heat
- function UpdateMonHeat()
- term.setCursorPos(1,4)
- if reactorheat.HeatPercentage <= 33 then
- term.setTextColor(colors.lime)
- rs.setOutput("back", true)
- printHeat()
- elseif reactorheat.HeatPercentage >= 33 and reactorheat.HeatPercentage <= 66 then
- term.setTextColor(colors.yellow)
- printHeat()
- elseif reactorheat.HeatPercentage >= 66 and reactorheat.HeatPercentage <= 75 then
- term.setTextColor(colors.red)
- printHeat()
- elseif reactorheat.HeatPercentage >= 75 then
- term.setTextColor(colors.red)
- printHeat()
- rs.setOutput("back", false)
- end
- end
- while true do
- FindPower()
- FindHeat()
- UpdateMonPwr()
- sleep(.5)
- UpdateMonHeat()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement