choekstr

ComputerCraft EU Redstone Receiver

Feb 19th, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- https://pastebin.com/BiL3Fi8P
  2.     --modem=peripheral.wrap("back")
  3.     local channel = 0
  4.     local message = ""
  5.     local returnChannel = 0
  6.     rednet.open("back")
  7.     term.clear()
  8.     term.setCursorPos(1,1)
  9.     print("ERROR: Sending computer isn't running startup program")
  10. while true do
  11.     channel, message, returnChannel = rednet.receive()
  12.     term.clear()
  13.     term.setCursorPos(1,1)
  14.     print("Received Channel: "..channel)
  15.     print("Received Message: "..message)
  16.     --print("Received Return: "..returnChannel)
  17.     if message == "start" then
  18.         print("Sending redstone to: start")
  19.         redstone.setOutput("bottom",true)
  20.         redstone.setOutput("right",true)
  21.         sleep(1)
  22.     elseif message == "STOP" then
  23.         print("Sending redstone to: STOP")
  24.         redstone.setOutput("bottom",false)
  25.         redstone.setOutput("right",false)
  26.         sleep(1)
  27.     end
  28. end
Add Comment
Please, Sign In to add comment