Autostack program question

I want one button to lift the DR4B to a certain height, but I want the height to change after 3 cones/presses of the button. Is it possible for robotc to read how many times a button is pressed and reassign motor values after it is pressed so many times?