xilyflob

ReactorStandby

Oct 7th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. primaryID = 48
  2. reactor = peripheral.wrap("bottom")
  3.  
  4. while true do
  5.     senderID, message, protocol = rednet.receive()
  6.     if senderID == primaryID and message == "startup" then
  7.         if reactor.getActive() == false then   
  8.             reactor.setActive(true)
  9.             rednet.send(primaryID, "OK")
  10.             print("Current State: 1")
  11.             else rednet.send(primaryID, "No go")
  12.         end
  13.     elseif senderID == primaryID and message == "shutdown" then
  14.         if reactor.getActive() == true then
  15.             reactor.setActive(false)
  16.             rednet.send(primaryID, "OK")
  17.             print("Current State: 0")
  18.             else rednet.send(primaryID, "No go")
  19.         end
  20.     end
  21. end
Add Comment
Please, Sign In to add comment