This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
SNWLeader's profile picture

How to add up BundleCable outs on one side?

Started by SNWLeader, 28 September 2012 - 10:50 PM
SNWLeader #1
Posted 29 September 2012 - 12:50 AM
I am used to having a single bundle one side for each program.
I need to know how to make the bundle outputs compile to one so that I can do stuff.


Lets say I have a bundled cable in the back. I want it to send blue out the back(which I know how to to.), but then I need to send red, I want to do that, but be able to still have blue, then I want green. I want to know how to do that.


someone please help.
NIN3 #2
Posted 29 September 2012 - 12:53 AM
Its rather easy, atually.

redstone.setBundledOutput("epic side goes here", colors.blue+colors.red)

I think you can replace the colors.stuff+colors.morestuff
with variables if you do please.
Cranium #3
Posted 29 September 2012 - 12:55 AM
You can use the colors.combine to add up, and colors.subtract to remove different colors. Use this as a helpful guide.
BrolofTheViking #4
Posted 29 September 2012 - 02:23 PM
If you use a variable to store the colors being used, like cranium said, you can then use the colors.combine to add a new color, without having to worry about knowing all of what is supposed to be outputted.
MysticT #5
Posted 29 September 2012 - 06:31 PM
You can also use rs.getBundledOutput to know wich colors are currently on, then add the new color with colors.combine and finally set the new output.
Like this:

rs.setBundledOutput("side", colors.combine(rs.getBundledOutput("side"), color))