ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: LinusKerman on Mar 11, 2021, 07:16 PM

Title: Passcode
Post by: LinusKerman on Mar 11, 2021, 07:16 PM
Hello, I'm linus, and Im trying to make a program which will send a redstone signal at the computer's back once you enter the correct password, obviously this being my first program it hasn't worked, so I would like some pointers

Pastebin code:
https://pastebin.com/QDtMVQ9i

Don't expect me to ask for much more help about anything, I just want to do this one off program for giggles
Title: Passcode
Post by: Lupus590 on Mar 11, 2021, 09:22 PM
So, points for improvement, I'll try to not hold back.

Title: Passcode
Post by: Sandgunslinger on May 29, 2021, 09:56 PM
Try using passattempt = read()
It should give a blank space for you to type input after you run the program; type in the password attempt and hit enter and it'll continue running the code after that.
All the stuff that Lupus590 said is right except you don't need a while true loop if you use read() unless you want to try entering the password again without having to run the program again.
Title: Passcode
Post by: QuickMuffin8782 on May 30, 2021, 12:07 AM
Quote from: Sandgunslinger on May 29, 2021, 09:56 PMTry using passattempt = read()
It should give a blank space for you to type input after you run the program; type in the password attempt and hit enter and it'll continue running the code after that.
All the stuff that Lupus590 said is right except you don't need a while true loop if you use read() unless you want to try entering the password again without having to run the program again.

Also, if you want to mask a character with bullets (with 'string.char()') or asterisks, use 'read("*")"