Re: why wont the code run when i press the bumper?
My guess is that this was for a competition setting, in the competition template, which is why you're using a task autonomous(). If so, that makes it an OK choice, rather than a function.
Regarding the code, try to remember what each part individually does. A while(true) loop will run forever, because the condition "true" is always true. Nothing like an if statement with a touch sensor will make it stop, because the outer while loop just keeps it running.
My advice is to check out some of the free tutorials we have that will build your programming knowledge: http://www.education.rec.ri.cmu.edu/pro ... index.html