package org.redalert1741.cageBot;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Robot extends IterativeRobot {
	final String defaultAuto = "Default";
	final String customAuto = "My Auto";
	String autoSelected;
	SendableChooser<String> chooser = new SendableChooser<>();

	/**
	 * This function is run when the robot is first started up and should be
	 * used for any initialization code.
	 */
	@Override
	public void robotInit() {
		chooser.addDefault("Default Auto", defaultAuto);
		chooser.addObject("My Auto", customAuto);
		SmartDashboard.putData("Auto choices", chooser);
	}

	/**
	 * This autonomous (along with the chooser code above) shows how to select
	 * between different autonomous modes using the dashboard. The sendable
	 * chooser code works with the Java SmartDashboard. If you prefer the
	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
	 * getString line to get the auto name from the text box below the Gyro
	 *
	 * You can add additional auto modes by adding additional comparisons to the
	 * switch structure below with additional strings. If using the
	 * SendableChooser make sure to add them to the chooser code above as well.
	 */
	@Override
	public void autonomousInit() {
		autoSelected = chooser.getSelected();
		// autoSelected = SmartDashboard.getString("Auto Selector",
		// defaultAuto);
		System.out.println("Auto selected: " + autoSelected);
	}

	/**
	 * This function is called periodically during autonomous
	 */
	@Override
	public void autonomousPeriodic() {
		switch (autoSelected) {
		case customAuto:
			// Put custom auto code here
			break;
		case defaultAuto:
		default:
			// Put default auto code here
			break;
		}
	}

	/**
	 * This function is called periodically during operator control
	 */
	@Override
	public void teleopPeriodic() {
	}

	/**
	 * This function is called periodically during test mode
	 */
	@Override
	public void testPeriodic() {
	}
}


@@ -77,2154 +77,198 @@
 ot;%0A
-import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;%0Aimport edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;%0A%0A/**%0A * The VM is configured to automatically run this class, and to call the%0A * functions corresponding to each mode, as described in the IterativeRobot%0A * documentation. If you change the name of this class or the package after%0A * creating this project, you must also update the manifest file in the resource%0A * directory.%0A */%0Apublic class Robot extends IterativeRobot %7B%0A%09final String defaultAuto = %22Default%22;%0A%09final String customAuto = %22My Auto%22;%0A%09String autoSelected;%0A%09SendableChooser%3CString%3E chooser = new SendableChooser%3C%3E();%0A%0A%09/**%0A%09 * This function is run when the robot is first started up and should be%0A%09 * used for any initialization code.%0A%09 */%0A%09@Override%0A%09public void robotInit() %7B%0A%09%09chooser.addDefault(%22Default Auto%22, defaultAuto);%0A%09%09chooser.addObject(%22My Auto%22, customAuto);%0A%09%09SmartDashboard.putData(%22Auto choices%22, chooser);%0A%09%7D%0A%0A%09/**%0A%09 * This autonomous (along with the chooser code above) shows how to select%0A%09 * between different autonomous modes using the dashboard. The sendable%0A%09 * chooser code works with the Java SmartDashboard. If you prefer the%0A%09 * LabVIEW Dashboard, remove all of the chooser code and uncomment the%0A%09 * getString line to get the auto name from the text box below the Gyro%0A%09 *%0A%09 * You can add additional auto modes by adding additional comparisons to the%0A%09 * switch structure below with additional strings. If using the%0A%09 * SendableChooser make sure to add them to the chooser code above as well.%0A%09 */%0A%09@Override%0A%09public void autonomousInit() %7B%0A%09%09autoSelected = chooser.getSelected();%0A%09%09// autoSelected = SmartDashboard.getString(%22Auto Selector%22,%0A%09%09// defaultAuto);%0A%09%09System.out.println(%22Auto selected: %22 + autoSelected);%0A%09%7D%0A%0A%09/**%0A%09 * This function is called periodically during autonomous%0A%09 */%0A%09@Override%0A%09public void autonomousPeriodic() %7B%0A%09%09switch (autoSelected) %7B%0A%09%09case customAuto:%0A%09%09%09// Put custom auto code here%0A%09%09%09break;%0A%09%09case defaultAuto:%0A%09%09default:%0A%09%09%09// Put default auto code here%0A%09%09%09break;%0A%09%09%7D%0A%09%7D%0A%0A%09/**%0A%09 * This function is called periodically during operator control%0A%09 */
+%0Apublic class Robot extends IterativeRobot%0A%7B%0A%09@Override%0A%09public void robotInit()%0A%09%7B%0A%0A%09%7D%0A%0A%09@Override%0A%09public void autonomousInit()%0A%09%7B%0A%0A%09%7D%0A%0A%09@Override%0A%09public void autonomousPeriodic()%0A%09%7B%0A%0A%09%7D%0A
 %0A%09@O
@@ -308,82 +308,16 @@
 ic()
- %7B
 %0A%09
-%7D%0A%0A%09/**%0A%09 * This function is called periodically during test mode%0A%09 */
+%7B%0A%0A%09%7D%0A
 %0A%09@O
@@ -355,10 +355,12 @@
 ic()
- %7B
+%0A%09%7B%0A
 %0A%09%7D%0A

remove garbage