This script just clears some variables. I set it for the first play for the disc (kind of bad form, should usually start a disc with some video, even a few second black slug and have it jump to this.)
This next script is the action for each button on the "decoder" menu
Line 1 - Takes the SPRM 8 value (the value of the button that is pressed) and moves it into a GPRM
Line 2 - Divides the value so that it is 1-9 easier to use
Line 3 - Add 1 to action. If no buttons pressed before (Action is 0), Action becomes 1, etc.
Line 4-6 The code is basically 9876 in this example. So if action is 1 (which means Sequence is 0) make the button x 1000, etc.
Line 7 - puts the sequence together. For instance if Action = 1, Sequence was 0. Line 4 made the button equal to 1000 x the button. So if the user pressed 9, then the button value is 9000, this line makes sequence 9000. If Action = 2 (and the user pressed 9 the first time through), Sequence was 9000. Line 5 made the button equal to 100 x the button. So if the user pressed 8 the second time through, then the button value is 800 (from line 5) and this line makes sequence 9800.
Line 8-11 routes the script based on where the user is in pressing buttons determined by ACTION.
Line 12-13 User is sent to line 12 if the ACTION is 1, line 12 jumps back to the menu and the button if the sequence is 9000. Otherwise it means the user did not successfully pick the first number, so line 13 resets things
if they make it to Line 18, they get to see the track :)
There are many approaches to this, but this is one approach that is pretty straigthforward, easy to follow and can handle up to 5 numbers easily. Also note that you need to make sure your buttons are placed in order. For instance, if you make the button area around the "9" first then make a button area around the "1" next. The button that looks like "9" is in fact button 1. ALSO THIS IS NOT A ENCRYPTION METHOD TO PROTECT YOUR CONTENT. It is merely for fun :)
Project Files here