Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ID : 1
- local Reactor
- local Etat
- local Prod
- local Stor
- Reactor = peripheral.wrap("back")
- rednet.open("right")
- while true do
- local event, side, xPos, yPos = os.pullEvent()
- if (event == "modem_message") then
- local 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 == "On" then
- Reactor.setActive(true)
- elseif Message == "Off" then
- Reactor.setActive(false)
- end
- end
- sleep(0.1)
- end
Add Comment
Please, Sign In to add comment