Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print('ReactorControl Engaged. View Monitor.')
- emptyflag=0
- offlineflag=0
- flashflag=0
- reactor=peripheral.wrap('back')
- monitor=peripheral.wrap('left')
- monitor.setTextScale(1)
- monitor.setBackgroundColor(colors.black)
- while true do
- monitor.clear()
- monitor.setTextColor(colors.white)
- monitor.setCursorPos(1,3)
- monitor.setTextColor(colors.yellow)
- monitor.write(math.floor(((reactor.getFuelAmount()/reactor.getFuelAmountMax())*100)+0.5)..'% Fuel')
- monitor.setCursorPos(11,3)
- monitor.setTextColor(colors.lightBlue)
- monitor.write(math.floor(((reactor.getWasteAmount()/reactor.getFuelAmountMax())*100)+0.5)..'% Waste')
- monitor.setCursorPos(1,1)
- monitor.setTextColor(colors.white)
- monitor.write('Reactor at:')
- monitor.setTextColor(colors.green)
- monitor.setCursorPos(13,1)
- monitor.write(''..(100-(reactor.getControlRodLevel(0)))..'%')
- monitor.setCursorPos(1,2)
- monitor.setTextColor(colors.white)
- monitor.write('RF per tick:')
- monitor.setCursorPos(13,2)
- if reactor.getEnergyProducedLastTick()>=500 and reactor.getEnergyProducedLastTick()<2000 then
- monitor.setTextColor(colors.orange)
- end
- if reactor.getEnergyProducedLastTick()>=2000 then
- monitor.setTextColor(colors.red)
- end
- monitor.write((math.floor(reactor.getEnergyProducedLastTick()+0.5))..'')
- monitor.setCursorPos(1,4)
- monitor.setTextColor(colors.orange)
- monitor.write('Warnings:')
- if flashflag==0 then
- flashflag=1
- if offlineflag==1 then
- monitor.setCursorPos(1,5)
- monitor.setTextColor(colors.lightGray)
- monitor.write('OFFLINE - Manual')
- end
- if emptyflag==1 then
- monitor.setCursorPos(1,5)
- monitor.setTextColor(colors.pink)
- monitor.write('OFFLINE - Fuel!!')
- end
- if emptyflag==0 and offlineflag==0 then
- monitor.setCursorPos(1,5)
- monitor.setTextColor(colors.yellow)
- monitor.write('ONLINE')
- end
- else
- flashflag=0
- monitor.setCursorPos(1,5)
- monitor.clearLine()
- end
- if reactor.getEnergyStored()<=9900000 then
- reactor.setAllControlRodLevels(0+(math.floor(reactor.getEnergyStored()/100000)))
- end
- if reactor.getFuelAmount()<=(reactor.getFuelAmountMax()/2) and offlineflag==0 then
- reactor.setAllControlRodLevels(100)
- reactor.setActive(false)
- emptyflag=1
- else
- emptyflag=0
- end
- if rs.getInput('right')==false and emptyflag==0 then
- reactor.setActive(true)
- offlineflag=0
- end
- if rs.getInput('right')==true and emptyflag==0 then
- reactor.setActive(false)
- reactor.setAllControlRodLevels(100)
- offlineflag=1
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement