Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- // Setup our API id
- TBA.setID("Test", "Test description", "V1");
- // Make sure these settings are set to true
- Settings.GET_EVENT_MATCHES = true;
- Settings.GET_EVENT_ALLIANCES = true;
- // Get the event (in this case, we're using an event key, put you could also pull from a list of events with .getEvents(year))
- Event event = new TBA().getEvent("2016casd");
- Match[] matches = event.matches;
- for(int i = 0; i < matches.length; i++) {
- // The comp level variable should include an indentifier for whether it's practice, qualifying, or playoff, let me know if you need more help on this
- // Just print some general information, you can add more variables if you want, just use matches[i].var
- System.out.println("Match name: "+matches[i].comp_level + " Set number: "+matches[i].set_number+" Time (in ms): "+matches[i].time);
- }
- // Print out a list of item names + the red team's score for each of them. This just prints out the scores for one matches
- for(int j = 0; j < matches[0].redValues.length; j++) {
- System.out.println("Item: "+matches[0].scorableItems[j] + " Value: "+matches[0].redValues[j]);
- }
- // Print out alliance picks and declines
- for(int i = 0; i < event.alliances.length; i++) {
- System.out.println("Alliance name: "+event.alliances[i].name);
- System.out.println("Picks: "+event.alliances[i].picks[0]+","+event.alliances[i].picks[1]+","+event.alliances[i].picks[1]);
- }
- }
- Console output:
- Match name: f Set number: 1 Time (in ms): 1457222940
- Match name: f Set number: 1 Time (in ms): 1457223720
- Match name: f Set number: 1 Time (in ms): 1457224500
- Match name: qf Set number: 1 Time (in ms): 1457213400
- Match name: qf Set number: 1 Time (in ms): 1457215260
- Match name: qf Set number: 2 Time (in ms): 1457213820
- Match name: qf Set number: 2 Time (in ms): 1457215680
- Match name: qf Set number: 2 Time (in ms): 1457217720
- Match name: qf Set number: 3 Time (in ms): 1457214240
- Match name: qf Set number: 3 Time (in ms): 1457216100
- ...
- ... (and more matches)
- ...
- Item: foulCount Value: 0
- Item: position4crossings Value: 2
- Item: position1crossings Value: 2
- Item: capturePoints Value: 25
- Item: teleopChallengePoints Value: 15
- Item: teleopCrossingPoints Value: 30
- Item: autoBoulderPoints Value: 0
- Item: position3crossings Value: 2
- Item: towerEndStrength Value: 5
- Item: robot3Auto Value: Crossed
- Item: autoBouldersLow Value: 0
- Item: techFoulCount Value: 0
- Item: autoCrossingPoints Value: 20
- Item: foulPoints Value: 0
- Item: position2 Value: B_Ramparts
- Item: position3 Value: C_SallyPort
- Item: position4 Value: D_RockWall
- Item: teleopPoints Value: 120
- Item: position5 Value: A_ChevalDeFrise
- Item: robot2Auto Value: Reached
- Item: teleopDefensesBreached Value: true
- Item: teleopTowerCaptured Value: true
- Item: adjustPoints Value: 0
- Item: autoPoints Value: 22
- Item: teleopBouldersLow Value: 5
- Item: teleopBouldersHigh Value: 4
- Item: position5crossings Value: 0
- Item: towerFaceC Value: Challenged
- Item: totalPoints Value: 142
- Item: teleopBoulderPoints Value: 30
- Item: towerFaceB Value: Challenged
- Item: breachPoints Value: 20
- Item: position2crossings Value: 2
- Item: autoReachPoints Value: 2
- Item: autoBouldersHigh Value: 0
- Item: teleopScalePoints Value: 0
- Item: robot1Auto Value: Crossed
- Item: towerFaceA Value: Challenged
- Alliance name: Alliance 1
- Picks: frc5805,frc3882,frc3882
- Alliance name: Alliance 2
- Picks: frc3255,frc2485,frc2485
- Alliance name: Alliance 3
- Picks: frc4486,frc4984,frc4984
- Alliance name: Alliance 4
- Picks: frc5209,frc3128,frc3128
- Alliance name: Alliance 5
- Picks: frc3021,frc2102,frc2102
- Alliance name: Alliance 6
- Picks: frc2637,frc2443,frc2443
- Alliance name: Alliance 7
- Picks: frc5199,frc399,frc399
- Alliance name: Alliance 8
- Picks: frc1159,frc5137,frc5137
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement