real lb script

Shows the records Apex is hiding from you

  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. alert("This script is no longer needed, as Apex has made all time work for all versions now.");
  13. 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>`;
  14. function getRealLb() {
  15. let currentVersion = "110";
  16. let versions = 0;
  17. let lbData = [];
  18. let totalLbData = [];
  19. function getCurrentVersion(type = "wave") {
  20. if (currentVersion !== document.querySelectorAll("p")[2].innerText[8] + document.querySelectorAll("p")[2].innerText[10] + document.querySelectorAll("p")[2].innerText[12]) {
  21. fetch(`http://zombia.io/leaderboard/data?category=${type}&time=all&version=${currentVersion[0]}.${currentVersion[1]}.${currentVersion[2]}`).then(e => e.text()).then(e => {
  22. currentVersion = JSON.stringify(++currentVersion);
  23. lbData.push(JSON.parse(e));
  24. getCurrentVersion(type);
  25. });
  26. } else {
  27. fetch(`http://zombia.io/leaderboard/data?category=${type}&time=all`).then(e => e.text()).then(e => {
  28. lbData.push(JSON.parse(e));
  29. for (let x = 0; x < lbData.length; x++) {
  30. for (let y = 0; y < 10; y++) {
  31. totalLbData.push(lbData[x][y])
  32. totalLbData.sort((a, b) => b[type] - a[type]);
  33. }
  34. }
  35. lbData = [];
  36. for (let i = 0; i < 10; i++) lbData.push(totalLbData[i]);
  37. for (let x = 0; x < lbData.length; x++) {
  38. let text = "";
  39. let count = -1;
  40. for (let y = 0; y < lbData[x].players.length; y++) {
  41. ++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];
  42. 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>`);
  43. }
  44. }
  45. });
  46. }
  47. }
  48. getCurrentVersion(document.querySelectorAll("select")[1].value);
  49. }
  50. let run = false;
  51. setInterval(() => {
  52. if (document.querySelectorAll("select")[2].value == "real") {
  53. if (!run) {
  54. run = true;
  55. getRealLb();
  56. }
  57. } else {
  58. if (run) {
  59. run = false;
  60. }
  61. }
  62. }, 50);