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

Password door not sending a signal

Started by beank, 20 May 2013 - 02:37 PM
beank #1
Posted 20 May 2013 - 04:37 PM
EDIT: Fixed the server problem…. commas and periods look alike when you are skimming the code….
However I am still having the off server problem….


Thanks for this… i am having a really tough time figuring out what is wrong with my code….

I am starting computercraft with a door (original i know, but its what i need….) an have followed the tutorial (almost) to the letter….

Here is the code that I am using:
while true do
term.clear()
term.setCursorPos(1, 1)
print("I'm 12 and what is this?")
input = read()
if input == "what?" then
redstone.setOutput("back", true)
sleep(2)
redstone.setOutput("back", false)
end
end

This for some reason is not working on a personal (non server world)…. the code is exicuting (typing the password makes the computer sleep for the two seconds) but the redstone signal is not being sent….

I have it built exactly as shown on the wiki page, but it is not sending the signla…. is it because im in creative or is there a bug somewhere?
Lyqyd #2
Posted 21 May 2013 - 02:45 PM
Split into new topic.
BlankTitle #3
Posted 23 May 2013 - 03:34 PM
Try having a block behind the computer and redstone on the other side of the block.
plazter #4
Posted 23 May 2013 - 05:48 PM
while true do
term.clear()
term.setCursorPos(1, 1)
print("I'm 12 and what is this?")
input = read()
if input == "what?" then
redstone.setOutput("back", true)
sleep(2)
redstone.setOutput("back", false)
end
end

Now i am wondering what side is the door at ?.
and if u want your code to "hide" your password you can do

input = read("*")

And it wil show as: "im 12 and what is this? ***** (what?)
lolsethlol #5
Posted 23 May 2013 - 07:58 PM
I'd assume there's a bug causing this not to work. However, I'll try to help.
First, make sure the redstone is actually behind the computer, touching the back side of it. If it is not touching the back side of the computer, it will not send the redstone signal. A computer cannot send a redstone signal to redstone it can not reach. I assume you know this, I'm just making sure to avoid that being the cause of the error.

Considering you probably want the computer sitting right next to the door, as it only being open for two seconds is rather short and hardly enough time to get through as it is, I'll paste some code that should work for the door being right next to a computer.


while true do
term.clear()
term.setCursorPos(1,1)
print("I'm 12 and what is this?")
input = read()
  if input =="what?" then
  rs.setOutput("right", true)
  sleep(2)
  rs.setOutput("right", false)
end
end
The setup for this should look like this:


Though if you'd prefer to use the method with the computer outputting redstone out the back, unless you want the computer to be in the way of the door, you will need to use some redstone, obviously. As I mentioned above, make sure it looks like this:




This one is

while true do
term.clear()
term.setCursorPos(1,1)
print("I'm 12 and what is this?")
input = read()
  if input =="what?" then
  rs.setOutput("back", true)
  sleep(2)
  rs.setOutput("back", false)
end
end

If this doesn't work, I'm not sure the issue.

Hope this helped!