Jump to content

Computercraft and electrical switching


Zorix

Recommended Posts

I have been trying to come up with a way to use Computercraft to turn on and off electrical service to different buildings on my map.  I have set up various buildings with a central power station and thought it would be interesting to use Computercraft to turn on and off electrical service to buildings.  I have already got an addon installed that allows me to use colored bundled cables and have tested with redstone activated devices without problem, but I can't figure a way to interrupt and complete an electrical connection.  I have tried pistons, different types of wiring, and many things I can't even remember.  Is this even feasible or am I wasting my time?

Thanks.

Link to comment
Share on other sites

Thanks for the suggestion.  From what I have read, the ability to access colored cables using redstone library has been removed so it's necessary to use a peripheral addon to accomplish this.  Is there another way?  I want the computer to control more signals than it has sides.  As for signals to energy cells, I like that idea but I was hoping to apply signal to a cable so I didn't have to have strange storage cell configurations.

Link to comment
Share on other sites

In case you want the Computers from ComputerCraft to handle redstonesignals you can use this:
 

Add a Bundled Cable at the side of the computer and write a script with this command

rs.setBundledOutput("left", colors.red)

"left" is the output side for example: top, bottom, back, left, right

 

"colors.red" ist the color inside the bundled cable just write instead of "red" the color you need.

 

If you want to set multiple colors with just one Bundled Cable then use

rs.setBundledOutput("left", colors.red + colors.white)

You need to stick a colored cable at the end of the bundled cable btw  :)

 

 

And if you want to turn the Redstonesignal off you need 

rs.setBundledOutput("left", colors.red + colors.white, 0)
Edited by allnet
Link to comment
Share on other sites

  • Discord Moderator

@allnet: What he was referring to is that as of ComputerCraft (CC) 1.6 the bundled cable API is no longer integrated into CC from other mods. What that means is that if Project Red and MineFactoryReloaded (MFR) want to be able to connect their colored/bundled/rednet cables to a CC computer and have the "rs.setBundledOutput()" function as expected then ProjectRed and MFR need to integrate the CC API directly. I am desperately hoping that a new build of MFR will be coming out soon with the CC-1.6 API properly integrated. I have heard that ProjectRed will be doing so shortly.

 

@Zorix: Since Tekkit is using CC 1.58 you can still use bundled cable (PR) or RedNet cable (MFR) with CC computers Bundled Cable API just fine.

Edited by plowmanplow
Link to comment
Share on other sites

I actually checked the apis directory under the rom directory and there is no redstone API and I could not get bundled cable signals to work at all no matter what type of cable used.  What I ended up using is this one http://www.minecraftforum.net/topic/2488603-164-project-red-peripheral/ which did work without a problem.  Not sure how anyone else has gotten it to work.  I have a feeling nobody has tried in a while.  As far as controlling the flow of electricty, using the energy cell described above worked flawlessly so I am very thankful for the excellent help from everyone.  Any other suggestions or ideas are appreciated too since I may not have thought of it.  Thanks.

Link to comment
Share on other sites

connect a rednet cable on the back of the computer thats stands on the floor and then put a redstone behind the rednet cable. A flat surface on the edge of the rednet cable toward the redstone will now apear and the cross on it will have the colour white. (You can change the colour on the cross to those you can see in the color api I linked in the earlier post)

Now enter the lua mode by typing lua and then enter in the computer.

now type the following code.

rs.setBundledOutput("back", 1)

"back" = the side of the computer

1 = colors.white (in the colors api, you can use the decimal number or the Color name

now the computer will send a redstone signal throu the rednet cable and lightup the redstone on the floor.

If you change the colour on the cross on the rednetcable to another colour the redstone will stop glowing since the computer only sends a redstone signal on the colors.white band throu the rednet cable.

Edited by badkruka
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...