getBundledOutput doesn't work like you think it does. It gives back a 16bit number in which each of the individual bits corresponds to a different wire being on or off, 1 or 0.
There is a method called colors.test() in which it tests if a number, usually 16 bit color code, contains another number, 16 bit color code.
if(colors.test(rs.getBundledOutput("right"),colors.green)) then
--#If the input from the right has the color green on.
end
You can use this to setup an if-else statement in which it tests for colors that are on/off.
Or you could of course use this to test for if the color is in the output and then save it.
Another way to do so, would be to grab the Output number and work in order backwards and modulus each number, starting at bit 16, and down to bit 1, if the modulus is 0, then the output contains that color. If it contains that number, subtract it from the total.
Edited by Dragon53535, 23 August 2016 - 02:36 PM.