Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Load Sensor API
- os.loadAPI("ocs/apis/sensor")
- --Wrap Monitor
- local mon = peripheral.wrap("monitor_11")
- --Find Sensor
- local sense = sensor.wrap("top")
- --Redirect to Monitor
- term.redirect(mon)
- --Info Check
- function updateheat()
- local reactorData = sense.getTargetDetails("1,2,0")
- end
- --Monitor Update
- function updatemon()
- term.clear()
- term.setCursorPos(1,1)
- local reactorData = sense.getTargetDetails("1,2,0")
- print(reactorData.HeatPercentage)
- sleep(1)
- end
- --Reactor Control
- --This is my Problem!!!
- function reactor()
- if reactorData.HeatPercentage < 2 then
- rs.setOutput("back", true)
- end
- if reactorData.HeatPercentage > 50 then
- rs.setOutput("back", false)
- end
- end
- while true do
- updateheat()
- updatemon()
- reactor()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement