See below
It will ask for a 1-4 character code (no spaces or symbols, just letters and numbers. (not 0)) Check the scripts for proof that it works without just waiting a bit then recalling what you entered, the only time it uses your input is to check if its guess is correct. Give credit if you would like to use this in another project.