Advertisement
taylantz

MC - CC wait for Redstone Signal

May 8th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. rednet.open("right")
  2. term.clear()
  3. term.setCursorPos(1, 1)
  4. print("Waiting ...")
  5. while true do
  6.     event, id, text = os.pullEvent()
  7.     if event == "rednet_message" then
  8.         print(id .. "> " .. text)
  9.         if text == "red_on" then
  10.             redstone.setOutput("left", true)
  11.             sleep(0.1)
  12.             redstone.setOutput("bottom", true)
  13.         end
  14.         if text == "red_off" then
  15.             redstone.setOutput("left", false)
  16.             sleep(0.1)
  17.             redstone.setOutput("bottom", false)
  18.         end
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement