Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TurbineA
- local TurbineB
- local TurbineC
- local TurbineP
- local TurbineO
- local Reactor
- local energy
- local max
- local perc
- local ReactorActive
- local TurbineA = peripheral.wrap("BigReactors-Turbine_5")
- local TurbineB = peripheral.wrap("BigReactors-Turbine_6")
- local TurbineP = peripheral.wrap("BigReactors-Turbine_7")
- local TurbineO = peripheral.wrap("BigReactors-Turbine_8")
- local TurbineC = peripheral.wrap("BigReactors-Turbine_9")
- local Reactor = peripheral.wrap("BigReactors-Reactor_4")
- rednet.open("back")
- while true do
- term.clear()
- term.setCursorPos(1,1)
- --Empfangene Nachricht
- local senderId, message, protocol = rednet.receive(EnergyCore)
- energy = message
- print("Derzeitiges Energylevel: ", energy)
- local senderId, message, protocol = rednet.receive(EnergyCore)
- max = message
- print("Maximum speicherbarer Energie: ", max)
- --Wie voll ist der Reactor
- perc = (math.floor(((energy*100)/max)))
- print()
- print ("Derzeitige % gespeicherter Energie: ",perc)
- --Signal an die Turbinen und Ractoren
- if perc==100 then
- TurbineA.setActive(false)
- TurbineB.setActive(false)
- TurbineC.setActive(false)
- TurbineP.setActive(false)
- TurbineO.setActive(false)
- Reactor.setAllControlRodLevels(100) end
- if perc>=95 and perc<100 then
- TurbineA.setActive(true)
- TurbineB.setActive(false)
- TurbineC.setActive(false)
- TurbineP.setActive(false)
- TurbineO.setActive(false)
- Reactor.setAllControlRodLevels(91) end
- if perc>=90 and perc<=94 then
- TurbineA.setActive(true)
- TurbineB.setActive(true)
- TurbineC.setActive(false)
- TurbineP.setActive(false)
- TurbineO.setActive(false)
- Reactor.setAllControlRodLevels(82) end
- if perc>=85 and perc<=89 then
- TurbineA.setActive(true)
- TurbineB.setActive(true)
- TurbineC.setActive(true)
- TurbineP.setActive(false)
- TurbineO.setActive(false)
- Reactor.setAllControlRodLevels(73) end
- if perc>=80 and perc<=84 then
- TurbineA.setActive(true)
- TurbineB.setActive(true)
- TurbineC.setActive(true)
- TurbineP.setActive(true)
- TurbineO.setActive(false)
- Reactor.setAllControlRodLevels(65) end
- if perc>=75 and perc<=79 then
- TurbineA.setActive(true)
- TurbineB.setActive(true)
- TurbineC.setActive(true)
- TurbineP.setActive(true)
- TurbineO.setActive(true)
- Reactor.setAllControlRodLevels(56) end
- if perc<=15 then
- TurbineA.setActive(true)
- TurbineB.setActive(true)
- TurbineC.setActive(true)
- TurbineP.setActive(true)
- TurbineO.setActive(true)
- Reactor.setAllControlRodLevels(56) end
- --SchlussSatz
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement