Users Manual
CLASS 3
142
Tori Secret Safe Problem 4 commentary
Now let's create a script when we receive the 'doorlock check' broadcast. The role of the 'when receive doorlock
check' script is to save the entered number as a password when the door is open and close the door. When the
door is opened, if the entered number matches the password, the close_door is broadcasted. When the door is
closed, the entered number and password are compared. If they match, the open_door is broadcasted.
Shall we make it?
Create a script like the one above.
First, when you receive the "doorlock check" broadcast, this script is executed. In this case, we use 'if ~ or' blocks.
This block can be found in the Controls tab. This block is similar to the 'if' block we learned earlier. '`or' block is
added to 'if~'. In other words. If it does not meet the condition of 'if', then the script contained inside ‘or’ will be
executed.
If the condition of 'if' is satisfied, the script contained in it is executed, and the script contained in ‘or’ is not
executed. If you meet the condition of 'door = open' in block 'if' block (if door is open), go inside 'if' and broadcast
'Save_Password' and 'Close_Door'. If you do not meet this condition, go inside ‘or’ block and broadcast 'Check_
Password'. 'Save_Password' is a script that will input number and save the passwordif the door is open. 'Close_
Door' means to close the door. 'Check_Password' is a script to open the door if the door is closed if the number
matches the password.
Now let’s go on to the next page and learn about the broadcasted scripts.
Commentary