Users Manual
CLASS 3
126
Tori secret safe Password Inconsistent coding
Now let's create a script when we receive the 'Password_error' broadcast. The primary function of the 'Receive
Password_error' script is to play the sound sensor twice at 0.2 second intervals when the entered number and
password do not match. Let’s go ahead and make them.
Make a script lie the one above.
When you receive a broadcast, delete all the items in the 'Code' list. It deletes all the input numbers so that they
are not left. Then save the '1' back to the 'Pointer' variable. Think of these two blocks as initializing to re-enter
numbers.
You should now play the sound sensor twice at 0.2 second intervals to let you know that the number entered does
not match the password. In this case, let’s use the block 'repeat ~ times'. It is a block that executes the internal
script as many times as the condition. Turn on the digital output 11 and activate the sound sensor. Wait 0.2
seconds and turn on the Digital 11 output to stop the sound sensor. And wait another 0.2 seconds. Repeat this
action twice and you'll hear a short 'beep beep' sound.
So, the script ‘Password_error received' is a script that initializes the password when the input number and
password do not match and tells the user if they have made a mistake.
Activity