Advertisement
cochise57

Untitled

Aug 16th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. bCableLeft = rs.getBundledInput("left")
  2. bCableRight = rs.getBundledInput("right")
  3.  
  4. -- Get a number representing colors on in both right and left bundled cables
  5. commonColors = bit.band(bCableLeft, bCableRight)
  6.  
  7. -- Get all the colors active on either right or left
  8. totalColors = bit.bor(bCableLeft, bCableRight)
  9.  
  10. -- Get the colors which are active on right, or left, but not both at the same time
  11. exclusiveColors = bit.bxor(bCableLeft, bCableRight)
  12.  
  13. -- Get the colors that are not active on the left
  14. offColorsA = bit.bnot(bCableLeft)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement