Advertisement
Theory_of_Everything

5couplematching

Mar 14th, 2023
869
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const stk = document.querySelector('#textdiv>textarea').value.split('\n');
  2. let maxx = 0;
  3. let ans = 0;
  4. let is = 0;
  5. let res = '';
  6. console.log('使用完了记得刷新');
  7. const stl = stk.length;
  8. for (let i = 0; i < stl - 4; i++) {
  9.   for (let j = i + 1; j < stl - 3; j++) {
  10.     for (let k = j + 1; k < stl - 2; k++) {
  11.       for (let m = k + 1; m < stl - 1; m++) {
  12.         for (let n = m + 1; n < stl; n++) {
  13.           stk.push(`${stk[i]}\n${stk[j]}\n${stk[k]}\n${stk[m]}\n${stk[n]}`);
  14.         }
  15.       }
  16.     }
  17.   }
  18. }
  19. /**
  20.  * Get the score of a name.
  21.  */
  22. function chk() {
  23.   if (is === 0) {
  24.     if (stk.length > stl) {
  25.       const s = stk[stk.length - 1];
  26.       res = s + '\n\n';
  27.       document.querySelector('#textdiv>textarea').value = `!test!\n!\n\n${s}`;
  28.       document.querySelector('.goBtn').click();
  29.       is = 1;
  30.       stk.pop();
  31.     } else {
  32.       alert(`测试已完成\n最强5人组:\n${ans}${maxx}`);
  33.       clearInterval(si);
  34.     }
  35.   } else {
  36.     const a = cw().document.querySelectorAll('span.u');
  37.     const n = a.length;
  38.     if (n) {
  39.       if (a[n - 1].textContent.search(
  40.           /实力评估中...[1-9][1-9]%/) !== -1) {
  41.         const sum = cw().document.querySelectorAll('span.u')[10].textContent
  42.             .split(' ')[2];
  43.         const val = parseInt(sum);
  44.         if (val > maxx) {
  45.           maxx = val;
  46.           ans = res;
  47.         }
  48.         res += sum + '\n';
  49.         is = 0;
  50.         if (stk.length >= stl) {
  51.           console.log(res);
  52.         }
  53.       }
  54.     }
  55.   }
  56. }
  57. const si = setInterval(function() {
  58.   chk();
  59. }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement