It's advised that you don't use downloaded programs, because the owner of that may not present a documentation which you can use to make the appropriate adjustments to the program, so it can fit to your robot. Every developer has its own style, and because of this, usually, you won't be able to run other's application on your devices due to incompatibilities within the code. This is the reason why you only made the motors to run indefinitely.
I strongly suggest that you start from scratch and use Google to find tutorials or manuals that you can use. It's advise to start low and advance from there. First, I suggest that you make the motors to run, even for an indefinitely period of time. The objective is that you learn and understand what you are doing there, and not copy a program and run it.