Advertisement
Golden-ifpass

Enable All Symbols (Manyland) - Paste into bookmark!

Mar 24th, 2020
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Enable All Symbols by MTP3!*/
  2.  
  3. /*
  4.     Usage:
  5.     1. Make a new bookmark
  6.     2. Paste in this code into the URL field:
  7.         javascript:$.getScript('https://pastebin.com/raw/B42UNcGu');
  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 speechVar; /* Speech userdata crap. */
  15. var typableKeys; /* Shift+Character thing, we're gonna mess with it a little. */
  16. var typableKeysMapping; /* Another Shift+Character thing, this is the part where it tells Manyland which key to type. */
  17. var noShiftChars; /* Some characters that have SHIFT disabled for whatever reason. */
  18. var talkFunction; /* Function that sends stuff to the function that says stuff */
  19. var sayFunction; /* Function says stuff */
  20.  
  21. var getMLcode = function () { /* Get Manyland's code! */
  22.     return new Promise((res, rej) => {
  23.         a = $.get("manyland.js?v=" + v), a.always(function() { /* JQuery that code! */
  24.             mlCode = a.responseText; /* Store it too! */
  25.             res(); /* Resolve. */
  26.         });
  27.     })
  28. };
  29.  
  30. var findFind = (begin, end) => { /* Find the text between 2 literal strings */
  31.     var pos1 = mlCode.indexOf(begin) + begin.length;
  32.     var pos2 = mlCode.indexOf(end, pos1);
  33.  
  34.     return mlCode.substring(pos1, pos2);
  35. };
  36.  
  37. var findMatch = (begin, end) => { /* Find the text between a literal string and a regex. */
  38.     var pos1 = mlCode.indexOf(begin) + begin.length;
  39.     var pos2 = mlCode.search(end, pos1);
  40.  
  41.     return mlCode.substring(pos1, pos2);
  42. };
  43.  
  44. (async () => {
  45.     await getMLcode(); /* Wait until we've dumped the code. */
  46.  
  47.     /* Find a couple obfuscated variable names that we're required to use. */
  48.  
  49.     speechVar = findMatch(
  50.         "new MapPlacementValidation;ig.game.",
  51.         /=new O[0-9]{1,4};ig\.game\.O[0-9]{1,4}=new BoostManager;/
  52.     );
  53.  
  54.     typableKeys = findFind(
  55.         "eight:\"8\",nine:\"9\",zero:\"0\"},",
  56.         ":\"one"
  57.     );
  58.  
  59.     noShiftChars = findFind(
  60.         "\"abcdefghijklmnopqrstuvwxyz\".split(\"\"),",
  61.         ":\",.-+?'\".split(\"\")"
  62.     );
  63.  
  64.     talkFunction = findFind(
  65.         "this.symbolPos.y+=20},draw:function(){},",
  66.         ":function(){if((!ig.game.instrumentDialog||"
  67.     );
  68.  
  69.     sayFunction = findFind(
  70.         "ig.input.pressed(\"forwardslash\")&&this.",
  71.         "(\"/\")}},O"
  72.     );
  73.  
  74.     /* Helpfully tell you what they currently are! */
  75.  
  76.     consoleref.log("speechVar = ig.game." + speechVar);
  77.     consoleref.log("typableKeys = ig.game." + speechVar + "." + typableKeys);
  78.     consoleref.log("typableKeysMapping = ig.game." + speechVar + "." + typableKeys + "Mapping");
  79.     consoleref.log("noShiftChars = ig.game." + speechVar + "." + noShiftChars);
  80.  
  81.     /* Make everything just a little easier to access. */
  82.  
  83.     speechVar = ig.game[speechVar];
  84.     typableKeysMapping = speechVar[typableKeys + "Mapping"];
  85.     typableKeys = speechVar[typableKeys];
  86.  
  87.     /* Quickly check if we've already done this. */
  88.  
  89.     if (typableKeys[2] == "three") {
  90.         ig.game.sounds.success.play();
  91.         consoleref.log("Already added symbols! Exiting.");
  92.         return;
  93.     };
  94.  
  95.     /* Add the grave to the list of keys that exist. */
  96.  
  97.     ig.KEY.GRAVE = 192;
  98.     ig.input.bind(ig.KEY.GRAVE, "grave");
  99.  
  100.     /* Weird funky string math */
  101.  
  102.     var funcString = "" + speechVar[talkFunction];
  103.     var getThisLength = ":ig.input.pressed(\"forwardslash\")&&this." + sayFunction + "(\"/\")}}";
  104.     funcString = funcString.substring(11, funcString.length - getThisLength.length);
  105.     funcString += ":ig.input.pressed(\"forwardslash\")?this." + sayFunction + "(\"/\")";
  106.     funcString += ":ig.input.pressed(\"backwardslash\")?this." + sayFunction + "(\"\\\\\")";
  107.     funcString += ":ig.input.pressed(\"grave\")?this." + sayFunction + "(\"`\")";
  108.     funcString += ":ig.input.pressed(\",\")?this." + sayFunction + "(\",\")";
  109.     funcString += ":ig.input.pressed(\".\")?this." + sayFunction + "(\".\")";
  110.     funcString += ":ig.input.pressed(\"-\")&&this." + sayFunction + "(\"-\")";
  111.     funcString += "}";
  112.  
  113.     speechVar[talkFunction] = new Function(funcString);
  114.  
  115.     /* Add a couple entries to the allowed keys.. */
  116.  
  117.     typableKeys.splice(2, 0, "three");
  118.     typableKeys.splice(3, 0, "four");
  119.     typableKeys.splice(5, 0, "six");
  120.     typableKeys.splice(6, 0, "seven");
  121.     typableKeys.push("grave");
  122.     typableKeys.push(",");
  123.     typableKeys.push(".");
  124.     typableKeys.push("-");
  125.  
  126.     speechVar[noShiftChars] = "+?'".split("");
  127.  
  128.     /* Replace Shift+2 to @, and set everything else to normal stuff. */
  129.  
  130.     typableKeysMapping.two = "@";
  131.     typableKeysMapping.three = "#";
  132.     typableKeysMapping.four = "$";
  133.     typableKeysMapping.six = "^";
  134.     typableKeysMapping.seven = "&";
  135.  
  136.     typableKeysMapping.grave = "~";
  137.     typableKeysMapping[","] = "<";
  138.     typableKeysMapping["."] = ">";
  139.     typableKeysMapping["-"] = "_";
  140.  
  141.     ig.game.sounds.success.play();
  142. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement