Place in correct order event?

I have a cauldron/mixing minigame and I want the player to have to put the ingredients in the right order. How I have it working is that I have three ingredients (they're 3 events), and when you select an ingredient, a state is inflicted corresponding to that ingredient-- along with another state saying that they're holding something in general.

When they go over to the pot it runs a conditional branch on if the "Holding Something in General" state is on...
I was thinking that maybe I have a "Correct order" variable that keeps growing based on which ones you put in first, second, or third. And if you put them all in the correct order the variable will = 3 and you win. The problem is I don't know how to measure the order in which the player puts it in.

Thanks!
What do you want to happen if they choose the wrong order?
What do you want to happen if they choose the wrong order?
I want it to give you an alert that you didn't do it right (after you've put in three ingredients), fade out and then start over with all of the ingredients go back to where they started.
You could use a binary value assignment for this: ingredient one has value 1, two has value 2, and three has value 4. Then you can figure out what's been chosen already via conditional branch: if the variable is 1, you know they've only picked ingredient 1. If it's 5, they've picked 1 and 3. If it's 6, they've picked 2 and 3. So when you're eventing the interaction with a given ingredient you can make sure the variable has the value that it would if all the right ingredients had been picked so far.
then I suggest this:

On the place that gives the second ingredient, you check if the state for the first ingredient is already there - if yes, remove the first state and give the second state, if not give a "wrong" state.
Similiar with the third event for checking the second state.

Then the pot event just checks if the player has the wrong state or the third state.
Thanks you guys! I got it to work.

Original thread: https://forums.rpgmakerweb.com/threads/place-in-correct-order-event.75750/