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
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextScale(0.5)
- 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(sections)
- sections.clear()
- sections.setTextColor(colors.yellow)
- sections.drawBorder('#','#','+')
- sections.setCursorPos(2,3)
- sections.setTextColor(colors.white)
- sections.write('Turbine - Reactor Bank '..bank..'')
- sections.setCursorPos(2,4)
- sections.write('Data Broadcast Received')
- sections.setCursorPos(2,5)
- sections.write('System Status')
- sections.setCursorPos(2,7)
- sections.write('Turbine:')
- sections.setCursorPos(2,8)
- if message["turbine1rpm"] >= 1725 then
- sections.setTextColor(colors.green)
- elseif message["turbine1rpm"] >= 800 then
- sections.setTextColor(colors.orange)
- else
- sections.setTextColor(colors.red)
- end
- sections.write('RPM: '..message["turbine1rpm"]..'')
- sections.setCursorPos(2,9)
- if message["turbine1Flow"] >= 1950 then
- sections.setTextColor(colors.green)
- elseif message["turbine1Flow"] >= 1000 then
- sections.setTextColor(colors.orange)
- else
- sections.setTextColor(colors.red)
- end
- sections.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
- sections.setCursorPos(2,10)
- if message["turbine1RFT"] >= 25000 then
- sections.setTextColor(colors.green)
- elseif message["turbine1RFT"] >= 14000 then
- sections.setTextColor(colors.orange)
- else
- sections.setTextColor(colors.red)
- end
- sections.write('Generation: '..message["turbine1RFT"]..' rf/t')
- sections.setCursorPos(2,11)
- if message["turbine1capacitor"] >= 900000 then
- sections.setTextColor(colors.green)
- elseif message["turbine1capacitor"] >= 400000 then
- sections.setTextColor(colors.orange)
- else
- sections.setTextColor(colors.red)
- end
- sections.write('Capacitor: '..message["turbine1capacitor"]..'')
- sections.setCursorPos(2,13)
- sections.setTextColor(colors.white)
- sections.write('Reactor:')
- sections.setCursorPos(2,14)
- if message["reactor1Temp"] <= 700 then
- sections.setTextColor(colors.green)
- elseif message["reactor1Temp"] <= 800 then
- sections.setTextColor(colors.orange)
- else
- sections.setTextColor(colors.red)
- end
- sections.write('Temp: '..message["reactor1Temp"]..'')
- sections.setCursorPos(2,15)
- if message["reactor1Steam"] >= 1950 then
- sections.setTextColor(colors.green)
- elseif message["reactor1Steam"] >= 1000 then
- sections.setTextColor(colors.orange)
- else
- sections.setTextColor(colors.red)
- end
- sections.write('Steam Pressure: '..message["reactor1Steam"]..'')
- sections.setCursorPos(2,16)
- if message["reactor1Fuel"] <= 0.05 then
- sections.setTextColor(colors.green)
- elseif message["reactor1Fuel"] <= 0.08 then
- sections.setTextColor(colors.orange)
- else
- sections.setTextColor(colors.red)
- end
- sections.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
- end
- end
- while true do
- sleep(0)
- id,message = rednet.receive()
- if id == 3 then
- turbinemon(section2)
- elseif id == 2 then
- turbinemon(2,2,section3)
- elseif id == 4 then
- turbinemon(4,3,section4)
- elseif id == 5 then
- turbinemon(5,4,section5)
- elseif id == 6 then
- turbinemon(6,5,section6)
- elseif id == 7 then
- turbinemon(7,6,section7)
- elseif id == 8 then
- turbinemon(8,7,section8)
- elseif id == 9 then
- turbinemon(9,8,section9)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment