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

Is there a way to make a computer stop outputing redstone a certain direction if it gets a seperate signal?

Started by MegamanPJ, 26 July 2012 - 02:11 AM
MegamanPJ #1
Posted 26 July 2012 - 04:11 AM
Hi. I have a computer that constantly outputs a redstone signal right. Is there a way to make it stop outputting right if it recieves a signal from the bottom?

current code
print ("Enter Password")
redstone.setOutput ("right", true)


I would like for it to stop output right when it recieves input from the bottom, thanks.
KingMachine #2
Posted 26 July 2012 - 06:02 AM
Yes actually.
You would have it do this…

print ("Enter Password")
while noBottomRed do
redstone.setOutput ("right", true)
if rs.getInput('bottom') then
noBottomRed == false
end--end if
end--end while
--rest of your code
MegamanPJ #3
Posted 29 July 2012 - 08:08 PM
Thanks. I'm brand new so I have no idea what I'm doing.
Thanks for your time.
MegamanPJ #4
Posted 30 July 2012 - 09:54 PM
It gives me an Error.

bios:206: [string "startup"]"5" '=' expected
Xenthera #5
Posted 30 July 2012 - 09:59 PM
It gives me an Error.

bios:206: [string "startup"]"5" '=' expected
Just change the == at line 5 to an =
MysticT #6
Posted 30 July 2012 - 10:12 PM
It should be:

rs.setOutput("right", true)
while not rs.getInput("bottom") do
  os.pullEvent("redstone")
end