Shift + Middle-click teleport (with particle trail)

Allows you to teleport by holding shift and then middle-clicking. It also has a particle trail

当前为 2021-06-30 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Shift + Middle-click teleport (with particle trail)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Allows you to teleport by holding shift and then middle-clicking. It also has a particle trail
  6. // @author Eternity
  7. // @match http://manyland.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=manyland.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. function sparkle(position) {
  15. ig.game.websocket.wssend(ig.game.websocket.ws, "it", position)
  16. }
  17.  
  18. //Thank you MTP3!
  19. function whiteSparkle(a, b, c, d) {
  20. a = {
  21. x: Math.round(100 * a.x) / 100,
  22. y: Math.round(100 * a.y) / 100
  23. };
  24.  
  25. Math.round(1E3 * c.x);
  26. Math.round(1E3 * c.y);
  27. ig.game.websocket.wssend(ig.game.websocket.ws, "lc", {
  28. pos: a,
  29. end: b,
  30. vel: c,
  31. flp: d
  32. })
  33. }
  34.  
  35. async function loadObf() {
  36. if (typeof Deobfuscator == 'undefined')
  37. await $.getScript("https://cdn.jsdelivr.net/gh/parseml/many-deobf@latest/deobf.js")
  38. }
  39.  
  40. function main() {
  41. ig.game.player.kill = function() {};
  42. ig.game.decorator.collectSparkles = Deobfuscator.function(ig.game.decorator, ')/5,g,d=d/f,h=e/f,k=1;k<=', false);
  43. let oldUpdate = ig.game.update;
  44.  
  45. ig.game.update = function() {
  46. let result = oldUpdate.apply(this, arguments);
  47.  
  48. if (ig.input.state('shift') && ig.input.pressed('middleclick')) {
  49. let x = ig.game.screen.x + ig.input.mouse.x;
  50. let y = ig.game.screen.y + ig.input.mouse.y;
  51.  
  52. sparkle({x: ig.game.currentMapCoordsForMouse.x, y: ig.game.currentMapCoordsForMouse.y})
  53. ig.game.decorator.portalSparkles(ig.game.player.pos.x, ig.game.player.pos.y, 0, 0, 3);
  54. ig.game.decorator.portalSparkles(ig.game.player.pos.x, ig.game.player.pos.y, 0, 0, 6);
  55. whiteSparkle(ig.game.player.pos, {x: 0, y: 0}, {x: 0, y: 0}, 0);
  56.  
  57. ig.game.decorator.collectSparkles(ig.game.player, {x: x/ig.game.tileSize, y: y/ig.game.tileSize})
  58. ig.game.player.pos = {x: x, y: y -25}
  59. whiteSparkle(ig.game.player.pos, {x: 0, y: 0}, {x: 0, y: 0}, 0);
  60. }
  61.  
  62. return result;
  63. }
  64. }
  65.  
  66. !function loader() {
  67. let loading = setInterval(() => {
  68. if(typeof ig === "undefined") return
  69. else if(typeof ig.game === "undefined") return
  70. else if(typeof ig.game.screen === "undefined") return
  71. else if(ig.game.screen.x == 0) return
  72. clearInterval(loading)
  73. loadObf().then(() => {
  74. main();
  75. })
  76. }, 250)
  77. }()
  78. })();