Automatic stacking.

In my last two weeks of robotics I have tried many, many, ways to make my robot stack cones automatically. I have tried just if, else if, and else statements, if statements that change a switch-case situations, and two switch-case situations that are in the same task as well as separate tasks to try to make my chain bar and lift stack these cones automatically.
I didn’t want to ask because I am stubborn and wanted to do this all by myself. So now I am sad to say that I am asking all of my fellow programmers how in the world did you do it? Make two mechanisms work together to stack cones or cubes for Skyrise, with out having the two interfere with each other.
I am using a quad encoder on the chain bar and (yes) a scissor lift with a Sonar sensor to tell when the lift has reached the top of the stack. I am down for any suggestions.
Thanks - Nick from 5813E