real lb script

Shows the records Apex is hiding from you

目前为 2024-01-16 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name real lb script
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Shows the records Apex is hiding from you
  6. // @author lolol__
  7. // @match zombia.io
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=zombia.io
  9. // @license MIT
  10. // @grant none
  11. // ==/UserScript==
  12. document.querySelectorAll("select")[2].innerHTML = `<option value="24h">Today</option><option value="7d">This Week</option><option value="all">This Version</option><option value="real">All Time</option>`;
  13. function getRealLb() {
  14. let currentVersion = "110";
  15. let versions = 0;
  16. let lbData = [];
  17. let totalLbData = [];
  18. function getCurrentVersion(type = "wave") {
  19. if (currentVersion !== document.querySelectorAll("p")[2].innerText[8] + document.querySelectorAll("p")[2].innerText[10] + document.querySelectorAll("p")[2].innerText[12]) {
  20. fetch(`http://zombia.io/leaderboard/data?category=${type}&time=all&version=${currentVersion[0]}.${currentVersion[1]}.${currentVersion[2]}`).then(e => e.text()).then(e => {
  21. currentVersion = JSON.stringify(++currentVersion);
  22. lbData.push(JSON.parse(e));
  23. getCurrentVersion(type);
  24. });
  25. } else {
  26. fetch(`http://zombia.io/leaderboard/data?category=${type}&time=all`).then(e => e.text()).then(e => {
  27. lbData.push(JSON.parse(e));
  28. for (let x = 0; x < lbData.length; x++) {
  29. for (let y = 0; y < 10; y++) {
  30. totalLbData.push(lbData[x][y])
  31. totalLbData.sort((a, b) => b[type] - a[type]);
  32. }
  33. }
  34. lbData = [];
  35. for (let i = 0; i < 10; i++) lbData.push(totalLbData[i]);
  36. for (let x = 0; x < lbData.length; x++) {
  37. let text = "";
  38. let count = -1;
  39. for (let y = 0; y < lbData[x].players.length; y++) {
  40. ++count < lbData[x].players.length - 1 ? (count < lbData[x].players.length - 2 ? text += `${lbData[x].players[count]}, ` : text += `${lbData[x].players[count]} and `) : text += lbData[x].players[count];
  41. x < 10 && (document.getElementsByClassName("hud-intro-leaderboard-result")[x].innerHTML = `<strong style="float: left; font-style: italic;">${x + 1}</strong><div>${text} — <strong>${lbData[x][type].toLocaleString()}</strong></div>`);
  42. }
  43. }
  44. });
  45. }
  46. }
  47. getCurrentVersion(document.querySelectorAll("select")[1].value);
  48. }
  49. let run = false;
  50. setInterval(() => {
  51. if (document.querySelectorAll("select")[2].value == "real") {
  52. if (!run) {
  53. run = true;
  54. getRealLb();
  55. }
  56. } else {
  57. if (run) {
  58. run = false;
  59. }
  60. }
  61. }, 50);