Please check out this paper written by apalrd on beescript.
http://www.chiefdelphi.com/media/papers/2497
We implemented this a few years ago, and love the flexibility of beescript.
Our two ball script looks like this:
Code:
#Two Ball Autonomous
SET_ROLLER_SPEED 75
WAIT 100
ARM_MOVE 1
WAIT 300
SET_ROLLER_SPEED 25
WAIT 300
SET_ROLLER_SPEED 52
DRIVE_STRAIGHT 84 6000
SET_ROLLER_SPEED 0
WAIT 250
SHOOT
WAIT 250
SET_ROLLER_SPEED 90
WAIT 1550
SHOOT
STOP_ALL
Our drive straight command drives at 75% motor power, and has a gyro P loop to adjust motor powers so you actually drive straight. The first argument of the drive strait is the inches of travel by encoder counts. The second argument in the drive straight command is a timer override, so after 6 seconds, it will close and go to the shoot command.
We will be making public our github project in the next few weeks, after they clean up the commits from championship.