Czogista

mAlert unlocker (SI)

Sep 15th, 2020 (edited)
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         mAlert unlocker (SI)
  3. // @namespace    http://czogi.usermd.net
  4. // @version      0.1
  5. // @description  Postać już nie zatrzymuje się przy mAlertach
  6. // @author       Czogi
  7. // @match        http://*.margonem.pl/
  8. // @grant        none
  9. // ==/UserScript==
  10. if (getCookie("interface") !== "ni")
  11.   g.loadQueue.push({
  12.     fun() {
  13.       window.hero.mClick = function (t) {
  14.         if (!((64 & hero.opt && !g.playerCatcher.follow) || g.lock.check())) {
  15.           var s = $("#ground").offset(),
  16.             i = (t.clientX - s.left) >> 5,
  17.             a = (t.clientY - s.top) >> 5;
  18.           hero.searchPath(i, a);
  19.         }
  20.       };
  21.  
  22.       window.hero.go = function (s) {
  23.         if (
  24.           ((g.lock.check() || g.menu) && (road = []),
  25.           g.lock.check() || g.menu || this.ml.length > 9)
  26.         )
  27.           return !1;
  28.         if (this.rx != this.x || this.ry != this.y) return !1;
  29.         hero.isMoving = 0;
  30.         var i = this.x,
  31.           a = this.y;
  32.         switch (s) {
  33.           case "W":
  34.             1 == this.dir ? (i = this.x - 1) : (this.dir = 1);
  35.             break;
  36.           case "E":
  37.             2 == this.dir ? (i = this.x + 1) : (this.dir = 2);
  38.             break;
  39.           case "N":
  40.             3 == this.dir ? (a = this.y - 1) : (this.dir = 3);
  41.             break;
  42.           case "S":
  43.             0 == this.dir ? (a = this.y + 1) : (this.dir = 0);
  44.             break;
  45.           case "R":
  46.             var e = road.length - 1;
  47.             i > road[e].x
  48.               ? (this.dir = 1)
  49.               : i < road[e].x
  50.               ? (this.dir = 2)
  51.               : a > road[e].y
  52.               ? (this.dir = 3)
  53.               : a < road[e].y && (this.dir = 0),
  54.               (i = road[e].x),
  55.               (a = road[e].y),
  56.               (road = road.slice(0, -1));
  57.         }
  58.         "R" != s && road.length && (road = []);
  59.         var h = !0;
  60.         if (this.ml.length) {
  61.           var r = this.ml[this.ml.length - 1].split(",");
  62.           Math.abs(i - parseInt(r[0])) + Math.abs(a - parseInt(r[1])) > 1 &&
  63.             ((h = !1), this.resetSteps());
  64.         }
  65.         if (
  66.           i >= 0 &&
  67.           a >= 0 &&
  68.           i < map.x &&
  69.           a < map.y &&
  70.           !isset(g.npccol[i + 256 * a]) &&
  71.           (!map.col || "0" == map.col.charAt(i + a * map.x)) &&
  72.           Math.abs(this.rx - this.x) + Math.abs(this.ry - this.y) < 0.3 &&
  73.           h
  74.         ) {
  75.           var o = i + "," + a;
  76.           if ((this.checkAgressiveNpcs(), this.x != i || this.y != a)) {
  77.             this.addStep(o);
  78.             var l =
  79.               null !== g.lastClickedTarget &&
  80.               $(g.lastClickedTarget).hasClass("npc");
  81.             !isset(g.gw[i + "." + a]) ||
  82.             2048 & this.opt ||
  83.             this.autoWalkLock ||
  84.             l
  85.               ? isset(g.gw[i + "." + a]) || (this.autoWalkLock = !1)
  86.               : ((t = o),
  87.                 setTimeout(function () {
  88.                   hero.autowalk();
  89.                 }, 500));
  90.           }
  91.           return (
  92.             (this.x = i), (this.y = a), isset(this.pet) && this.pet.update(), !0
  93.           );
  94.         }
  95.         return !1;
  96.       };
  97.     },
  98.   });
  99.  
Add Comment
Please, Sign In to add comment