Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/graph")
- os.loadAPI("ocs/apis/sensor")
- mySensor = sensor.wrap("top")
- mon = peripheral.wrap("right:red")
- position = "0,-1,-3"
- cooling = false
- mHeat = mySensor.getTargetDetails(position).MaxHeat
- time = 0
- initialOutputted = mySensor.getTargetDetails(position).EnergyEmitted
- function cls()
- term.clear()
- term.setCursorPos(1,1)
- end
- function updateHeat()
- local tab = sensor.call("top", "getTargetDetails", position)
- return tab.Heat
- end
- heatGraph = graph.new(mon, updateHeat, "Heat", {colors.lime, colors.yellow, colors.orange, colors.red}, 0, mHeat, false)
- redstone.setOutput("left", true)
- while true do
- cls()
- print("Reactor Heat: "..updateHeat())
- print("Seconds Running: "..time)
- print("EU Produced: "..mySensor.getTargetDetails(position).EnergyEmitted - initialOutputted)
- print("Average EU/t: "..(mySensor.getTargetDetails(position).EnergyEmitted - initialOutputted) / (time*20))
- heatGraph:draw()
- if(updateHeat() >= 0.45*mHeat and cooling == false) then
- cooling = true
- redstone.setOutput("left", false)
- end
- if(updateHeat() <= 0.4*mHeat/3 and cooling == true) then
- cooling = false
- redstone.setOutput("left", true)
- end
- sleep(1)
- time = time + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment