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

Solar Panel Factory

Started by trout121234, 22 September 2012 - 03:08 AM
trout121234 #1
Posted 22 September 2012 - 05:08 AM
I want to make a solar panel factory, (tekkit) and I am using redstone engines, bundled cable, and insulated cable. I want to make several programs where I can fire off different colored cables with a continuous signal until prompted for it to stop. i.e. Magenta being hooked up to to the engine for pumping iron into a furnace etc.

Can anyone make programs that can do this? Or at the least walk me through it? (Any color you wish is ok)

[indent=1]~Trout[/indent]
Luanub #2
Posted 22 September 2012 - 06:08 AM
You will want to use the redstone and colors API's. Check them out on the wiki, and/or type help redpower from a terminal for more details/examples.

Here's something to get you started.

local c = 0 --declare c will use this for our colors. 0 == off, no colors on

--turn on lets say red
c = colors.combine(c, colors.red) -- add red to our colors
rs.setBundledOutput("back", c)  -- turn on the colors in c

-- now lets add blue to the mix
c = colors.combine(c, colors.blue)
rs.setBundledOutput("back", c)  -- since red was already added to c, this will now leave red on and turn on blue so both will be on.

--now lets turn off red, and leave blue on
c = colors.subtract(c, colors.red)
rs.setBundledOutput("back", c)

Get something started, and when/if you run into issues feel free to post again with your code.