Closed Techno11 closed 7 years ago
Make sure this setting is enabled:
Settings.FIND_TEAM_RANKINGS = true;
Ok. I see what I did wrong. Thanks
Still having problems, even with recommended fixes.
teamNumber = 1322;
Event e = tba.getEvent(eventKey, year);
int i = 0;
int rank = 0;
double auto = 0;
double goals = 0;
double rankScore = 0;
double defences = 0;
int playedMatches = 0;
double scaleChallenge = 0;
String record = "Unavaliable";
for(Team team : e.teams){
if(team.team_number == teamNumber){
rank = team.rank;
System.out.println(team.team_number);
auto = team.auto;
goals = team.goals;
rankScore = team.rankingScore;
defences = team.defense;
playedMatches = team.played;
scaleChallenge = team.scaleOrChallenge;
record = team.record;
break;
}
i++;
}
I probably am still doing something wrong?
Still get 0 for rank, however I get the proper team number when doing team.team_number;
Quick question, are you pulling a 2017 event?
Yes
Alright, so if that event hasn't occurred yet, scoring / ranking data can't be pulled, since no match data is available on the blue alliance.com. Are you pulling an event that hasn't started yet?
No, I am pulling data from 2017 miket. I tried during the event and afterwards.
Okay, so it's my bad. There is was a bug in the ranking parsing thing, plus the new 2017 items the server returns are a bit weird. You'll have to play around with it a bit and let me know if anything else isn't working. I got ranks and scoring working however. Go ahead and download a new .jar here: https://github.com/techguy9984/TBA-API/releases/tag/6
Event e = tba.getEvent(eventKey, year);
for(Team team : e.teams){
if(team.team_number == teamNumber){
break;
}
i++;
}
Team tr = e.teams[i];
System.out.print(tr.rank);
System.out.print(tr.rankingScore);
When printing ranking data, I get a 0, however when printing any other data I get the correct response (moto, name, etc). Is there something I am doing wrong?