Facebook
From nieznany, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 169
  1. // ==UserScript==
  2. // @name         Bot na e2 test bez logout!!!
  3. // @version      1.54
  4. // @description  bot na e2 w trakcie rozbudowy, dziala na NI i SI
  5. // @author       You
  6. // @match        http://*.margonem.pl/
  7. // @match        https://*.margonem.pl/
  8. // @grant        none
  9. // ==/UserScript==
  10. function _instanceof(left, right) {
  11.         if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
  12.                 return right[Symbol.hasInstance](left);
  13.         } else {
  14.                 return left instanceof right;
  15.         }
  16. }
  17.  
  18. function _slicedToArray(arr, i) {
  19.         return (_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest());
  20. }
  21.  
  22. function _nonIterableRest() {
  23.         throw new TypeError("Invalid attempt to destructure non-iterable instance");
  24. }
  25.  
  26. function _iterableToArrayLimit(arr, i) {
  27.         var _arr = [];
  28.         var _n = true;
  29.         var _d = false;
  30.         var _e = undefined;
  31.         try {
  32.                 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  33.                         _arr.push(_s.value);
  34.                         if (i && _arr.length === i) break;
  35.                 }
  36.         } catch (err) {
  37.                 _d = true;
  38.                 _e = err;
  39.         } finally {
  40.                 try {
  41.                         if (!_n && _i["return"] != null) _i["return"]();
  42.                 } finally {
  43.                         if (_d) throw _e;
  44.                 }
  45.         }
  46.         return _arr;
  47. }
  48.  
  49. function _arrayWithHoles(arr) {
  50.         if (Array.isArray(arr)) return arr;
  51. }
  52.  
  53. function _typeof(obj) {
  54.         if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  55.                 _typeof = function _typeof(obj) {
  56.                         return typeof obj;
  57.                 };
  58.         } else {
  59.                 _typeof = function _typeof(obj) {
  60.                         return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  61.                 };
  62.         }
  63.         return _typeof(obj);
  64. }
  65.  
  66. function _classCallCheck(instance, Constructor) {
  67.         if (!_instanceof(instance, Constructor)) {
  68.                 throw new TypeError("Cannot call a class as a function");
  69.         }
  70. }
  71.  
  72. function _defineProperties(target, props) {
  73.         for (var i = 0; i < props.length; i++) {
  74.                 var descriptor = props[i];
  75.                 descriptor.enumerable = descriptor.enumerable || false;
  76.                 descriptor.configurable = true;
  77.                 if ("value" in descriptor) descriptor.writable = true;
  78.                 Object.defineProperty(target, descriptor.key, descriptor);
  79.         }
  80. }
  81.  
  82. function _createClass(Constructor, protoProps, staticProps) {
  83.         if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  84.         if (staticProps) _defineProperties(Constructor, staticProps);
  85.         return Constructor;
  86. }
  87. (function() {
  88.         var a =
  89.                 /*#__PURE__*/
  90.                 (function() {
  91.                         "use strict";
  92.  
  93.                         function a(_a, b, c, d, e, f) {
  94.                                 _classCallCheck(this, a);
  95.                                 (this.width = b), (this.height = c), (this.collisions = this.parseCollisions(_a, b, c)), (this.additionalCollisions = f || {}), (this.start = this.collisions[d.x][d.y]), (this.end = this.collisions[e.x][e.y]), (this.start.beginning = !0), (this.start.g = 0), (this.start.f = this.heuristic(this.start, this.end)), (this.end.target = !0), (this.end.g = 0),
  96.                                 this.addNeighbours(), (this.openSet = []), (this.closedSet = []),
  97.                                         this.openSet.push(this.start);
  98.                         }
  99.                         _createClass(a, [{
  100.                                 key: "parseCollisions",
  101.                                 value: function parseCollisions(a, c, d) {
  102.                                         var e = Array(c);
  103.                                         for (var f = 0; f < c; f++) {
  104.                                                 e[f] = Array(d);
  105.                                                 for (var g = 0; g < d; g++) {
  106.                                                         e[f][g] = new b(f, g, "0" !== a.charAt(f + g * c));
  107.                                                 }
  108.                                         }
  109.                                         return e;
  110.                                 }
  111.                         }, {
  112.                                 key: "addNeighbours",
  113.                                 value: function addNeighbours() {
  114.                                         for (var _a2 = 0; _a2 < this.width; _a2++) {
  115.                                                 for (var _b = 0; _b < this.height; _b++) {
  116.                                                         this.addPointNeighbours(this.collisions[_a2][_b]);
  117.                                                 }
  118.                                         }
  119.                                 }
  120.                         }, {
  121.                                 key: "addPointNeighbours",
  122.                                 value: function addPointNeighbours(a) {
  123.                                         var _ref = [a.x, a.y],
  124.                                                 b = _ref[0],
  125.                                                 c = _ref[1],
  126.                                                 d = [];
  127.                                         0 < b && d.push(this.collisions[b - 1][c]),
  128.                                                 0 < c && d.push(this.collisions[b][c - 1]),
  129.                                                 b < this.width - 1 && d.push(this.collisions[b + 1][c]),
  130.                                                 c < this.height - 1 && d.push(this.collisions[b][c + 1]), (a.neighbours = d);
  131.                                 }
  132.                         }, {
  133.                                 key: "anotherFindPath",
  134.                                 value: function anotherFindPath() {
  135.                                         for (; 0 < this.openSet.length;) {
  136.                                                 var _a3 = this.getLowestF(),
  137.                                                         _b2 = this.openSet[_a3];
  138.                                                 if (_b2 === this.end) return this.reconstructPath();
  139.                                                 this.openSet.splice(_a3, 1), this.closedSet.push(_b2);
  140.                                                 var _iteratorNormalCompletion = true;
  141.                                                 var _didIteratorError = false;
  142.                                                 var _iteratorError = undefined;
  143.                                                 try {
  144.                                                         for (var _iterator = _b2.neighbours[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  145.                                                                 var _a4 = _step.value;
  146.                                                                 if (this.closedSet.includes(_a4)) continue;
  147.                                                                 else {
  148.                                                                         var c = _b2.g + 1;
  149.                                                                         var d = !1;
  150.                                                                         this.end != this.collisions[_a4.x][_a4.y] && (this.openSet.includes(_a4) || _a4.collision || this.additionalCollisions[_a4.x + 256 * _a4.y]) ? c < _a4.g && !_a4.collision && (d = !0) : (this.openSet.push(_a4), (_a4.h = this.heuristic(_a4, this.end)), (d = !0)),
  151.                                                                                 d && ((_a4.previous = _b2), (_a4.g = c), (_a4.f = _a4.g + _a4.h));
  152.                                                                 }
  153.                                                         }
  154.                                                 } catch (err) {
  155.                                                         _didIteratorError = true;
  156.                                                         _iteratorError = err;
  157.                                                 } finally {
  158.                                                         try {
  159.                                                                 if (!_iteratorNormalCompletion && _iterator.return != null) {
  160.                                                                         _iterator.return();
  161.                                                                 }
  162.                                                         } finally {
  163.                                                                 if (_didIteratorError) {
  164.                                                                         throw _iteratorError;
  165.                                                                 }
  166.                                                         }
  167.                                                 }
  168.                                         }
  169.                                 }
  170.                         }, {
  171.                                 key: "getLowestF",
  172.                                 value: function getLowestF() {
  173.                                         var a = 0;
  174.                                         for (var _b3 = 0; _b3 < this.openSet.length; _b3++) {
  175.                                                 this.openSet[_b3].f < this.openSet[a].f && (a = _b3);
  176.                                         }
  177.                                         return a;
  178.                                 }
  179.                         }, {
  180.                                 key: "reconstructPath",
  181.                                 value: function reconstructPath() {
  182.                                         var a = [];
  183.                                         for (var _b4 = this.end; _b4 !== this.start;) {
  184.                                                 a.push(_b4), (_b4 = _b4.previous);
  185.                                         }
  186.                                         return a;
  187.                                 }
  188.                         }, {
  189.                                 key: "heuristic",
  190.                                 value: function heuristic(a, b) {
  191.                                         return Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
  192.                                 }
  193.                         }]);
  194.                         return a;
  195.                 })();
  196.         var b = function b(a, _b5, c) {
  197.                 "use strict";
  198.                 _classCallCheck(this, b);
  199.                 (this.x = a), (this.y = _b5), (this.collision = c), (this.g = 1e7), (this.f = 1e7), (this.neighbours = []), (this.beginning = !1), (this.target = !1), (this.previous = void 0);
  200.         };
  201.         new /*#__PURE__*/ ((function() {
  202.                 "use strict";
  203.  
  204.                 function _class() {
  205.                         _classCallCheck(this, _class);
  206.                         (this.storage = JSON.parse(localStorage.getItem("adi-bot-storage")) || {
  207.                                 x: 0,
  208.                                 y: 0,
  209.                                 name: "",
  210.                                 minimalized: !1
  211.                         }), (this.interface = "object" == _typeof(window.Engine) ? "ni" : "object" == _typeof(window.g) ? "si" : "none"), (this.lootfilterSettings = JSON.parse(localStorage.getItem("adi-bot-lootfilterSettings123")) || {
  212.                                 stat: {
  213.                                         all: {
  214.                                                 translation: "\u0141ap wszystkie itemki",
  215.                                                 active: !0
  216.                                         },
  217.                                         gold: {
  218.                                                 translation: "Z\u0142oto",
  219.                                                 active: !0
  220.                                         },
  221.                                         quest: {
  222.                                                 translation: "Questowe",
  223.                                                 active: !0
  224.                                         },
  225.                                         runes: {
  226.                                                 translation: "Runy",
  227.                                                 active: !0
  228.                                         },
  229.                                         unique: {
  230.                                                 translation: "Unikaty",
  231.                                                 active: !0
  232.                                         },
  233.                                         heroic: {
  234.                                                 translation: "Heroiki",
  235.                                                 active: !0
  236.                                         },
  237.                                         legendary: {
  238.                                                 translation: "Legendy",
  239.                                                 active: !0
  240.                                         }
  241.                                 },
  242.                                 names: []
  243.                         }), (this.QuickGroupSettings = JSON.parse(localStorage.getItem("adi-bot-QuickGroupSettings12")) || {
  244.                                 adding: {
  245.                                         translation: "Automatycznie dodawaj do grupy znaj/klan",
  246.                                         active: !0
  247.                                 },
  248.                                 accepting: {
  249.                                         translation: "Automatycznie przyjmuj zaproszenia do grupy",
  250.                                         active: !0
  251.                                 },
  252.                                 reSendingMessage: {
  253.                                         translation: "Automatycznie odpisuj innym graczom",
  254.                                         active: !0
  255.                                 }
  256.                         }), (this.npcToKillId = void 0), (this.lastAttackTimestamp = this.timeStamp), (this.timerData = JSON.parse(this.getCookie("adi-bot-timer")) || {}), (this.refreshTime = [3, 6]), (this.delayToRelog = 40), (this.waitForNpcRespawn = 120), (this.randomAnswers = ["nie interesuje mnie to", "kiedy\u015B to by\u0142o, nie to co tera", "to fajnie", "nom", "super", "co ?", "interesuj\u0105ce", "bombowo", "Bardzo si\u0119 ciesz\u0119.", "Xd", "co", "co.?", "co?", "xD", "xd", "ehhhhhh", "heh", "fajnie fajnie :]"]), (this.answersBeforeAddingToEnemies = ["dobra, do wrog\xF3w cie daje :)", "papapappapapapap", "nara.", "w ty\u0142ku cie mam gosciu, nara", "papapapp", "nara kole\u017Cko", "lecisz do wrogow :P", "narka ;)", "hehehehhe, narq", "ej jeste\u015B?", "haha. ;)"]), (this.messagesInc = JSON.parse(localStorage.getItem("adi-bot-messages")) || {}), (this.isHealing = !1), (this.isActuallySendingMessage = !1), (this.startInctementingLagRefresher = !1), (this.incrementValue = 0),
  257.                         this.init();
  258.                 }
  259.                 _createClass(_class, [{
  260.                         key: "getNpcColsNI",
  261.                         value: function getNpcColsNI() {
  262.                                 var a = {};
  263.                                 var _arr = Object.values(this.npcs);
  264.                                 for (var _i = 0; _i < _arr.length; _i++) {
  265.                                         var _arr$_i = _arr[_i],
  266.                                                 _b6 = _arr$_i.x,
  267.                                                 c = _arr$_i.y;
  268.                                         a[_b6 + 256 * c] = !0;
  269.                                 }
  270.                                 return a;
  271.                         }
  272.                 }, {
  273.                         key: "chatParser",
  274.                         value: function chatParser() {
  275.                                 var _this = this;
  276.                                 "ni" === this.interface && window.API.addCallbackToEvent("newMsg", function(_ref2) {
  277.                                         var _ref3 = _slicedToArray(_ref2, 2),
  278.                                                 a = _ref3[0],
  279.                                                 b = _ref3[1];
  280.                                         _this.chatFilter(b);
  281.                                 }), "si" === this.interface && window.g.chat.parsers.push(function(a) {
  282.                                         _this.chatFilter(a);
  283.                                 });
  284.                         }
  285.                 }, {
  286.                         key: "chatFilter",
  287.                         value: function chatFilter(a) {
  288.                                 var b = a.n,
  289.                                         c = a.t,
  290.                                         d = a.ts,
  291.                                         e = a.k;
  292.                                 if ("" !== b && b !== this.hero.nick && "System" !== b && !1 !== this.QuickGroupSettings.reSendingMessage.active && 5 >= window.unix_time(!0) - d && !this.isActuallySendingMessage) {
  293.                                         if (void 0 !== this.messagesInc[b + this.world] && 3 < this.messagesInc[b + this.world]) return;
  294.                                         c.toLowerCase().includes(this.hero.nick.toLowerCase()) && 0 === e && this.sendMessage(b, e),
  295.                                                 3 === e && this.sendMessage(b, e);
  296.                                 }
  297.                         }
  298.                 }, {
  299.                         key: "sendMessage",
  300.                         value: function sendMessage(a, b) {
  301.                                 var _this2 = this;
  302.                                 var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
  303.                                 var d = arguments.length > 3 ? arguments[3] : undefined;
  304.                                 (this.isActuallySendingMessage = !0),
  305.                                 this.messagesInc[a + this.world] === void 0 ? (this.messagesInc[a + this.world] = 1) : this.messagesInc[a + this.world]++,
  306.                                         this.saveMessages(),
  307.                                         3 < this.messagesInc[a + this.world] && (c = !0), (d = c ? this.answersBeforeAddingToEnemies[Math.floor(Math.random() * this.answersBeforeAddingToEnemies.length)] : this.randomAnswers[Math.floor(Math.random() * this.randomAnswers.length)]),
  308.                                         3 === b && (d = "@".concat(a.split(" ").join("_"), " ").concat(d)),
  309.                                         this.Sleep(1e3 * (Math.floor(11 * Math.random()) + 5)).then(function() {
  310.                                                 window._g("chat", {
  311.                                                         c: d
  312.                                                 }), !0 === c && _this2.addToEnemy(a), (_this2.isActuallySendingMessage = !1);
  313.                                         });
  314.                         }
  315.                 }, {
  316.                         key: "Sleep",
  317.                         value: function Sleep(a) {
  318.                                 return new Promise(function(b) {
  319.                                         setTimeout(function() {
  320.                                                 b(null);
  321.                                         }, a);
  322.                                 });
  323.                         }
  324.                 }, {
  325.                         key: "saveMessages",
  326.                         value: function saveMessages() {
  327.                                 localStorage.setItem("adi-bot-messages", JSON.stringify(this.messagesInc));
  328.                         }
  329.                 }, {
  330.                         key: "addToEnemy",
  331.                         value: function addToEnemy(a) {
  332.                                 window._g("friends&a=eadd&nick=".concat(a));
  333.                         }
  334.                 }, {
  335.                         key: "getWay",
  336.                         value: function getWay(b, c) {
  337.                                 return new a(this.collisions, this.map.x, this.map.y, {
  338.                                         x: this.hero.x,
  339.                                         y: this.hero.y
  340.                                 }, {
  341.                                         x: b,
  342.                                         y: c
  343.                                 }, this.npccol).anotherFindPath();
  344.                         }
  345.                 }, {
  346.                         key: "goTo",
  347.                         value: function goTo(a, b) {
  348.                                 var c = this.getWay(a, b);
  349.                                 Array.isArray(c) && ("ni" === this.interface ? (window.Engine.hero.autoPath = c) : (window.road = c));
  350.                         }
  351.                 }, {
  352.                         key: "getDistanceToNpc",
  353.                         value: function getDistanceToNpc(a, b) {
  354.                                 var c = this.getWay(a, b);
  355.                                 return Array.isArray(c) ? c.length : void 0;
  356.                         }
  357.                 }, {
  358.                         key: "updateCollisions",
  359.                         value: function updateCollisions() {
  360.                                 var a = [],
  361.                                         _this$map = this.map,
  362.                                         b = _this$map.x,
  363.                                         c = _this$map.y;
  364.                                 for (var d = 0; d < c; d++) {
  365.                                         for (var _c = 0; _c < b; _c++) {
  366.                                                 a.push(window.Engine.map.col.check(_c, d));
  367.                                         }
  368.                                 }
  369.                                 return a.join("");
  370.                         }
  371.                 }, {
  372.                         key: "initBox",
  373.                         value: function initBox() {
  374.                                 var _this3 = this;
  375.                                 var a = document.createElement("div");
  376.                                 a.classList.add("adi-bot-box"),
  377.                                         this.appendText(a, "Wprowad\u017A nazwy elit II:");
  378.                                 var b = document.createElement("input");
  379.                                 (b.type = "text"),
  380.                                 b.classList.add("adi-bot-input-text"), (b.value = this.storage.name),
  381.                                         b.addEventListener("keyup", function() {
  382.                                                 (_this3.storage.name = b.value), _this3.saveStorage();
  383.                                         }),
  384.                                         a.appendChild(b),
  385.                                         this.appendText(a, "Lootfilter:");
  386.                                 var _arr2 = Object.entries(this.lootfilterSettings.stat);
  387.                                 var _loop = function _loop() {
  388.                                         var _arr2$_i = _slicedToArray(_arr2[_i2], 2),
  389.                                                 b = _arr2$_i[0],
  390.                                                 _arr2$_i$ = _arr2$_i[1],
  391.                                                 c = _arr2$_i$.translation,
  392.                                                 d = _arr2$_i$.active;
  393.                                         _this3.createCheckBox(a, c, d, function(a) {
  394.                                                 (_this3.lootfilterSettings.stat[b].active = a),
  395.                                                 localStorage.setItem("adi-bot-lootfilterSettings123", JSON.stringify(_this3.lootfilterSettings));
  396.                                         });
  397.                                 };
  398.                                 for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
  399.                                         _loop();
  400.                                 }
  401.                                 this.appendText(a, "\u0141ap itemki po nazwie:");
  402.                                 var c = document.createElement("input");
  403.                                 c.classList.add("adi-bot-input-text"), (c.tip = "Oddzielaj przecinkiem!"), (c.type = "text"), (c.value = this.lootfilterSettings.names.join(", ")),
  404.                                         c.addEventListener("keyup", function() {
  405.                                                 var a = c.value.split(",");
  406.                                                 for (var _b7 = 0; _b7 < a.length; _b7++) {
  407.                                                         a[_b7] = a[_b7].trim();
  408.                                                 }
  409.                                                 (_this3.lootfilterSettings.names = a),
  410.                                                 localStorage.setItem("adi-bot-lootfilterSettings123", JSON.stringify(_this3.lootfilterSettings));
  411.                                         }),
  412.                                         a.appendChild(c),
  413.                                         this.appendText(a, "Ustawienia QG:");
  414.                                 var _arr3 = Object.entries(this.QuickGroupSettings);
  415.                                 var _loop2 = function _loop2() {
  416.                                         var _arr3$_i = _slicedToArray(_arr3[_i3], 2),
  417.                                                 b = _arr3$_i[0],
  418.                                                 _arr3$_i$ = _arr3$_i[1],
  419.                                                 c = _arr3$_i$.translation,
  420.                                                 d = _arr3$_i$.active;
  421.                                         _this3.createCheckBox(a, c, d, function(a) {
  422.                                                 (_this3.QuickGroupSettings[b].active = a),
  423.                                                 localStorage.setItem("adi-bot-QuickGroupSettings12", JSON.stringify(_this3.QuickGroupSettings));
  424.                                         });
  425.                                 };
  426.                                 for (var _i3 = 0; _i3 < _arr3.length; _i3++) {
  427.                                         _loop2();
  428.                                 }
  429.                                 this.makeBoxDraggable(a, function() {
  430.                                                 (_this3.storage.x = parseInt(a.style.left)), (_this3.storage.y = parseInt(a.style.top)),
  431.                                                 _this3.saveStorage(),
  432.                                                         window.message('<span style="color: red">Zapisano pozycj\u0119 okienka :)</span>');
  433.                                         }),
  434.                                         this.storage.hasOwnProperty("minimalized") || ((this.storage.minimalized = !1), this.saveStorage()),
  435.                                         a.addEventListener("dblclick", function(_ref4) {
  436.                                                 var b = _ref4.x,
  437.                                                         c = _ref4.y;
  438.                                                 !1 === _this3.storage.minimalized ? ((a.style.width = "10px"), (a.style.height = "10px"), (_this3.storage.minimalized = !0), _this3.changeVisibility(a, !0)) : ((a.style.width = "360px"), (a.style.height = "290px"), (_this3.storage.minimalized = !1), _this3.changeVisibility(a, !1)), (a.style.left = b - parseInt(a.style.width) / 2 + "px"), (a.style.top = c - parseInt(a.style.height) / 2 + "px"), (_this3.storage.x = parseInt(a.style.left)), (_this3.storage.y = parseInt(a.style.top)),
  439.                                                         _this3.saveStorage();
  440.                                         }), "ni" === this.interface ? document.querySelector(".game-window-positioner").appendChild(a) : document.body.appendChild(a),
  441.                                         this.initStyle(), !0 === this.storage.minimalized && ((a.style.width = "10px"), (a.style.height = "10px"), this.changeVisibility(a, !0));
  442.                         }
  443.                 }, {
  444.                         key: "changeVisibility",
  445.                         value: function changeVisibility(a, b) {
  446.                                 var _iteratorNormalCompletion2 = true;
  447.                                 var _didIteratorError2 = false;
  448.                                 var _iteratorError2 = undefined;
  449.                                 try {
  450.                                         for (var _iterator2 = a.childNodes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  451.                                                 var c = _step2.value;
  452.                                                 c.style.display = !0 === b ? "none" : "";
  453.                                         }
  454.                                 } catch (err) {
  455.                                         _didIteratorError2 = true;
  456.                                         _iteratorError2 = err;
  457.                                 } finally {
  458.                                         try {
  459.                                                 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  460.                                                         _iterator2.return();
  461.                                                 }
  462.                                         } finally {
  463.                                                 if (_didIteratorError2) {
  464.                                                         throw _iteratorError2;
  465.                                                 }
  466.                                         }
  467.                                 }
  468.                         }
  469.                 }, {
  470.                         key: "appendText",
  471.                         value: function appendText(a, b) {
  472.                                 var c = document.createElement("div");
  473.                                 c.appendChild(document.createTextNode(b)), a.appendChild(c);
  474.                         }
  475.                 }, {
  476.                         key: "createCheckBox",
  477.                         value: function createCheckBox(a, b, c, d) {
  478.                                 var e = document.createElement("div"),
  479.                                         f = document.createElement("input");
  480.                                 (f.type = "checkbox"), (f.name = b + "adi-bot"), (f.id = b + "adi-bot"), (f.checked = c),
  481.                                 e.appendChild(f);
  482.                                 var g = document.createElement("label");
  483.                                 g.setAttribute("for", b + "adi-bot"), (g.innerHTML = b),
  484.                                         f.addEventListener("change", function() {
  485.                                                 d(f.checked);
  486.                                         }),
  487.                                         e.appendChild(g),
  488.                                         a.appendChild(e);
  489.                         }
  490.                 }, {
  491.                         key: "makeBoxDraggable",
  492.                         value: function makeBoxDraggable(a, b) {
  493.                                 $(a).draggable({
  494.                                         containment: "window",
  495.                                         stop: b
  496.                                 });
  497.                         }
  498.                 }, {
  499.                         key: "saveStorage",
  500.                         value: function saveStorage() {
  501.                                 localStorage.setItem("adi-bot-storage", JSON.stringify(this.storage));
  502.                         }
  503.                 }, {
  504.                         key: "initStyle",
  505.                         value: function initStyle() {
  506.                                 var a = document.createElement("style"),
  507.                                         b = "\n            .adi-bot-box {\n                position: absolute;\n                text-align: center;\n                padding: 10px;\n                height: 290px;\n                width: 360px;\n                left: ".concat(this.storage.x, "px;\n                top: ").concat(this.storage.y, "px;\n                background: #975b83;\n                border: 2px solid white;\n                border-radius: 8px;\n                color: black;\n                z-index: 999;\n            }\n            .adi-bot-input-text {\n                text-align: center;\n                border: 2px solid lightblue;\n                border-radius: 3px;\n                color: black;\n                cursor: text;\n            }\n            ");
  508.                                 (a.type = "text/css"),
  509.                                 a.appendChild(document.createTextNode(b)),
  510.                                         document.head.appendChild(a);
  511.                         }
  512.                 }, {
  513.                         key: "initNewNpc",
  514.                         value: function initNewNpc() {
  515.                                 var _this4 = this;
  516.                                 if (
  517.                                         ("ni" === this.interface && (window.API.addCallbackToEvent("newNpc", function(a) {
  518.                                                 void 0 !== a && _this4.addNpcs(a.d);
  519.                                         }), window.API.addCallbackToEvent("removeNpc", function(a) {
  520.                                                 void 0 !== a && _this4.removeNpcs(a.d);
  521.                                         })), "si" === this.interface)) {
  522.                                         var _a5 = window.newNpc;
  523.                                         window.newNpc = function(b) {
  524.                                                 if (void 0 !== b) {
  525.                                                         var _arr4 = Object.entries(b);
  526.                                                         for (var _i4 = 0; _i4 < _arr4.length; _i4++) {
  527.                                                                 var _arr4$_i = _slicedToArray(_arr4[_i4], 2),
  528.                                                                         _a6 = _arr4$_i[0],
  529.                                                                         c = _arr4$_i[1];
  530.                                                                 void 0 !== c.del && void 0 !== window.g.npc[_a6] ? _this4.removeNpcs(window.g.npc[_a6], _a6) : void 0 !== c && _this4.addNpcs(c, _a6);
  531.                                                         }
  532.                                                 }
  533.                                                 _a5(b);
  534.                                         };
  535.                                 }
  536.                         }
  537.                 }, {
  538.                         key: "initNewOther",
  539.                         value: function initNewOther() {
  540.                                 var _this5 = this;
  541.                                 if (
  542.                                         ("ni" === this.interface && (this.makeParty(), window.API.addCallbackToEvent("newOther", function(a) {
  543.                                                 _this5.filterOther(a.d);
  544.                                         })), "si" === this.interface)) {
  545.                                         this.makeParty();
  546.                                         var _a7 = window.newOther;
  547.                                         window.newOther = function(b) {
  548.                                                 if ((_a7(b), void 0 !== b)) {
  549.                                                         var _arr5 = Object.values(b);
  550.                                                         for (var _i5 = 0; _i5 < _arr5.length; _i5++) {
  551.                                                                 var _a8 = _arr5[_i5];
  552.                                                                 _this5.filterOther(_a8);
  553.                                                         }
  554.                                                 }
  555.                                         };
  556.                                 }
  557.                         }
  558.                 }, {
  559.                         key: "filterOther",
  560.                         value: function filterOther(a) {
  561.                                 if (a !== void 0) {
  562.                                         var _b8 = a.relation,
  563.                                                 c = a.id;
  564.                                         !0 === this.canHeroTryToAttack() && ["cl", "fr"].includes(_b8) && !0 === this.QuickGroupSettings.adding.active && this.sendInviteToParty(c);
  565.                                 }
  566.                         }
  567.                 }, {
  568.                         key: "makeParty",
  569.                         value: function makeParty() {
  570.                                 if ("object" != _typeof(this.party)) return this.sendInvites();
  571.                                 var a = "ni" === this.interface ? this.party.getLeaderId() === this.hero.id : 1 === this.party[this.hero.id].r;
  572.                                 !0 == a && this.sendInvites();
  573.                         }
  574.                 }, {
  575.                         key: "sendInvites",
  576.                         value: function sendInvites() {
  577.                                 if (this.others !== void 0) {
  578.                                         var _arr6 = Object.values(this.others);
  579.                                         for (var _i6 = 0; _i6 < _arr6.length; _i6++) {
  580.                                                 var _a9 = _arr6[_i6];
  581.                                                 this.filterOther(_a9);
  582.                                         }
  583.                                 }
  584.                         }
  585.                 }, {
  586.                         key: "sendInviteToParty",
  587.                         value: function sendInviteToParty(a) {
  588.                                 window._g("party&a=inv&id=".concat(a));
  589.                         }
  590.                 }, {
  591.                         key: "initChecker",
  592.                         value: function initChecker() {
  593.                                 var _this6 = this;
  594.                                 if (
  595.                                         (setTimeout(function() {
  596.                                                 _this6.initChecker();
  597.                                         }, 500), !0 === this.dead && (this.removeNpcsFromThisCharId(this.hero.id), this.logout()), !0 === this.canHeroTryToAttack())) try {
  598.                                         if (void 0 !== this.npcToKillId) {
  599.                                                 var _this$npcs$this$npcTo = this.npcs[this.npcToKillId],
  600.                                                         _a10 = _this$npcs$this$npcTo.x,
  601.                                                         _b9 = _this$npcs$this$npcTo.y;
  602.                                                 1 >= Math.abs(this.hero.x - _a10) && 1 >= Math.abs(this.hero.y - _b9) ? 0 < this.timeStamp - this.lastAttackTimestamp && window._g("fight&a=attack&ff=1&id=-".concat(this.npcToKillId), function(a) {
  603.                                                         return a.hasOwnProperty("alert") && a.alert.includes("Przeciwnik walczy ju\u017C z kim\u015B innym") ? void(_this6.lastAttackTimestamp = _this6.timeStamp + 2) : void(_this6.lastAttackTimestamp = _this6.timeStamp + 1);
  604.                                                 }) : this.goTo(_a10, _b9);
  605.                                         } else this.reFindNpcs();
  606.                                 } catch (a) {
  607.                                         this.npcToKillId = void 0;
  608.                                 }
  609.                         }
  610.                 }, {
  611.                         key: "canHeroTryToAttack",
  612.                         value: function canHeroTryToAttack() {
  613.                                 return !(this.battle || this.dead);
  614.                         }
  615.                 }, {
  616.                         key: "removeNpcs",
  617.                         value: function removeNpcs(a) {
  618.                                 var b = a.x,
  619.                                         c = a.y,
  620.                                         d = a.nick,
  621.                                         e = a.lvl;
  622.                                 "ni" === this.interface ? window.Engine.map.col.unset(b, c, window.Engine.map.col.check(b, c)) : window.map.nodes.changeCollision(b, c, 0),
  623.                                         this.storage.name !== void 0 && this.storage.name.toLowerCase().includes(d.toLowerCase()) && (this.addNpcToTimer(d, e), (this.npcToKillId = void 0), this.reFindNpcs());
  624.                         }
  625.                 }, {
  626.                         key: "findEilteIIName",
  627.                         value: function findEilteIIName(a) {
  628.                                 var _arr7 = Object.values(this.npcs);
  629.                                 for (var _i7 = 0; _i7 < _arr7.length; _i7++) {
  630.                                         var _b10 = _arr7[_i7];
  631.                                         var c = _b10.nick,
  632.                                                 d = _b10.lvl,
  633.                                                 e = _b10.grp,
  634.                                                 f = _b10.wt;
  635.                                         if (e === a && 19 < f) return [c, d];
  636.                                 }
  637.                         }
  638.                 }, {
  639.                         key: "addNpcs",
  640.                         value: function addNpcs(a, b) {
  641.                                 "ni" === this.interface && (b = a.id), this.filterNpc(a, b);
  642.                         }
  643.                 }, {
  644.                         key: "isNpcFake",
  645.                         value: function isNpcFake(a, b) {
  646.                                 var c = new Image(),
  647.                                         d = document.createElement("canvas").getContext("2d"),
  648.                                         e = function e() {
  649.                                                 var a = d.getImageData(Math.floor(d.width / 2), 0, 1, d.height).data;
  650.                                                 for (var _c2 = 3; _c2 < a.length; _c2 += 4) {
  651.                                                         if (0 < a[_c2]) return b(!1);
  652.                                                 }
  653.                                                 return b(!0);
  654.                                         };
  655.                                 (c.onload = function() {
  656.                                         (d.width = this.width), (d.height = this.height),
  657.                                         d.drawImage(c, 0, 0),
  658.                                                 e();
  659.                                 }), (c.src = a);
  660.                         }
  661.                 }, {
  662.                         key: "filterNpc",
  663.                         value: function filterNpc(a, b) {
  664.                                 var _this7 = this;
  665.                                 var c = a.nick,
  666.                                         d = a.icon,
  667.                                         e = a.type,
  668.                                         f = a.wt,
  669.                                         g = a.grp;
  670.                                 if (!((2 !== e && 3 !== e) || 10 > f || void 0 === c) && void 0 === this.npcToKillId && this.storage.name.toLowerCase().includes(c.toLowerCase()) && "" !== this.storage.name && null !== this.storage.name) {
  671.                                         var _a11 = d.includes("/obrazki/npc/") ? d : "/obrazki/npc/".concat(d);
  672.                                         this.isNpcFake(_a11, function(a) {
  673.                                                 !1 === a && ((_this7.npcToKillId = 0 === g ? parseInt(b) : parseInt(_this7.findBestNpcFromGrp(g))), _this7.makeParty());
  674.                                         });
  675.                                 }
  676.                         }
  677.                 }, {
  678.                         key: "findBestNpcFromGrp",
  679.                         value: function findBestNpcFromGrp(a) {
  680.                                 var b,
  681.                                         c = 999999;
  682.                                 var _arr8 = Object.entries(this.npcs);
  683.                                 for (var _i8 = 0; _i8 < _arr8.length; _i8++) {
  684.                                         var _arr8$_i = _slicedToArray(_arr8[_i8], 2),
  685.                                                 d = _arr8$_i[0],
  686.                                                 e = _arr8$_i[1];
  687.                                         var f = e.x,
  688.                                                 g = e.y,
  689.                                                 h = e.grp;
  690.                                         if (a === h) {
  691.                                                 var _a12 = this.getDistanceToNpc(f, g);
  692.                                                 _a12 < c && ((b = d), (c = _a12));
  693.                                         }
  694.                                 }
  695.                                 return b;
  696.                         }
  697.                 }, {
  698.                         key: "reFindNpcs",
  699.                         value: function reFindNpcs() {
  700.                                 var _arr9 = Object.entries(this.npcs);
  701.                                 for (var _i9 = 0; _i9 < _arr9.length; _i9++) {
  702.                                         var _arr9$_i = _slicedToArray(_arr9[_i9], 2),
  703.                                                 _a13 = _arr9$_i[0],
  704.                                                 _b11 = _arr9$_i[1];
  705.                                         this.filterNpc(_b11, _a13);
  706.                                 }
  707.                         }
  708.                 }, {
  709.                         key: "getNewRespawnTime",
  710.                         value: function getNewRespawnTime(a) {
  711.                                 return Math.round(
  712.                                         (1 * (60 * (200 < a ? 18 : Math.min(18, 0.7 + 0.18 * a - 45e-5 * a * a)))) / parseInt(this.serverTimerSpeed));
  713.                         }
  714.                 }, {
  715.                         key: "addNpcToTimer",
  716.                         value: function addNpcToTimer(a, b) {
  717.                                 var c = this.mapName;
  718.                                 (this.timerData[a + this.world] = {
  719.                                         name: a,
  720.                                         lvl: b,
  721.                                         mapName: c,
  722.                                         nextRespawn: this.timeStamp + this.getNewRespawnTime(b),
  723.                                         charId: this.hero.id,
  724.                                         world: this.world
  725.                                 }),
  726.                                 this.saveTimersCookies();
  727.                         }
  728.                 }, {
  729.                         key: "deleteNpcFromTimer",
  730.                         value: function deleteNpcFromTimer(a) {
  731.                                 this.timerData[a] !== void 0 && (delete this.timerData[a], this.saveTimersCookies());
  732.                         }
  733.                 }, {
  734.                         key: "removeNpcsFromThisCharId",
  735.                         value: function removeNpcsFromThisCharId(a) {
  736.                                 if (void 0 !== a) {
  737.                                         var _arr10 = Object.entries(this.timerData);
  738.                                         for (var _i10 = 0; _i10 < _arr10.length; _i10++) {
  739.                                                 var _arr10$_i = _slicedToArray(_arr10[_i10], 2),
  740.                                                         _b12 = _arr10$_i[0],
  741.                                                         c = _arr10$_i[1];
  742.                                                 c.charId == a && this.deleteNpcFromTimer(_b12);
  743.                                         }
  744.                                 }
  745.                         }
  746.                 }, {
  747.                         key: "checkTimers",
  748.                         value: function checkTimers() {
  749.                                 var _arr11 = Object.entries(this.timerData);
  750.                                 for (var _i11 = 0; _i11 < _arr11.length; _i11++) {
  751.                                         var _arr11$_i = _slicedToArray(_arr11[_i11], 2),
  752.                                                 _a14 = _arr11$_i[0],
  753.                                                 _b13 = _arr11$_i[1];
  754.                                         _b13.nextRespawn + this.waitForNpcRespawn < this.timeStamp && this.createNewRespawnTime(_a14);
  755.                                 }
  756.                         }
  757.                 }, {
  758.                         key: "createNewRespawnTime",
  759.                         value: function createNewRespawnTime(a) {
  760.                                 var _this8 = this;
  761.                                 if (!(Object.values(this.npcs).some(function(b) {
  762.                                                 return b.nick == _this8.timerData[a].name;
  763.                                         }) || this.timerData[a].charId !== this.hero.id)) {
  764.                                         for (; this.timeStamp > this.timerData[a].nextRespawn;) {
  765.                                                 this.timerData[a].nextRespawn += this.getNewRespawnTime(this.timerData[a].lvl);
  766.                                         }
  767.                                         this.saveTimersCookies();
  768.                                 }
  769.                         }
  770.                 }, {
  771.                         key: "isThisHeroIssetInTimer",
  772.                         value: function isThisHeroIssetInTimer(b) {
  773.                                 return (void 0 !== b && Object.values(this.timerData).some(function(c) {
  774.                                         return c.charId == b;
  775.                                 }));
  776.                         }
  777.                 }, {
  778.                         key: "isntTimersInRange",
  779.                         value: function isntTimersInRange() {
  780.                                 var _this9 = this;
  781.                                 return Object.values(this.timerData).every(function(b) {
  782.                                         return b.nextRespawn - _this9.timeStamp > _this9.delayToRelog;
  783.                                 });
  784.                         }
  785.                 }, {
  786.                         key: "checkHeroOnGoodMap",
  787.                         value: function checkHeroOnGoodMap(a) {
  788.                                 var _arr12 = Object.entries(this.timerData);
  789.                                 for (var _i12 = 0; _i12 < _arr12.length; _i12++) {
  790.                                         var _arr12$_i = _slicedToArray(_arr12[_i12], 2),
  791.                                                 _b14 = _arr12$_i[0],
  792.                                                 c = _arr12$_i[1];
  793.                                         var d = c.mapName,
  794.                                                 e = c.charId;
  795.                                         e == a && this.mapName !== void 0 && d !== void 0 && d !== this.mapName && this.deleteNpcFromTimer(_b14);
  796.                                 }
  797.                         }
  798.                 }, {
  799.                         key: "initTimer",
  800.                         value: function initTimer() {
  801.                                 var _this10 = this;
  802.                                 if (0 < Object.keys(this.timerData).length)
  803.                                         if ("none" === this.interface) {
  804.                                                 if (Object.values(this.timerData).some(function(b) {
  805.                                                                 return (b.nextRespawn - _this10.timeStamp <= _this10.delayToRelog);
  806.                                                         })) {
  807.                                                         var _Object$values$reduce = Object.values(this.timerData).reduce(function(c, a) {
  808.                                                                         return c.nextRespawn <= a.nextRespawn ? c : a;
  809.                                                                 }),
  810.                                                                 _a15 = _Object$values$reduce.world,
  811.                                                                 _b15 = _Object$values$reduce.charId;
  812.                                                         void 0 !== _b15 && this.logIn(_b15, _a15);
  813.                                                 }
  814.                                         } else if (this.isntTimersInRange() && this.isThisHeroIssetInTimer(this.hero.id)) this.logout();
  815.                                 else {
  816.                                         this.checkHeroOnGoodMap(this.hero.id);
  817.                                         var _a16 = Object.values(this.timerData).filter(function(b) {
  818.                                                 return (b.nextRespawn - _this10.timeStamp <= _this10.delayToRelog);
  819.                                         });
  820.                                         if (0 < _a16.length) {
  821.                                                 var _a16$reduce = _a16.reduce(function(c, a) {
  822.                                                                 return c.nextRespawn <= a.nextRespawn ? c : a;
  823.                                                         }),
  824.                                                         _b16 = _a16$reduce.charId,
  825.                                                         c = _a16$reduce.world;
  826.                                                 void 0 !== this.hero.id && parseInt(_b16) !== this.hero.id && this.logIn(_b16, c);
  827.                                         }
  828.                                 }
  829.                                 this.checkTimers(),
  830.                                         setTimeout(function() {
  831.                                                 _this10.initTimer();
  832.                                         }, 500);
  833.                         }
  834.                 }, {
  835.                         key: "saveTimersCookies",
  836.                         value: function saveTimersCookies() {
  837.                                 var a = new Date();
  838.                                 a.setMonth(a.getMonth() + 1),
  839.                                         this.setCookie("adi-bot-timer", JSON.stringify(this.timerData), a, "/", "margonem.pl");
  840.                         }
  841.                 }, {
  842.                         key: "randomSeconds",
  843.                         value: function randomSeconds(a, b) {
  844.                                 return (
  845.                                         (a *= 60), (b *= 60), Math.floor(Math.random() * (b - a + 1)) + a);
  846.                         }
  847.                 }, {
  848.                         key: "randomRefresh",
  849.                         value: function randomRefresh() {
  850.                                 var _this$refreshTime = _slicedToArray(this.refreshTime, 2),
  851.                                         a = _this$refreshTime[0],
  852.                                         b = _this$refreshTime[1];
  853.                                 setTimeout(function() {
  854.                                         location.href = location.href;
  855.                                 }, 1e3 * this.randomSeconds(a, b));
  856.                         }
  857.                 }, {
  858.                         key: "getCookie",
  859.                         value: function getCookie(a) {
  860.                                 var b = document.cookie,
  861.                                         c = a + "=";
  862.                                 var d = b.indexOf("; " + c);
  863.                                 if (-1 != d) d += 2;
  864.                                 else if (((d = b.indexOf(c)), 0 != d)) return null;
  865.                                 var e = document.cookie.indexOf(";", d);
  866.                                 return (-1 == e && (e = b.length), unescape(b.substring(d + c.length, e)));
  867.                         }
  868.                 }, {
  869.                         key: "setCookie",
  870.                         value: function setCookie(a, b, c, d, e, f) {
  871.                                 var g = a + "=" + escape(b) + (c ? "; expires=" + c.toGMTString() : "") + (d ? "; path=" + d : "") + (e ? "; domain=" + e : "") + (f ? "; secure" : "");
  872.                                 document.cookie = g;
  873.                         }
  874.                 }, {
  875.                         key: "createTimerOnMainPage",
  876.                         value: function createTimerOnMainPage() {
  877.                                 var _this11 = this;
  878.                                 if (0 === Object.keys(this.timerData).length) return;
  879.                                 var a = document.createElement("div");
  880.                                 a.classList.add("adi-bot-minutnik-strona-glowna"),
  881.                                         document.querySelector(".rmenu").appendChild(a);
  882.                                 var b = document.createElement("style");
  883.                                 (b.type = "text/css"),
  884.                                 b.appendChild(document.createTextNode("\n            .adi-bot-minutnik-strona-glowna {\n                color: white;\n                font-size: 14px;\n                text-align: left;\n            }\n\n            .timer_data {\n                font-weight: bold;\n                float: right;\n                cursor: pointer;\n            }\n\n            .timer_data:hover {\n                color: gray;\n            }\n\n            .adi-bot-konfiguracja {\n\n            }\n        ")),
  885.                                         document.head.appendChild(b),
  886.                                         this.addNpcsToTimerBox(a),
  887.                                         document.addEventListener("click", function(a) {
  888.                                                 try {
  889.                                                         if ("timer_data" === a.target.className) {
  890.                                                                 var _a$target$getAttribut = a.target.getAttribute("timer-data").split("|"),
  891.                                                                         _a$target$getAttribut2 = _slicedToArray(_a$target$getAttribut, 2),
  892.                                                                         _b17 = _a$target$getAttribut2[0],
  893.                                                                         c = _a$target$getAttribut2[1];
  894.                                                                 c !== void 0 && _b17 !== void 0 && (_this11.deleteNpcFromTimer(_b17 + c), window.showMsg("Usuni\u0119to ".concat(_b17, " ze \u015Bwiata ").concat(c.charAt(0).toUpperCase() + c.slice(1), ".")));
  895.                                                         }
  896.                                                 } catch (a) {}
  897.                                         });
  898.                         }
  899.                 }, {
  900.                         key: "addNpcsToTimerBox",
  901.                         value: function addNpcsToTimerBox(a) {
  902.                                 var _this12 = this;
  903.                                 var b = {};
  904.                                 var _arr13 = Object.values(this.timerData);
  905.                                 for (var _i13 = 0; _i13 < _arr13.length; _i13++) {
  906.                                         var _c3 = _arr13[_i13];
  907.                                         var _a17 = _c3.name,
  908.                                                 d = _c3.nextRespawn,
  909.                                                 e = _c3.world;
  910.                                         b[e] === void 0 ? (b[e] = [{
  911.                                                 name: _a17,
  912.                                                 nextRespawn: d
  913.                                         }]) : b[e].push({
  914.                                                 name: _a17,
  915.                                                 nextRespawn: d
  916.                                         });
  917.                                 }
  918.                                 var c = "";
  919.                                 var _arr14 = Object.entries(b);
  920.                                 for (var _i14 = 0; _i14 < _arr14.length; _i14++) {
  921.                                         var _arr14$_i = _slicedToArray(_arr14[_i14], 2),
  922.                                                 d = _arr14$_i[0],
  923.                                                 e = _arr14$_i[1];
  924.                                         (c += '<br><div style="text-align: center; font-weight: bold; text-decoration: underline">'.concat(this.capitalizeWorld(d), "</div>")),
  925.                                         e.sort(function(a, b) {
  926.                                                 return a.nextRespawn - b.nextRespawn;
  927.                                         });
  928.                                         var _a18 = [];
  929.                                         _a18.push("");
  930.                                         var _iteratorNormalCompletion3 = true;
  931.                                         var _didIteratorError3 = false;
  932.                                         var _iteratorError3 = undefined;
  933.                                         try {
  934.                                                 for (var _iterator3 = e[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
  935.                                                         var _b18 = _step3.value;
  936.                                                         var _c4 = _b18.name,
  937.                                                                 _e2 = _b18.nextRespawn;
  938.                                                         _a18.push("<span>".concat(this.getTimeToRespawn(_c4, _e2), '</span><span class="timer_data" tip="Kliknij, aby usun\u0105\u0107 z timera." timer-data="').concat(_c4, "|").concat(d, '">---</span>'));
  939.                                                 }
  940.                                         } catch (err) {
  941.                                                 _didIteratorError3 = true;
  942.                                                 _iteratorError3 = err;
  943.                                         } finally {
  944.                                                 try {
  945.                                                         if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
  946.                                                                 _iterator3.return();
  947.                                                         }
  948.                                                 } finally {
  949.                                                         if (_didIteratorError3) {
  950.                                                                 throw _iteratorError3;
  951.                                                         }
  952.                                                 }
  953.                                         }
  954.                                         _a18.push(""), (c += _a18.join("<hr>"));
  955.                                 }
  956.                                 (a.innerHTML = c),
  957.                                 setTimeout(function() {
  958.                                         _this12.addNpcsToTimerBox(a);
  959.                                 }, 1e3);
  960.                         }
  961.                 }, {
  962.                         key: "capitalizeWorld",
  963.                         value: function capitalizeWorld(a) {
  964.                                 return a.charAt(0).toUpperCase() + a.slice(1) + ":";
  965.                         }
  966.                 }, {
  967.                         key: "getTimeToRespawn",
  968.                         value: function getTimeToRespawn(a, b) {
  969.                                 var c = b - this.timeStamp,
  970.                                         d = 10 > parseInt(c / 60) ? "0".concat(parseInt(c / 60)) : parseInt(c / 60),
  971.                                         e = 10 > c % 60 ? "0".concat(c % 60) : c % 60;
  972.                                 return "".concat(a, ": ").concat(d, ":").concat(e);
  973.                         }
  974.                 }, {
  975.                         key: "removeLockAdding",
  976.                         value: function removeLockAdding() {
  977.                                 "ni" === this.interface && (window.Engine.lock.add = Function.prototype), "si" === this.interface && (window.g.lock.add = Function.prototype), (window.mAlert = Function.prototype);
  978.                         }
  979.                 }, {
  980.                         key: "initLagRefresher",
  981.                         value: function initLagRefresher() {
  982.                                 var _this13 = this;
  983.                                 !1 === this.startInctementingLagRefresher && ((this.startInctementingLagRefresher = !0), setInterval(function() {
  984.                                         _this13.incrementValue++,
  985.                                                 8 < _this13.incrementValue && (location.href = location.href);
  986.                                 }, 500));
  987.                                 var a = this,
  988.                                         b = window.$.ajax;
  989.                                 window.$.ajax = function() {
  990.                                         for (var _len = arguments.length, c = new Array(_len), _key = 0; _key < _len; _key++) {
  991.                                                 c[_key] = arguments[_key];
  992.                                         }
  993.                                         if (c[0].url.includes("engine?t=")) {
  994.                                                 var _b19 = c[0].success;
  995.                                                 c[0].success = function() {
  996.                                                         for (var _len2 = arguments.length, c = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  997.                                                                 c[_key2] = arguments[_key2];
  998.                                                         }
  999.                                                         var d = "object" == _typeof(c[0]) && null !== c[0] && "ok" === c[0].e,
  1000.                                                                 e = _b19.apply(_this13, c);
  1001.                                                         return d && a.parseAjaxData(c[0]), e;
  1002.                                                 };
  1003.                                         }
  1004.                                         return b.apply(_this13, c);
  1005.                                 };
  1006.                         }
  1007.                 }, {
  1008.                         key: "parseAjaxData",
  1009.                         value: function parseAjaxData(a) {
  1010.                                 if (
  1011.                                         (((a.hasOwnProperty("d") && "stop" === a.d) || (a.hasOwnProperty("t") && "stop" === a.t)) && this.Sleep(2500).then(function() {
  1012.                                                 location.href = location.href;
  1013.                                         }), (this.incrementValue = 0), a.hasOwnProperty("loot") && a.hasOwnProperty("item") && a.loot.hasOwnProperty("init") && a.loot.hasOwnProperty("source") && 0 < a.loot.init && "fight" === a.loot.source)) {
  1014.                                         var _b20 = [],
  1015.                                                 c = [];
  1016.                                         var _arr15 = Object.entries(a.item);
  1017.                                         for (var _i15 = 0; _i15 < _arr15.length; _i15++) {
  1018.                                                 var _arr15$_i = _slicedToArray(_arr15[_i15], 2),
  1019.                                                         d = _arr15$_i[0],
  1020.                                                         e = _arr15$_i[1];
  1021.                                                 var _a19 = e.stat,
  1022.                                                         f = e.name;
  1023.                                                 !0 === this.isGoodItem(_a19, f) ? _b20.push(d) : c.push(d);
  1024.                                         }
  1025.                                         this.sendLoots(_b20, c);
  1026.                                 }
  1027.                                 a.hasOwnProperty("f") && a.f.hasOwnProperty("move") && a.f.hasOwnProperty("current") && 0 === a.f.current && -1 === a.f.move && (this.closeBattle(), a.f.hasOwnProperty("w") && this.autoHeal()),
  1028.                                         a.hasOwnProperty("event_done") && this.autoHeal(),
  1029.                                         a.hasOwnProperty("ask") && a.ask.hasOwnProperty("re") && "party&a=accept&answer=" === a.ask.re && !0 === this.QuickGroupSettings.accepting.active && window._g("party&a=accept&answer=1");
  1030.                         }
  1031.                 }, {
  1032.                         key: "isGoodItem",
  1033.                         value: function isGoodItem(a, b) {
  1034.                                 if (!0 === this.lootfilterSettings.stat.all.active) return !0;
  1035.                                 var c = [];
  1036.                                 var _arr16 = Object.entries(this.lootfilterSettings.stat);
  1037.                                 for (var _i16 = 0; _i16 < _arr16.length; _i16++) {
  1038.                                         var _arr16$_i = _slicedToArray(_arr16[_i16], 2),
  1039.                                                 _d2 = _arr16$_i[0],
  1040.                                                 e = _arr16$_i[1].active;
  1041.                                         !0 === e && c.push(_d2);
  1042.                                 }
  1043.                                 var d = this.lootfilterSettings.names;
  1044.                                 for (var _i17 = 0; _i17 < c.length; _i17++) {
  1045.                                         var _d3 = c[_i17];
  1046.                                         if (a.includes(_d3)) return !0;
  1047.                                 }
  1048.                                 var _iteratorNormalCompletion4 = true;
  1049.                                 var _didIteratorError4 = false;
  1050.                                 var _iteratorError4 = undefined;
  1051.                                 try {
  1052.                                         for (var _iterator4 = d[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
  1053.                                                 var _c5 = _step4.value;
  1054.                                                 if (b.toLowerCase() === _c5.toLowerCase()) return !0;
  1055.                                         }
  1056.                                 } catch (err) {
  1057.                                         _didIteratorError4 = true;
  1058.                                         _iteratorError4 = err;
  1059.                                 } finally {
  1060.                                         try {
  1061.                                                 if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
  1062.                                                         _iterator4.return();
  1063.                                                 }
  1064.                                         } finally {
  1065.                                                 if (_didIteratorError4) {
  1066.                                                         throw _iteratorError4;
  1067.                                                 }
  1068.                                         }
  1069.                                 }
  1070.                                 return !1;
  1071.                         }
  1072.                 }, {
  1073.                         key: "sendLoots",
  1074.                         value: function sendLoots(a, b) {
  1075.                                 window._g("loot&not=".concat(b.join(","), "&want=&must=").concat(a.join(","), "&final=1")), "si" === this.interface && (document.querySelector("#loots").style.display = "none");
  1076.                         }
  1077.                 }, {
  1078.                         key: "closeBattle",
  1079.                         value: function closeBattle() {
  1080.                                 window._g("fight&a=quit"), "si" === this.interface && (document.querySelector("#battle").style.display = "none");
  1081.                         }
  1082.                 }, {
  1083.                         key: "autoHeal",
  1084.                         value: function autoHeal() {
  1085.                                 var _this14 = this;
  1086.                                 if (this.dead) return;
  1087.                                 var a = "ni" === this.interface ? window.Engine.hero.d.warrior_stats : window.hero;
  1088.                                 if (a.hp === a.maxhp) return (this.isHealing = !1);
  1089.                                 this.isHealing = !0;
  1090.                                 var b = [],
  1091.                                         c = [];
  1092.                                 var d = !1;
  1093.                                 var _iteratorNormalCompletion5 = true;
  1094.                                 var _didIteratorError5 = false;
  1095.                                 var _iteratorError5 = undefined;
  1096.                                 try {
  1097.                                         for (var _iterator5 = this.items[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
  1098.                                                 var e = _step5.value;
  1099.                                                 var f = e.stat,
  1100.                                                         g = e.loc,
  1101.                                                         h = e.name;
  1102.                                                 if ("g" === g) {
  1103.                                                         var _this$parseItemStat = this.parseItemStat(f),
  1104.                                                                 _g = _this$parseItemStat.timelimit,
  1105.                                                                 i = _this$parseItemStat.lvl,
  1106.                                                                 j = _this$parseItemStat.leczy,
  1107.                                                                 k = _this$parseItemStat.fullheal;
  1108.                                                         if (_g !== void 0 && _g.includes(",")) continue;
  1109.                                                         if (void 0 !== i && i > a.lvl) continue;
  1110.                                                         j !== void 0 && (j <= a.maxhp - a.hp ? c.push(e) : (d = !0)), "Czarna per\u0142a \u017Cycia" === h && (16e3 <= a.maxhp - a.hp ? c.push(e) : (d = !0)),
  1111.                                                                 k !== void 0 && b.push(e);
  1112.                                                 }
  1113.                                         }
  1114.                                 } catch (err) {
  1115.                                         _didIteratorError5 = true;
  1116.                                         _iteratorError5 = err;
  1117.                                 } finally {
  1118.                                         try {
  1119.                                                 if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
  1120.                                                         _iterator5.return();
  1121.                                                 }
  1122.                                         } finally {
  1123.                                                 if (_didIteratorError5) {
  1124.                                                         throw _iteratorError5;
  1125.                                                 }
  1126.                                         }
  1127.                                 }
  1128.                                 if (0 < c.length) {
  1129.                                         var _a20 = c.sort(function(a, b) {
  1130.                                                 return (_this14.parseItemStat(b.stat).leczy - _this14.parseItemStat(a.stat).leczy);
  1131.                                         });
  1132.                                         this.useItem(_a20[0].id, function() {
  1133.                                                 _this14.Sleep(100).then(function() {
  1134.                                                         _this14.autoHeal();
  1135.                                                 });
  1136.                                         });
  1137.                                 } else 0 < b.length ? this.useItem(b[0].id, function() {
  1138.                                         _this14.Sleep(100).then(function() {
  1139.                                                 _this14.autoHeal();
  1140.                                         });
  1141.                                 }) : !1 == d && window.message('<span style="color: red">Brakuje Ci potek!</span>');
  1142.                                 this.isHealing = !1;
  1143.                         }
  1144.                 }, {
  1145.                         key: "parseItemStat",
  1146.                         value: function parseItemStat(a) {
  1147.                                 var b = {},
  1148.                                         c = a.split(";");
  1149.                                 var _iteratorNormalCompletion6 = true;
  1150.                                 var _didIteratorError6 = false;
  1151.                                 var _iteratorError6 = undefined;
  1152.                                 try {
  1153.                                         for (var _iterator6 = c[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
  1154.                                                 var d = _step6.value;
  1155.                                                 var _d$split = d.split("="),
  1156.                                                         _d$split2 = _slicedToArray(_d$split, 2),
  1157.                                                         _a21 = _d$split2[0],
  1158.                                                         _c6 = _d$split2[1];
  1159.                                                 b[_a21] = _c6;
  1160.                                         }
  1161.                                 } catch (err) {
  1162.                                         _didIteratorError6 = true;
  1163.                                         _iteratorError6 = err;
  1164.                                 } finally {
  1165.                                         try {
  1166.                                                 if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
  1167.                                                         _iterator6.return();
  1168.                                                 }
  1169.                                         } finally {
  1170.                                                 if (_didIteratorError6) {
  1171.                                                         throw _iteratorError6;
  1172.                                                 }
  1173.                                         }
  1174.                                 }
  1175.                                 return b;
  1176.                         }
  1177.                 }, {
  1178.                         key: "useItem",
  1179.                         value: function useItem(a, b) {
  1180.                                 window._g("moveitem&id=".concat(a, "&st=1"), b);
  1181.                         }
  1182.                 }, {
  1183.                         key: "init",
  1184.                         value: function init() {
  1185.                                 if ((this.initTimer(), "none" === this.interface)) return this.createTimerOnMainPage();
  1186.                                 if ("ni" === this.interface) {
  1187.                                         var _a22 = window.Storage.prototype.setItem;
  1188.                                         window.Storage.prototype.setItem = function(b, c) {
  1189.                                                 if ("Margonem" === b) {
  1190.                                                         var _a23 = JSON.parse(c);
  1191.                                                         (_a23.f = 0), (c = JSON.stringify(_a23));
  1192.                                                 }
  1193.                                                 _a22.apply(this, [b, c]);
  1194.                                         };
  1195.                                 } else window.bB = Function.prototype;
  1196.                                 this.initBox(),
  1197.                                         this.initNewNpc(),
  1198.                                         this.initNewOther(),
  1199.                                         this.removeLockAdding(),
  1200.                                         this.initChecker(),
  1201.                                         this.randomRefresh(),
  1202.                                         this.initLagRefresher(),
  1203.                                         this.chatParser();
  1204.                         }
  1205.                 }, {
  1206.                         key: "collisions",
  1207.                         get: function get() {
  1208.                                 return "ni" === this.interface ? this.updateCollisions() : window.map.col;
  1209.                         }
  1210.                 }, {
  1211.                         key: "npccol",
  1212.                         get: function get() {
  1213.                                 return "ni" === this.interface ? this.getNpcColsNI() : window.g.npccol;
  1214.                         }
  1215.                 }, {
  1216.                         key: "timeStamp",
  1217.                         get: function get() {
  1218.                                 return Math.floor(new Date().getTime() / 1e3);
  1219.                         }
  1220.                 }, {
  1221.                         key: "hero",
  1222.                         get: function get() {
  1223.                                 return "ni" === this.interface ? window.Engine.hero.d : window.hero;
  1224.                         }
  1225.                 }, {
  1226.                         key: "map",
  1227.                         get: function get() {
  1228.                                 return "ni" === this.interface ? window.Engine.map.size : window.map;
  1229.                         }
  1230.                 }, {
  1231.                         key: "mapName",
  1232.                         get: function get() {
  1233.                                 return "ni" === this.interface ? window.Engine.map.d.name : window.map.name;
  1234.                         }
  1235.                 }, {
  1236.                         key: "npcs",
  1237.                         get: function get() {
  1238.                                 return "ni" === this.interface ? this.npcsOnNewInterface : window.g.npc;
  1239.                         }
  1240.                 }, {
  1241.                         key: "others",
  1242.                         get: function get() {
  1243.                                 return "ni" === this.interface ? this.othersOnNewInterface : window.g.other;
  1244.                         }
  1245.                 }, {
  1246.                         key: "world",
  1247.                         get: function get() {
  1248.                                 return "ni" === this.interface ? window.Engine.worldName : window.g.worldname;
  1249.                         }
  1250.                 }, {
  1251.                         key: "serverTimerSpeed",
  1252.                         get: function get() {
  1253.                                 return "none" !== this.interface && ["nerthus", "aldous", "berufs", "brutal", "classic", "gefion", "hutena", "jaruna", "katahha", "lelwani", "majuna", "nomada", "perkun", "tarhuna", "telawel", "tempest", "zemyna", "zorza"].includes(this.world.toLowerCase()) ? 1 : "none" !== this.interface && "syberia" === this.world.toLowerCase() ? 2 : 3;
  1254.                         }
  1255.                 }, {
  1256.                         key: "battle",
  1257.                         get: function get() {
  1258.                                 return "ni" === this.interface ? !!window.Engine.battle && !window.Engine.battle.endBattle : window.g.battle;
  1259.                         }
  1260.                 }, {
  1261.                         key: "dead",
  1262.                         get: function get() {
  1263.                                 return "ni" === this.interface ? window.Engine.dead : window.g.dead;
  1264.                         }
  1265.                 }, {
  1266.                         key: "party",
  1267.                         get: function get() {
  1268.                                 return "ni" === this.interface ? Engine.party : window.g.party;
  1269.                         }
  1270.                 }, {
  1271.                         key: "loots",
  1272.                         get: function get() {
  1273.                                 return "ni" === this.interface ? window.Engine.loots !== void 0 && !!(0 < Object.keys(window.Engine.loots.items).length) : !1 !== window.g.loots;
  1274.                         }
  1275.                 }, {
  1276.                         key: "issetMyNpcOnMap",
  1277.                         get: function get() {
  1278.                                 var _this15 = this;
  1279.                                 return Object.values(this.npcs).some(function(a) {
  1280.                                         return _this15.storage.name.toLowerCase().includes(a.nick.toLowerCase());
  1281.                                 });
  1282.                         }
  1283.                 }, {
  1284.                         key: "items",
  1285.                         get: function get() {
  1286.                                 return "ni" === this.interface ? window.Engine.items.fetchLocationItems("g") : Object.values(window.g.item);
  1287.                         }
  1288.                 }, {
  1289.                         key: "npcsOnNewInterface",
  1290.                         get: function get() {
  1291.                                 var a = window.Engine.npcs.check(),
  1292.                                         b = {};
  1293.                                 var _arr17 = Object.entries(a);
  1294.                                 for (var _i18 = 0; _i18 < _arr17.length; _i18++) {
  1295.                                         var _arr17$_i = _slicedToArray(_arr17[_i18], 2),
  1296.                                                 c = _arr17$_i[0],
  1297.                                                 d = _arr17$_i[1];
  1298.                                         b[c] = d.d;
  1299.                                 }
  1300.                                 return b;
  1301.                         }
  1302.                 }, {
  1303.                         key: "othersOnNewInterface",
  1304.                         get: function get() {
  1305.                                 var a = window.Engine.others.check(),
  1306.                                         b = {};
  1307.                                 var _arr18 = Object.entries(a);
  1308.                                 for (var _i19 = 0; _i19 < _arr18.length; _i19++) {
  1309.                                         var _arr18$_i = _slicedToArray(_arr18[_i19], 2),
  1310.                                                 c = _arr18$_i[0],
  1311.                                                 d = _arr18$_i[1];
  1312.                                         b[c] = d.d;
  1313.                                 }
  1314.                                 return b;
  1315.                         }
  1316.                 }]);
  1317.                 return _class;
  1318.         })())();
  1319. })();