Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turbine = peripheral.wrap("back")
- modem = peripheral.find("modem")
- ReactorStatus = 0
- print(ReactorStatus)
- sleep(10)
- while true do
- if turbine.getEnergyFilledPercentage()*100 <= 10 and ReactorStatus == 0 then
- modem.open(8)
- modem.transmit(8,8)
- term.clear()
- print("Low Energy Activating Reactor")
- modem.close(8)
- ReactorStatus = ReactorStatus + 1
- print(ReactorStatus)
- end
- if turbine.getEnergyFilledPercentage()*100 >= 90 and ReactorStatus ~= 0 then
- print(turbine.getEnergyFilledPercentage()*100)
- modem.open(9)
- modem.transmit(9,9)
- term.clear()
- print("High Energy,Deactivating Reactor")
- modem.close(9)
- ReactorStatus = ReactorStatus - 1
- print(ReactorStatus,"Deactivating")
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement