Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BigReactor = "BigReactors-Reactor_1" --Reactor Slot
- Monitor_Slot = "monitor_1" --Monitor Slot
- monitor = peripheral.wrap(Monitor_Slot)
- monitor.clear()
- monitor.setTextScale(1)
- term.setBackgroundColor(2048)
- local stored= "1000000" --Anzeige Max Interner Speicher
- local reactor = peripheral.wrap(BigReactor)
- local reactorTemp=reactor.getFuelTemperature()
- local reactorCasingTemp=reactor.getCasingTemperature()
- local reactorFuel=reactor.getFuelAmount()
- local reactorRFTick = reactor.getEnergyProducedLastTick()
- local reactorEnergy = reactor.getEnergyStored()
- local backgoundColor = 32
- local onoff = 1
- local PosX = 0
- local PosY = 0
- local AnAus = true
- local zeileX = 24
- local zeileY = 3
- function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function Update()
- local reactor = peripheral.wrap(BigReactor)
- local reactorTemp=reactor.getFuelTemperature()
- local reactorCasingTemp=reactor.getCasingTemperature()
- local reactorFuel=reactor.getFuelAmount()
- local reactorRFTick = reactor.getEnergyProducedLastTick()
- local reactorEnergy = reactor.getEnergyStored()
- reactorTempNew=math.ceil(reactorTemp)
- reactorCasingTempNew=math.ceil(reactorCasingTemp)
- reactorFuelNew=math.ceil(reactorFuel)
- reactorRFTickNew=math.ceil(reactorRFTick)
- reactorEnergyNew=math.ceil(reactorEnergy)
- local zeileX = 24
- local zeileY = 3
- OnOff()
- end
- function OnOff()
- if reactorOnline == true then
- AnAus = false
- Status = "An"
- elseif reactorOnline == false then
- AnAus = true
- Status = "Aus"
- end
- end
- function Zeile()
- term.setCursorPos(24,zeileY)
- zeileY = zeileY + 1
- end
- function Active()
- write("Online: ")
- reactorOnline = reactor.getActive()
- term.setCursorPos(24,3)
- if reactorOnline == true then
- backgoundColor = 32
- term.setTextColor(32)
- print(Status)
- term.setTextColor(32768)
- else
- backgoundColor = 16384
- term.setTextColor(16384)
- print(Status)
- term.setTextColor(32768)
- end
- end
- function Time()
- write(textutils.formatTime(os.time(), true))
- end
- function Header()
- term.setBackgroundColor(colors.lightBlue)
- monitor.setTextScale(1)
- write("Reactor Monitor ")
- monitor.setTextScale(1)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- write(" ")
- Time()
- print(" ")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- end
- function Screen()
- term.setBackgroundColor(colors.black)
- print(" ")
- term.setBackgroundColor(colors.white)
- Active()
- term.setBackgroundColor(colors.lightGray)
- write("Temp: ")
- term.setCursorPos(24,4)
- print(reactorTempNew)
- term.setBackgroundColor(colors.white)
- write("Casing: ")
- term.setCursorPos(24,5)
- print(reactorCasingTempNew)
- term.setBackgroundColor(colors.lightGray)
- write("Fuel: ")
- term.setCursorPos(24,6)
- print(reactorFuelNew)
- term.setBackgroundColor(colors.white)
- write("RF/Tick: ")
- term.setCursorPos(24,7)
- print(reactorRFTickNew)
- term.setBackgroundColor(colors.lightGray)
- print("Energie: ")
- write(reactorEnergyNew)
- print("/"..stored.."RF ")
- term.setBackgroundColor(colors.white)
- end
- function Run()
- Clear()
- Update()
- Header()
- Screen()
- sleep(0.5)
- end
- function Touch()
- event,side,PosX,PosY = os.pullEvent("monitor_touch")
- if PosY == 3 then
- reactor.setActive(AnAus)
- end
- end
- while true do
- parallel.waitForAny(Run,Touch)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement