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

2 questions, Redpower, and turning other computers off.

Started by tommynov1000, 25 August 2012 - 02:46 AM
tommynov1000 #1
Posted 25 August 2012 - 04:46 AM
I know that with rs.setBundledOutput("back", 0) turns off all wires. However, how do you turn off one wire at a time? What I'm trying to do is set something like: if I have quarries running, water pumps running, and oil refinierys running in buildcraft, how do I turn off one without turning off the rest (such as the quarries?) Also, how do I set that up in an "if-then-else" conditional. For example, I have a white insulated cable(hooked up to a light) running into a bundled cable that is attached to the right side of the computer. I have another cable running from the left of the computer using the same color cabled but without the bundled cable, hooked up to a lever. If the lever is transmitting a redstone signal, then it should go through the computer, and then set the output to true on the right side. However, if the lever is not transmitting a signal, how do I turn off the cable on the right side, but ONLY the white cable, instead of other ones like orange, purple, blue, etc by typing the function that I mentioned above?

Another question, is it possible to use a Command console? Meaning the Command Console turns computers that do a specific task that is assigned to that computer, and when I'm done with it, I can turn off the computer that I was using via Command Console. If so, how?

If this is confusing, please let me know, and I will try to clear it up some.
immibis #2
Posted 25 August 2012 - 07:20 AM
When you do rs.setBundledOutput you have to tell it which wires are on, and all the rest are off.

Example:
rs.setBundledOutput("back", colours.red + colours.blue + colours.green) – this turns on the red, green and blue wires, and turns off all the rest.

If the computer doing the turning-off is right next to the computer being turned off, you can use peripheral.call("side", "shutdown") or peripheral.wrap("side").shutdown().
Otherwise, it'll have to turn itself off with os.shutdown()
Cranium #3
Posted 25 August 2012 - 04:09 PM
You could also use colors.combine(color1,color2,etc) to add colors, and colors.subtract(color) to remove specific colors.
tommynov1000 #4
Posted 25 August 2012 - 04:42 PM
I realize that in order to turn redpower wires on is to use that coding in lua, and use it again to turn it off, but in a function –
if rs.getBundledInput("right", colors.white)
then rs.setBundledOutput("left", colors.white)
else…?
Now, some reason, there is no code, or even a boolean variable that you can add onto redpower wires so that you can turn things off. I have also discovered if I run this function, and then try to use: rs.setBundledOutput("left", 0) then infact it does not turn it off. The only way I have found out to turn it off is to do a reboot/shutdown the computer.

Well, I suppose it is better for me to sleep, rather than anything else. I saw in a video (link: http://www.youtube.com/watch?annotation_id=annotation_954030&feature=iv&src_vid=lmJzRODGx7M&v=ytKbXTo4hyI) at around 1:25, you can see in order to access the other computers, he had to go the computer on the far right and tell the computer to turn on x computer. I was wondering how I could do that.


What I'm trying to do is, in buildcraft and wireless redstone, is be use tubes and use gates on them (such as a OR gate on a waterproof pipe hooked up to a combustion engine, and I want to know what the status of the engine is) The problem I'm having is how to get the information from the tube, to the computer to tell me what its status is. So therefore, I would need a wireless transmitter hooked up the tubes OR gate, and the wireless reciever hooked up to a white insulated cable (when turned on, it represents that the engine is currently overheating, or is red) on the other end (of course, both transmitters are on the same frequency) and therefore when the engine is overheating, it sends a redstone signal through the white cable through the transmitter, through the reciever, and to the computer. The computer reads that signal from the white cable, saying it is overheating, and then I want to send another redstone signal through an orange cable, for example (also, imagine that I have many other engines hooked up using different colored cables for taking information to the computer, and other cables sending information to the engine to turn it off), to turn off the engine. Now, I've run into a problem where when the incoming information from the engine is no longer being recieved, it will NOT turn off the signal going to the engine to turn it off. How do I fix this?