Advertisement
Wired2coffee

Wireless Redstone Receiver

Mar 25th, 2012
1,190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. local tArgs = { ... }
  2. if #tArgs == 0 then
  3. print( "Usage: WRR <frequency>" )
  4. return
  5. end
  6. local input = tonumber(shell.resolve( tArgs[1] ))
  7. local lol = {"front","back","left","right","top","bottom"}
  8. for i = 1,6 do
  9. rednet.open(lol[i])
  10. end
  11. while true do
  12. local id, msg = rednet.receive()
  13. if string.sub(msg,1,10) == "WirelessRS" then
  14. if tonumber(string.sub(msg,11)) == input then
  15. for i = 1,6 do
  16. rs.setOutput(lol[i], true)
  17. end
  18. end
  19. end
  20. if string.sub(msg,1,11) == "WirelessRS0" then
  21. local hmm, hmmw = rednet.receive()
  22. if tonumber(string.sub(hmmw,11)) == input then
  23. for i = 1,6 do
  24. rs.setOutput(lol[i], false)
  25. end
  26. end
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement