
Re: Doing multiple commands at once
Looking at your code, I assume you want to avoid waiting for the encoder to reach its target in the toby() function as well as the 2 second wait for your ball shooter.
There are several ways to tackle this and most of them involve tasks.
In ROBOTC, a task is analogous to a thread so that each task of the same priority time share the CPU. So if your main task contained the code for the drive train, you could have a separate task for the other functions which contain separate while loops or wait statements.
Note that you probably only want to get the joystick settings (the latest packet) from a single task (usually your main task) even if other tasks read the current joystick values. I did notice a bug in your code where you appear to be getting the joystick settings only once at the beginning of your main task before the endless loop. You want to move that into the top of the loop so that you can get the latest joystick values on every iteration of the loop.
That is, change this:
to something like this: