Advertisement
Guest User

assist program

a guest
Oct 14th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.89 KB | None | 0 0
  1. 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",
  2. "https://www.vlr.gg/event/matches/560/champions-tour-asia-pacific-last-chance-qualifier/?series_id=all",
  3. "https://www.vlr.gg/event/matches/570/champions-tour-sea-stage-3-challengers-playoffs/?series_id=all",
  4. "https://www.vlr.gg/event/matches/559/champions-tour-emea-last-chance-qualifier",
  5. "https://www.vlr.gg/event/matches/561/champions-tour-south-america-last-chance-qualifier/?series_id=all",
  6. "https://www.vlr.gg/event/matches/536/champions-tour-brazil-stage-3-challengers-playoffs",
  7. "https://www.vlr.gg/event/matches/547/champions-tour-stage-3-emea-challengers-playoffs",
  8. "https://www.vlr.gg/event/matches/621/champions-tour-latam-stage-3-challengers-playoffs/?series_id=all",
  9. "https://www.vlr.gg/event/matches/578/champions-tour-north-america-stage-3-challengers-playoffs",
  10. "https://www.vlr.gg/event/matches/540/champions-tour-japan-stage-3-challengers-playoffs",
  11. "https://www.vlr.gg/event/matches/595/champions-tour-korea-stage-3-challengers/?series_id=1160",
  12. "https://www.vlr.gg/event/matches/398/champions-tour-latam-stage-2-challengers-finals",
  13. "https://www.vlr.gg/event/matches/366/champions-tour-brazil-stage-2-challengers-finals",
  14. "https://www.vlr.gg/event/372/champions-tour-north-america-stage-2-challengers-finals",
  15. "https://www.vlr.gg/event/matches/376/champions-tour-stage-2-emea-challengers-playoffs",
  16. "https://www.vlr.gg/event/matches/429/champions-tour-sea-stage-2-challengers-finals",
  17. "https://www.vlr.gg/event/matches/441/champions-tour-japan-stage-2-challengers-finals",
  18. "https://www.vlr.gg/event/matches/340/champions-tour-latam-stage-1-masters/?series_id=all",
  19. "https://www.vlr.gg/event/matches/338/champions-tour-brazil-stage-1-masters",
  20. "https://www.vlr.gg/event/matches/333/champions-tour-north-america-stage-1-masters",
  21. //"https://www.vlr.gg/event/matches/520/champions-tour-north-america-stage-3-challengers-1/?series_id=all",
  22. ///"https://www.vlr.gg/event/matches/291/champions-tour-north-america-stage-1-challengers-1/?series_id=all",
  23. //"https://www.vlr.gg/event/matches/306/champions-tour-north-america-stage-1-challengers-2/?series_id=all",
  24. //"https://www.vlr.gg/event/matches/324/champions-tour-north-america-stage-1-challengers-3/?series_id=all",
  25. //"https://www.vlr.gg/event/matches/370/champions-tour-north-america-stage-2-challengers-1/?series_id=all",
  26. //"https://www.vlr.gg/event/matches/371/champions-tour-north-america-stage-2-challengers-2/?series_id=all",
  27. //"https://www.vlr.gg/event/matches/520/champions-tour-north-america-stage-3-challengers-1/?series_id=all",
  28. //"https://www.vlr.gg/event/matches/576/champions-tour-north-america-stage-3-challengers-2/?series_id=all"};
  29. "https://www.vlr.gg/event/matches/342/champions-tour-turkey-stage-1-masters",
  30. "https://www.vlr.gg/event/334/champions-tour-europe-stage-1-masters",
  31. "https://www.vlr.gg/event/344/champions-tour-cis-stage-1-masters",
  32. "https://www.vlr.gg/event/matches/351/champions-tour-korea-stage-1-masters",
  33. "https://www.vlr.gg/event/matches/347/champions-tour-sea-stage-1-masters",
  34. "https://www.vlr.gg/event/matches/352/champions-tour-japan-stage-1-masters"};
  35. int[] scores = new int[23];
  36. int mostassists = 0;
  37. String malink = "";
  38.  
  39. void setup() {
  40. for (int i=0; i<scores.length; i++) {
  41. scores[i]=0;
  42. }
  43.  
  44. for (int i=0; i<eventurls.length; i++) {
  45. String[] rawm = loadStrings(eventurls[i]);
  46. String[] gameurls = new String[200];
  47. int numgames=0;
  48. for (int j=0; j<rawm.length; j++) {
  49. if (rawm[j].contains("a href")) {
  50. 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")) {
  51. gameurls[numgames] = "https://www.vlr.gg" + rawm[j].substring(rawm[j].indexOf("\"")+1, rawm[j].indexOf("\"", rawm[j].indexOf("\"")+1));
  52. println(gameurls[numgames]);
  53. numgames++;
  54. }
  55. }
  56. }
  57.  
  58. for (int j=0; j<numgames; j++) {
  59. //println(gameurls[j]);
  60. String[] raw = loadStrings(gameurls[j]);
  61. int maps = 0;
  62. int cl = 0; //cl=curline
  63. while (cl<raw.length) {
  64. while (cl<raw.length && !raw[cl].contains("vm-stats-game-header")) {
  65. cl++;
  66. }
  67. if (cl>=raw.length) {
  68. break;
  69. }
  70. cl+=2;
  71. int score1 = Integer.valueOf(trim(raw[cl].substring(raw[cl].indexOf(">")+1, raw[cl].indexOf("/")-1)));
  72. cl++;
  73. while (!raw[cl].contains("score")) {
  74. cl++;
  75. }
  76. int score2 = Integer.valueOf(trim(raw[cl].substring(raw[cl].indexOf(">")+1, raw[cl].indexOf("/")-1)));
  77. scores[min(score1, score2)]++;
  78. }
  79. cl=0;
  80. int count=0;
  81. String lastgameid="";
  82. while (cl<raw.length) {
  83. if(raw[cl].contains("data-game-id")) {
  84. lastgameid=raw[cl];
  85. }
  86. if(raw[cl].contains("vlr-assists")) {
  87. if(count>=0 && !raw[cl+1].contains("&") && !lastgameid.contains("all")) {
  88. int asts = Integer.valueOf(trim(raw[cl+1].substring(raw[cl+1].indexOf(">")+1, raw[cl+1].indexOf("/")-1)));
  89. if(asts>mostassists) {
  90. mostassists=asts;
  91. malink = gameurls[j];
  92. }
  93. } else {
  94. count++;
  95. }
  96. cl+=10;
  97. }
  98. cl++;
  99. }
  100. }
  101.  
  102. //String[] raw = loadStrings("https://www.vlr.gg/34948/supermassive-blaze-vs-acend-valorant-champions-tour-stage-3-masters-berlin-opening-a");
  103. //for(int i=0;i<vlr.length;i++) {
  104. // println(vlr[i]);
  105. //}
  106. }
  107.  
  108. //for (int i=0; i<scores.length; i++) {
  109. // println(i + ":\t" + scores[i]);
  110. //}
  111. //for (int i=0; i<scores.length; i++) {
  112. // print(scores[i] + ", ");
  113. //}
  114. println();
  115. println("Most Assists: "+mostassists);
  116. println(malink);
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement