src/main/java/frc/robot/Robot.java
@Override
  public void autonomousInit() {
    autoIncrement = -1;
    autonConditionCompleted = true;
    autonTimer = new Timer();
    autonSpeedScalar = 1;
    currentAuton = AutonMode.NONE;
    ArrayList<AutonMode> tempAutonModes = new ArrayList<AutonMode>();
    ArrayList<String[]> tempAutonArguments = new ArrayList<String[]>();

    climbStopper.set(.5);
    //Spaghetti code:
    File autonInstructionFile = new File(Filesystem.getDeployDirectory().getPath() + "/autonInstructions.adil");
    try (Scanner input = new Scanner(autonInstructionFile)) {
      while (input.hasNext()) {
        String line = input.nextLine();
        Scanner lineInput = new Scanner(line); //another scanner so you can use the delimiters
        lineInput.useDelimiter(", ");
        tempAutonModes.add(AutonMode.valueOf(lineInput.next().toUpperCase()));
        ArrayList<String> tempLineArgs = new ArrayList<String>();
        for (String x : lineInput.tokens().collect(Collectors.toList())) {
          tempLineArgs.add(x);
        }
        tempAutonArguments.add(tempLineArgs.toArray(new String[0]));
        System.out.println(lineInput.tokens().toArray());
        lineInput.close();
      }
      input.close();
    } catch (FileNotFoundException e) {
      //Auto-Generated catch block :)
      e.printStackTrace();
    }

    autonModes = tempAutonModes.toArray(new AutonMode[0]); //TODO: check and see if you need to do `tempAutonModes.size()` instead of `0`
    autonArguments = tempAutonArguments.toArray(new String[0][0]);

    //CODE TO DEBUG THE PARSER
    //for (int i = 0; i < autonModes.length; i++) {
    // System.out.print(autonModes[i] + ": ");
    // for (String argument : autonArguments[i]) {
    // System.out.print(argument + ",[]");
    // }
    //
    // System.out.println();
    //}
  }
/**
   * 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
   *
   * <p>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.
   */
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.
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() {
    autoIncrement = -1;
    autonConditionCompleted = true;
    autonTimer = new Timer();
    autonSpeedScalar = 1;
    currentAuton = AutonMode.NONE;
    ArrayList<AutonMode> tempAutonModes = new ArrayList<AutonMode>();
    ArrayList<String[]> tempAutonArguments = new ArrayList<String[]>();
    climbStopper.set(.5);
    File autonInstructionFile = new File(Filesystem.getDeployDirectory().getPath() + "/autonInstructions.adil");
    try (Scanner input = new Scanner(autonInstructionFile)) {
      while (input.hasNext()) {
        String line = input.nextLine();
        Scanner lineInput = new Scanner(line); 
        lineInput.useDelimiter(", ");
        tempAutonModes.add(AutonMode.valueOf(lineInput.next().toUpperCase()));
        ArrayList<String> tempLineArgs = new ArrayList<String>();
        for (String x : lineInput.tokens().collect(Collectors.toList())) {
          tempLineArgs.add(x);
        }
        tempAutonArguments.add(tempLineArgs.toArray(new String[0]));
        System.out.println(lineInput.tokens().toArray());
        lineInput.close();
      }
      input.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    autonModes = tempAutonModes.toArray(new AutonMode[0]); 
    autonArguments = tempAutonArguments.toArray(new String[0][0]);
     System.out.println();
    }
  }
@ Override public void autonomousInit ( ) { autoIncrement = - 1 ; autonConditionCompleted = true ; autonTimer = new Timer ( ) ; autonSpeedScalar = 1 ; currentAuton = AutonMode . NONE ; ArrayList < AutonMode > tempAutonModes = new ArrayList < AutonMode > ( ) ; ArrayList < String [ ] > tempAutonArguments = new ArrayList < String [ ] > ( ) ; climbStopper . set ( .5 ) ; File autonInstructionFile = new File ( Filesystem . getDeployDirectory ( ) . getPath ( ) + "/autonInstructions.adil" ) ; try ( Scanner input = new Scanner ( autonInstructionFile ) ) { while ( input . hasNext ( ) ) { String line = input . nextLine ( ) ; Scanner lineInput = new Scanner ( line ) ; lineInput . useDelimiter ( ", " ) ; tempAutonModes . add ( AutonMode . valueOf ( lineInput . next ( ) . toUpperCase ( ) ) ) ; ArrayList < String > tempLineArgs = new ArrayList < String > ( ) ; for ( String x : lineInput . tokens ( ) . collect ( Collectors . toList ( ) ) ) { tempLineArgs . add ( x ) ; } tempAutonArguments . add ( tempLineArgs . toArray ( new String [ 0 ] ) ) ; System . out . println ( lineInput . tokens ( ) . toArray ( ) ) ; lineInput . close ( ) ; } input . close ( ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } autonModes = tempAutonModes . toArray ( new AutonMode [ 0 ] ) ; autonArguments = tempAutonArguments . toArray ( new String [ 0 ] [ 0 ] ) ; }
This autonomous (along with the chooser code above) shows how to select between different
 autonomous modes using the dashboard.
This autonomous ( along with the chooser code above ) shows how to select between different autonomous modes using the dashboard .
//Spaghetti code: //another scanner so you can use the delimiters //Auto-Generated catch block :) //TODO: check and see if you need to do `tempAutonModes.size()` instead of `0` //CODE TO DEBUG THE PARSER //for (int i = 0; i < autonModes.length; i++) { // System.out.print(autonModes[i] + ": "); // for (String argument : autonArguments[i]) { // System.out.print(argument + ",[]"); // } // // System.out.println(); //}