Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] eventurls = {"https://www.vlr.gg/event/matches/353/valorant-champions-tour-stage-2-masters-reykjavik", "https://www.vlr.gg/event/matches/466/valorant-champions-tour-stage-3-masters-berlin/?series_id=all",
- "https://www.vlr.gg/event/matches/560/champions-tour-asia-pacific-last-chance-qualifier/?series_id=all",
- "https://www.vlr.gg/event/matches/570/champions-tour-sea-stage-3-challengers-playoffs/?series_id=all",
- "https://www.vlr.gg/event/matches/559/champions-tour-emea-last-chance-qualifier",
- "https://www.vlr.gg/event/matches/561/champions-tour-south-america-last-chance-qualifier/?series_id=all",
- "https://www.vlr.gg/event/matches/536/champions-tour-brazil-stage-3-challengers-playoffs",
- "https://www.vlr.gg/event/matches/547/champions-tour-stage-3-emea-challengers-playoffs",
- "https://www.vlr.gg/event/matches/621/champions-tour-latam-stage-3-challengers-playoffs/?series_id=all",
- "https://www.vlr.gg/event/matches/578/champions-tour-north-america-stage-3-challengers-playoffs",
- "https://www.vlr.gg/event/matches/540/champions-tour-japan-stage-3-challengers-playoffs",
- "https://www.vlr.gg/event/matches/595/champions-tour-korea-stage-3-challengers/?series_id=1160",
- "https://www.vlr.gg/event/matches/398/champions-tour-latam-stage-2-challengers-finals",
- "https://www.vlr.gg/event/matches/366/champions-tour-brazil-stage-2-challengers-finals",
- "https://www.vlr.gg/event/372/champions-tour-north-america-stage-2-challengers-finals",
- "https://www.vlr.gg/event/matches/376/champions-tour-stage-2-emea-challengers-playoffs",
- "https://www.vlr.gg/event/matches/429/champions-tour-sea-stage-2-challengers-finals",
- "https://www.vlr.gg/event/matches/441/champions-tour-japan-stage-2-challengers-finals",
- "https://www.vlr.gg/event/matches/340/champions-tour-latam-stage-1-masters/?series_id=all",
- "https://www.vlr.gg/event/matches/338/champions-tour-brazil-stage-1-masters",
- "https://www.vlr.gg/event/matches/333/champions-tour-north-america-stage-1-masters",
- //"https://www.vlr.gg/event/matches/520/champions-tour-north-america-stage-3-challengers-1/?series_id=all",
- ///"https://www.vlr.gg/event/matches/291/champions-tour-north-america-stage-1-challengers-1/?series_id=all",
- //"https://www.vlr.gg/event/matches/306/champions-tour-north-america-stage-1-challengers-2/?series_id=all",
- //"https://www.vlr.gg/event/matches/324/champions-tour-north-america-stage-1-challengers-3/?series_id=all",
- //"https://www.vlr.gg/event/matches/370/champions-tour-north-america-stage-2-challengers-1/?series_id=all",
- //"https://www.vlr.gg/event/matches/371/champions-tour-north-america-stage-2-challengers-2/?series_id=all",
- //"https://www.vlr.gg/event/matches/520/champions-tour-north-america-stage-3-challengers-1/?series_id=all",
- //"https://www.vlr.gg/event/matches/576/champions-tour-north-america-stage-3-challengers-2/?series_id=all"};
- "https://www.vlr.gg/event/matches/342/champions-tour-turkey-stage-1-masters",
- "https://www.vlr.gg/event/334/champions-tour-europe-stage-1-masters",
- "https://www.vlr.gg/event/344/champions-tour-cis-stage-1-masters",
- "https://www.vlr.gg/event/matches/351/champions-tour-korea-stage-1-masters",
- "https://www.vlr.gg/event/matches/347/champions-tour-sea-stage-1-masters",
- "https://www.vlr.gg/event/matches/352/champions-tour-japan-stage-1-masters"};
- int[] scores = new int[23];
- int mostassists = 0;
- String malink = "";
- void setup() {
- for (int i=0; i<scores.length; i++) {
- scores[i]=0;
- }
- for (int i=0; i<eventurls.length; i++) {
- String[] rawm = loadStrings(eventurls[i]);
- String[] gameurls = new String[200];
- int numgames=0;
- for (int j=0; j<rawm.length; j++) {
- if (rawm[j].contains("a href")) {
- if (rawm[j].charAt(rawm[j].indexOf("a href")+9)>=48 && rawm[j].charAt(rawm[j].indexOf("a href")+9)<=57 && !rawm[j+30].contains("Upcoming") && !rawm[j].contains("tbd")) {
- gameurls[numgames] = "https://www.vlr.gg" + rawm[j].substring(rawm[j].indexOf("\"")+1, rawm[j].indexOf("\"", rawm[j].indexOf("\"")+1));
- println(gameurls[numgames]);
- numgames++;
- }
- }
- }
- for (int j=0; j<numgames; j++) {
- //println(gameurls[j]);
- String[] raw = loadStrings(gameurls[j]);
- int maps = 0;
- int cl = 0; //cl=curline
- while (cl<raw.length) {
- while (cl<raw.length && !raw[cl].contains("vm-stats-game-header")) {
- cl++;
- }
- if (cl>=raw.length) {
- break;
- }
- cl+=2;
- int score1 = Integer.valueOf(trim(raw[cl].substring(raw[cl].indexOf(">")+1, raw[cl].indexOf("/")-1)));
- cl++;
- while (!raw[cl].contains("score")) {
- cl++;
- }
- int score2 = Integer.valueOf(trim(raw[cl].substring(raw[cl].indexOf(">")+1, raw[cl].indexOf("/")-1)));
- scores[min(score1, score2)]++;
- }
- cl=0;
- int count=0;
- String lastgameid="";
- while (cl<raw.length) {
- if(raw[cl].contains("data-game-id")) {
- lastgameid=raw[cl];
- }
- if(raw[cl].contains("vlr-assists")) {
- if(count>=0 && !raw[cl+1].contains("&") && !lastgameid.contains("all")) {
- int asts = Integer.valueOf(trim(raw[cl+1].substring(raw[cl+1].indexOf(">")+1, raw[cl+1].indexOf("/")-1)));
- if(asts>mostassists) {
- mostassists=asts;
- malink = gameurls[j];
- }
- } else {
- count++;
- }
- cl+=10;
- }
- cl++;
- }
- }
- //String[] raw = loadStrings("https://www.vlr.gg/34948/supermassive-blaze-vs-acend-valorant-champions-tour-stage-3-masters-berlin-opening-a");
- //for(int i=0;i<vlr.length;i++) {
- // println(vlr[i]);
- //}
- }
- //for (int i=0; i<scores.length; i++) {
- // println(i + ":\t" + scores[i]);
- //}
- //for (int i=0; i<scores.length; i++) {
- // print(scores[i] + ", ");
- //}
- println();
- println("Most Assists: "+mostassists);
- println(malink);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement