Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ex = true
- mW = peripheral.find("modem")
- m = peripheral.wrap("left") -- side of reactor
- mW.open(51)
- mon = peripheral.find("monitor")
- function os.pullEvent()
- e,p1,p2,p3,p4,p5 = os.pullEventRaw()
- if e == "terminate" then
- print("terminate")
- ex = false
- elseif e == "modem_message" then
- if p4 == "getRCST" then
- mW.transmit(51,51,"reactorST="..HEAT..";"..tostring(STATUS)..";"..OEU)
- elseif p4 == "actR" then
- rs.setOutput("left",true)
- elseif p4 == "disR" then
- rs.setOutput("left",false)
- end
- end
- return e,p1,p2,p3,p4,p5
- end
- while ex do
- HEAT = m.getHeat()
- MAXHEAT = m.getMaxHeat()
- STATUS = m.isActive()
- OEU = m.getEUOutput()
- OEU = tostring(tonumber(OEU) * 10)
- term.clear()
- term.setCursorPos(1,1)
- if not mon == nil then
- mon.setCursorPos(2,1)
- mon.write("Reactor #1")
- if STATUS then
- if LSST == false then
- mon.clear()
- end
- mon.setCursorPos(1,2)
- mon.write("Heat:"..HEAT)
- mon.setCursorPos(1,3)
- mon.write(STATUS and "Enabled" or "Disabled")
- mon.setCursorPos(1,4)
- mon.write("EU output:"..OEU)
- LSST = true
- else
- mon.setCursorPos(1,5)
- if LSST then
- mon.clear()
- end
- LSST = false
- mon.write(STATUS and "Enabled" or "Disabled")
- end
- end
- print(" Reactor #1 ")
- print(" Heat:"..HEAT)
- print("MaxHeat:"..MAXHEAT)
- if STATUS then
- print(" Active ")
- rs.setOutput("right",true)
- else
- print(" Inactive ")
- rs.setOutput("right",false)
- end
- print("Output:"..OEU)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement