Advertisement
Guest User

rednet_receive.lua

a guest
Feb 19th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1.     --modem=peripheral.wrap("back")
  2.     rednet.open("back")
  3.     print("ERROR: Sending computer isn't running startup program")
  4.     sleep(1)
  5. while true do
  6.     term.clear()
  7.     term.setCursorPos(1,1)
  8.     channel, message, returnChannel = rednet.receive()
  9.     term.clear()
  10.     term.setCursorPos(1,1)
  11.     print("Last Message Received: "..message)
  12.     if message == "start" then
  13.         redstone.setOutput("bottom",true)
  14.         redstone.setOutput("right",true)
  15.         sleep(1)
  16.     elseif message == "STOP" then
  17.         redstone.setOutput("bottom",false)
  18.         redstone.setOutput("right",false)
  19.         sleep(1)
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement