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

How do you activate an redpower cable through an computer?

Started by Zambonie, 25 January 2013 - 12:22 PM
Zambonie #1
Posted 25 January 2013 - 01:22 PM
I am making an high-secured building using cc,buildcraft,and rp2.For the main enterance,I put rp2 lights to tell you if the pass is right or not.And to power those lights im using bundled and colored cables.And when I try to turn the cables on,it wont work.Is there a code to turn on the cables?
theoriginalbit #2
Posted 25 January 2013 - 01:25 PM
rs.setBundledOutput( <side>, <color> )

where side is a string of the side to output and color is the color of the cable ( i.e. colors.black colours.red colors.blue etc )
Cranium #3
Posted 25 January 2013 - 01:29 PM
Check out the Redstone API. It tells you exactly how we interact with redstone and redpower.
Orwell #4
Posted 25 January 2013 - 01:31 PM
And colors.combine() gives the value needed to set a combination of colors. Like:

rs.setBundledOutput("front", colors.combine( colors.red, colors.yellow ) )
theoriginalbit #5
Posted 25 January 2013 - 01:34 PM
And colors.combine() gives the value needed to set a combination of colors. Like:

rs.setBundledOutput("front", colors.combine( colors.red, colors.yellow ) )
And that can ever work to add onto the existing output colours by doing this:

rs.setBundledOutput("front", colors.combine( rs.getBudledInput("front"), colors.yellow ) )
Zambonie #6
Posted 25 January 2013 - 01:37 PM
Ok thanks guys.
Zambonie #7
Posted 25 January 2013 - 01:48 PM
Ok,One more question,How do you turn it off?
Orwell #8
Posted 25 January 2013 - 01:53 PM
Ok,One more question,How do you turn it off?


rs.setBundledOutput(side, 0)
;)/>
theoriginalbit #9
Posted 25 January 2013 - 02:01 PM
Also if you only want to turn off one colour but leave the rest on

rs.setBundledOutput( <side>, colors.subtract( rs.getBundledInput( <side> ), <color> ) )

where <side> and <color> have the appropriate values