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

Multiple bundle colors, tree output

Started by tehstone, 09 October 2012 - 03:26 PM
tehstone #1
Posted 09 October 2012 - 05:26 PM
I'm not entirely sure how to explain what I'm attempting to create but here goes:

For the factory my buddy and I are building, we need a huge number of potential signals that can be differentiated from one another. A computer console can have 6 different outputs, one for each side. So if each of these is a bundled cable that means 96 possible outputs. But we need more. So my question is, with a white bundled cable coming out of a computer, that splits into different colors of BUNDLED cable that then split off into different colors of cable, can I differentiate all of these outputs?

http://imgur.com/26efp

This is a basic example of what I want to accomplish. The white bundle splits into red and green bundle. Each of these 2 bundles splits into red and green cable. Can I separate the green/green signal from the red/green signal?

Edit: So I can demonstrate that I can code anything at all.

My initial attempt was to combine colors in alternating order, so i would do:

local red = colors.red
greenRed = colors.combine(colors.green, red)
redGreen = colors.combine(red, colors.green)
rs.setBundledOutput("back", greenRed)


The problem is, this turns on all 4 of the outputs because they're all running out of the initial white bundle coming out of the back of the computer.
Lyqyd #2
Posted 09 October 2012 - 07:57 PM
No, this cannot be done this way. Use a few computers to output signals and one computer to tell them which signals to output. Use rednet to pass commands from the main computer to the signal-sending computers. This uses one side of each for a rednet modem, but gains you an effectively limitless number of outputs.
tehstone #3
Posted 09 October 2012 - 10:09 PM
I understand what you're saying, but not the "how" of it. What rednet command should I use to make this happen? Thank you for your response!
Lyqyd #4
Posted 10 October 2012 - 01:08 AM
Check out any rednet tutorials in the Tutorials section of the forums.

Basically, each of the output computers uses rednet.receive() to wait for instructions. The controlling computer uses rednet.send() to send out the instructions. Your code is responsible for creating and interpreting the messages that you send, of course.
robhol #5
Posted 10 October 2012 - 06:40 AM
If you have 96 wires out, that makes for 79 228 162 514 264 337 593 543 950 336 (that is the real number, I swear I didn't faceroll :P/>/>) different combinations, and I can't really imagine needing any more. Maybe I'm missing something important.


79 228 162 514 264 337 593 543 950 336 = 2^96
    1 000 000 000 000 000 000 000 000 = 1 quadrillion


Seems like enough to me :3