Advertisement
icdb

[ComputerCraft] Remote Redstone (with PW) [receiver]

Sep 6th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. --Reciver
  2.  
  3. --Wirelessmodem (currently at the top)
  4. rednet.open("top")
  5. --startmode (true = on; false = off)
  6. starton=false
  7.  
  8. if starton == true then
  9.     redstone.setOutput("back", true)
  10. end
  11.  
  12. while true do
  13.     event, id, message, distance = os.pullEvent("rednet_message")
  14.     if message == "on" then
  15.         redstone.setOutput("back", true)
  16.     elseif message == "off" then
  17.         redstone.setOutput("back", false)
  18.     elseif message == "question" then
  19.         if redstone.getOutput("back") == true then
  20.             rednet.send(id,"on")
  21.         else
  22.             rednet.send(id,"off")
  23.         end
  24.     end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement