Button Press Sequence to Trigger Event

Hello,
I am using an OSC app to send signals into TouchDesigner. I want to trigger an event when a specific sequence of signals is sent. For example, if I push buttons 1, 3, 2, in that order, I want to play a sound. Does anyone know how to do that?

Thanks,
Steven

my approach would be to have each button add a character to a string.
After each buttonpress you check the string.
When string == “132” play the sound

Thanks!