Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ID : 1
- local ID, Message, Protocole
- local Reactor = peripheral.wrap("back")
- local Automode = false
- rednet.open("right")
- while true do
- ID, Message, Protocole = rednet.receive()
- if Message == "Etat?" then
- if Reactor.getActive() == true then
- rednet.send(2,"On","Etat")
- elseif Reactor.getActive() == false then
- rednet.send(2,"Off","Etat")
- end
- elseif Message == "Prod?" then
- rednet.send(2,Reactor.getEnergyProducedLastTick(),"Prod")
- elseif Message == "Stor?" then
- rednet.send(2,Reactor.getEnergyStored(),"Stor")
- elseif Message == "Fuel?" then
- rednet.send(2,Reactor.getFuelAmount(),"Fuel")
- elseif Message == "Temp?" then
- rednet.send(2,Reactor.getFuelTemperature(),"Temp")
- elseif Message == "On" then
- Reactor.setActive(true)
- Automode = false
- elseif Message == "Off" then
- Reactor.setActive(false)
- Automode = false
- elseif Message == "Auto" then
- print("auto")
- Automode = true
- elseif Message == "REBT" then
- os.reboot()
- end
- if Automode == true then
- if Reactor.getEnergyStored() < 1000000 then
- Reactor.setActive(true)
- elseif Reactor.getEnergyStored() > 9000000 then
- Reactor.setActive(false)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement