Advertisement
NanoCellMusic

CC Lights Receiver

Dec 31st, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. side = ("'Enter Side Of Network'")
  2. lightSide = ("'Enter Side Of Bundled Cable'")
  3. rednet.open(side)
  4. while true do
  5. id, message = rednet.receive()
  6. print(message)
  7. if message == ("on white") then
  8. rs.setBundledOutput(lightSide, colors.combine(redstone.getBundledOutput(lightSide),1))
  9. print("light1")
  10. end
  11. if message == ("on orange") then
  12. rs.setBundledOutput(lightSide, colors.combine(redstone.getBundledOutput(lightSide),2))
  13. print("light2")
  14. end
  15. if message == ("on magenta") then
  16. rs.setBundledOutput(lightSide, colors.combine(redstone.getBundledOutput(lightSide),4))
  17. print("light3")
  18. end
  19. if message == ("on blue") then
  20. rs.setBundledOutput(lightSide, colors.combine(redstone.getBundledOutput(lightSide),8))
  21. print("light4")
  22. end
  23. if message == ("on yellow") then
  24. rs.setBundledOutput(lightSide, colors.combine(redstone.getBundledOutput(lightSide),16))
  25. print("light5")
  26. end
  27. if message == ("off white") then
  28. rs.setBundledOutput(lightSide, colors.subtract(redstone.getBundledOutput(lightSide),1))
  29. print("light1")
  30. end
  31. if message == ("off orange") then
  32. rs.setBundledOutput(lightSide, colors.subtract(redstone.getBundledOutput(lightSide),2))
  33. print("light2")
  34. end
  35. if message == ("off magenta") then
  36. rs.setBundledOutput(lightSide, colors.subtract(redstone.getBundledOutput(lightSide),4))
  37. print("light3")
  38. end
  39. if message == ("off blue") then
  40. rs.setBundledOutput(lightSide, colors.subtract(redstone.getBundledOutput(lightSide),8))
  41. print("light4")
  42. end
  43. if message == ("off yellow") then
  44. rs.setBundledOutput(lightSide, colors.subtract(redstone.getBundledOutput(lightSide),16))
  45. print("light5")
  46. end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement