Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI "monAPI"
- os.loadAPI "button"
- local mon = monAPI.wrapMonitor("right")
- rednet.open("back")
- function seccreate(sec,sx,sy,ex,ey,banknum,border,datasearch)
- sec = mon.createSection(sx,sy,ex,ey)
- sec.clear()
- if border == 1 then
- sec.setTextColor(colors.yellow)
- sec.drawBorder('#','#','+')
- end
- if datasearch == 1 then
- sec.setTextColor(colors.white)
- sec.setCursorPos(2,3)
- sec.write('Turbine - Reactor Bank '..banknum..'')
- sec.setCursorPos(2,4)
- sec.write('Searching for Data Broadcast')
- end
- end
- seccreate(section1,1,1,17,38,0,1,0)
- seccreate(section2,18,1,48,18,1,1,1)
- seccreate(section3,49,1,79,18,2,1,1)
- seccreate(section4,80,1,111,18,3,1,1)
- seccreate(section5,112,1,143,18,4,1,1)
- seccreate(section6,18,20,48,38,5,1,1)
- seccreate(section7,49,20,79,38,6,1,1)
- seccreate(section8,80,20,111,38,7,1,1)
- seccreate(section9,112,20,143,38,8,1,1)
- function turbinemon(idcode,bank,seec)
- id,message = rednet.receive()
- if id == idcode then
- seec.clear()
- seec.setTextColor(colors.yellow)
- seec.drawBorder('#','#','+')
- seec.setCursorPos(2,3)
- seec.setTextColor(colors.white)
- seec.write('Turbine - Reactor Bank '..bank..'')
- seec.setCursorPos(2,4)
- seec.write('Data Broadcast Received')
- seec.setCursorPos(2,5)
- seec.write('System Status')
- seec.setCursorPos(2,7)
- seec.write('Turbine:')
- seec.setCursorPos(2,8)
- if message["turbine1rpm"] >= 1725 then
- seec.setTextColor(colors.green)
- elseif message["turbine1rpm"] >= 800 then
- seec.setTextColor(colors.orange)
- else
- seec.setTextColor(colors.red)
- end
- seec.write('RPM: '..message["turbine1rpm"]..'')
- seec.setCursorPos(2,9)
- if message["turbine1Flow"] >= 1950 then
- seec.setTextColor(colors.green)
- elseif message["turbine1Flow"] >= 1000 then
- seec.setTextColor(colors.orange)
- else
- seec.setTextColor(colors.red)
- end
- seec.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
- seec.setCursorPos(2,10)
- if message["turbine1RFT"] >= 25000 then
- seec.setTextColor(colors.green)
- elseif message["turbine1RFT"] >= 14000 then
- seec.setTextColor(colors.orange)
- else
- seec.setTextColor(colors.red)
- end
- seec.write('Generation: '..message["turbine1RFT"]..' rf/t')
- seec.setCursorPos(2,11)
- if message["turbine1capacitor"] >= 900000 then
- seec.setTextColor(colors.green)
- elseif message["turbine1capacitor"] >= 400000 then
- seec.setTextColor(colors.orange)
- else
- seec.setTextColor(colors.red)
- end
- seec.write('Capacitor: '..message["turbine1capacitor"]..'')
- seec.setCursorPos(2,13)
- seec.setTextColor(colors.white)
- seec.write('Reactor:')
- seec.setCursorPos(2,14)
- if message["reactor1Temp"] <= 700 then
- seec.setTextColor(colors.green)
- elseif message["reactor1Temp"] <= 800 then
- seec.setTextColor(colors.orange)
- else
- seec.setTextColor(colors.red)
- end
- seec.write('Temp: '..message["reactor1Temp"]..'')
- seec.setCursorPos(2,15)
- if message["reactor1Steam"] >= 1950 then
- seec.setTextColor(colors.green)
- elseif message["reactor1Steam"] >= 1000 then
- seec.setTextColor(colors.orange)
- else
- seec.setTextColor(colors.red)
- end
- seec.write('Steam Pressure: '..message["reactor1Steam"]..'')
- seec.setCursorPos(2,16)
- if message["reactor1Fuel"] <= 0.05 then
- seec.setTextColor(colors.green)
- elseif message["reactor1Fuel"] <= 0.08 then
- seec.setTextColor(colors.orange)
- else
- seec.setTextColor(colors.red)
- end
- seec.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
- end
- while true do
- sleep(0)
- turbinemon(3,1,section2)
- turbinemon(2,2,section3)
- turbinemon(4,3,section4)
- turbinemon(5,4,section5)
- turbinemon(6,5,section6)
- turbinemon(7,6,section7)
- turbinemon(8,7,section8)
- turbinemon(9,8,section9)
- end
Advertisement
Add Comment
Please, Sign In to add comment