Advertisement
Golden-ifpass

Toggle Number Precision (Manyland) - Paste into bookmark!

Mar 31st, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Toggle Number Precision by MTP3!*/
  2.  
  3. /*
  4.     Usage:
  5.     1. Make a new bookmark
  6.     2. Paste this code into the URL field:
  7.         javascript:$.getScript('https://pastebin.com/raw/BPFkA9n5');
  8.     3. Click, you should hear a success bling!
  9.     4. ???
  10.     5. Profit
  11. */
  12.  
  13. var mlCode = ""; /* Stores all of Manyland's JS for future variable name extraction. */
  14. var numberShortener;
  15. var oldNumberShortener;
  16.  
  17. var getMLcode = function () { /* Get Manyland's code! */
  18.     return new Promise((res, rej) => {
  19.         a = $.get("manyland.js?v=" + v), a.always(function() { /* JQuery that code! */
  20.             mlCode = a.responseText; /* Store it too! */
  21.             res(); /* Resolve. */
  22.         });
  23.     });
  24. };
  25.  
  26. var findFind = (begin, end) => { /* Find the text between 2 literal strings */
  27.     var pos1 = mlCode.indexOf(begin) + begin.length;
  28.     var pos2 = mlCode.indexOf(end, pos1);
  29.  
  30.     return mlCode.substring(pos1, pos2);
  31. };
  32.  
  33. (async () => {
  34.     await getMLcode(); /* Wait until we've dumped the code. */
  35.  
  36.     /* Find an obfuscated variable name that we're required to use. */
  37.  
  38.     numberShortener = findFind(
  39.         '&&(this.arrows.left="<",this.arrows.right=">")},',
  40.         ":function(a){var b=a;if(1E3<=a){for("
  41.     );
  42.  
  43.     /* Helpfully tell you what it currently is! */
  44.  
  45.     consoleref.log("ig.game.strings[numberShortener] = ig.game.strings." + numberShortener);
  46.  
  47.     if (!oldNumberShortener) {
  48.         oldNumberShortener = ig.game.strings[numberShortener]; /* Old number shortener. */
  49.         ig.game.strings[numberShortener] = (a) => { /* New number shortener, which spoiler alert, just returns what's input. */
  50.             if (!a) {
  51.                 return "";
  52.             } else {
  53.                 return a.toString();
  54.             };
  55.         };
  56.     } else {
  57.         /* Perform a swap if both functions exist! */
  58.         var a = oldNumberShortener;
  59.         oldNumberShortener = ig.game.strings[numberShortener];
  60.         ig.game.strings[numberShortener] = a;
  61.     };
  62.  
  63.     ig.game.sounds.success.play();
  64. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement