Future_Crafter47

doorcontroller

May 12th, 2021 (edited)
519
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modem = peripheral.wrap("top")
  2. --local internal = peripheral.wrap("right")
  3. modem.open(9898)
  4.  
  5.  
  6. while true do
  7.     sleep(0)
  8.     local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  9.    
  10.     if message == "toggle" then
  11.         print("toggling door")
  12.        
  13.         if redstone.getInput("left") == false then
  14.             redstone.setOutput("left", true)
  15.         elseif redstone.getInput("left") == true then
  16.             redstone.setOutput("left", false)
  17.         end
  18.        
  19.     elseif message == "status" then
  20.         print("fetching redstone state")
  21.     elseif message == "lockdown" then
  22.         print("placeholder activated")
  23.     end
  24.    
  25. end
RAW Paste Data