SHARE
TWEET

Untitled

a guest May 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modem = peripheral.wrap("top")
  2. rednet.open("top")
  3.  
  4. local monitorID = 15
  5. local isOn = false
  6.  
  7. function WaitAndRelay()
  8.     while true do
  9.         local sender, message = rednet.receive()
  10.        
  11.         if string.find(message, "<on>") and isOn == false then
  12.             redstone.setOutput("front", true)
  13.             print("Received On call")
  14.             isOn = true
  15.         elseif string.find(message, "<off>") and isOn == true then
  16.             redstone.setOutput("front", false)
  17.             print("Received Off call")
  18.             isOn = false
  19.         else   
  20.             print(message)
  21.             rednet.send(monitorID, message)
  22.         end
  23.     end
  24. end
  25.  
  26. WaitAndRelay()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top