Advertisement
Strudels

Finals Standings Easy Copy

Jun 27th, 2022
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Finals Standings Easy Copy
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @author       Rippy
  6. // @match        *://www.neopets.com/altador/colosseum/standings.phtml*
  7. // @grant        none
  8. // @require      http://code.jquery.com/jquery-latest.js
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     const currentPositions = [];
  15.     const rrOrder = [
  16.         "Meridell",
  17.         "Krawk Island",
  18.         "Brightvale",
  19.         "Maraqua",
  20.         "Virtupets",
  21.         "Darigan Citadel",
  22.         "Kreludor",
  23.         "Mystery Island",
  24.         "Moltara",
  25.         "Roo Island",
  26.         "Shenkuu",
  27.         "Tyrannia",
  28.         "Terror Mountain",
  29.         "Faerieland",
  30.         "Lost Desert",
  31.         "Haunted Woods",
  32.         "Altador",
  33.         "Kiko Lake"
  34.     ];
  35.     $(".ac-bracket-name").each(function(i, obj) {
  36.         currentPositions.push(obj.innerText);
  37.     });
  38.     const output = rrOrder.map((e) => (currentPositions.indexOf(e) + 1) % 6 || 6);
  39.     function copyData() {
  40.         if (!window.isSecureContext) {
  41.             alert("You need to be on HTTPS://www.neopets.com to use this feature!");
  42.             return;
  43.         }
  44.         navigator.clipboard.writeText(output.join("\n"));
  45.         alert("Copied standings to clipboard!");
  46.     }
  47.     $(".ac-grid-title").click(copyData);
  48. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement