1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
724.
725.
726.
727.
728.
729.
730.
731.
732.
733.
734.
735.
736.
737.
738.
739.
740.
741.
742.
743.
744.
745.
746.
747.
748.
749.
750.
751.
752.
753.
754.
755.
756.
757.
758.
759.
760.
761.
762.
763.
764.
765.
766.
767.
768.
769.
770.
771.
772.
773.
774.
775.
776.
777.
778.
779.
780.
781.
782.
783.
784.
785.
786.
787.
788.
789.
790.
791.
792.
793.
794.
795.
796.
797.
798.
799.
800.
801.
802.
803.
804.
805.
806.
807.
808.
809.
810.
811.
812.
813.
814.
815.
816.
817.
818.
819.
820.
821.
822.
823.
824.
825.
826.
827.
828.
829.
830.
831.
832.
833.
834.
835.
836.
837.
838.
839.
840.
841.
842.
843.
844.
845.
846.
847.
848.
849.
850.
851.
852.
853.
854.
855.
856.
857.
858.
859.
860.
861.
862.
863.
864.
865.
866.
867.
868.
869.
870.
871.
872.
873.
874.
875.
876.
877.
878.
879.
880.
881.
882.
883.
884.
885.
886.
887.
888.
889.
890.
891.
892.
893.
894.
895.
896.
897.
898.
899.
900.
901.
902.
903.
904.
905.
906.
907.
908.
909.
910.
911.
912.
913.
914.
915.
916.
917.
918.
919.
920.
921.
922.
923.
924.
925.
926.
927.
928.
929.
930.
931.
932.
933.
934.
935.
936.
937.
938.
939.
940.
941.
942.
943.
944.
945.
946.
947.
948.
949.
950.
951.
952.
953.
954.
955.
956.
957.
958.
959.
960.
961.
962.
963.
964.
965.
966.
967.
968.
969.
970.
971.
972.
973.
974.
975.
976.
977.
978.
979.
980.
981.
982.
983.
984.
985.
986.
987.
988.
989.
990.
991.
992.
993.
994.
995.
996.
997.
998.
999.
1000.
1001.
1002.
1003.
1004.
1005.
1006.
1007.
1008.
1009.
1010.
1011.
1012.
1013.
1014.
1015.
1016.
1017.
1018.
1019.
1020.
1021.
1022.
1023.
1024.
1025.
1026.
1027.
1028.
1029.
1030.
1031.
1032.
1033.
1034.
1035.
1036.
1037.
1038.
1039.
1040.
1041.
1042.
1043.
1044.
1045.
1046.
1047.
1048.
1049.
1050.
1051.
1052.
1053.
1054.
1055.
1056.
1057.
1058.
1059.
1060.
1061.
1062.
1063.
1064.
1065.
1066.
1067.
1068.
1069.
1070.
1071.
1072.
1073.
1074.
1075.
1076.
1077.
1078.
1079.
1080.
1081.
1082.
1083.
1084.
1085.
1086.
1087.
1088.
1089.
1090.
1091.
1092.
1093.
1094.
1095.
1096.
1097.
1098.
1099.
1100.
1101.
1102.
1103.
1104.
1105.
1106.
1107.
1108.
1109.
1110.
1111.
1112.
1113.
1114.
1115.
1116.
1117.
1118.
1119.
1120.
1121.
1122.
1123.
1124.
1125.
1126.
1127.
1128.
1129.
1130.
1131.
1132.
1133.
1134.
1135.
1136.
1137.
1138.
1139.
1140.
1141.
1142.
1143.
1144.
1145.
1146.
1147.
1148.
1149.
1150.
1151.
1152.
1153.
1154.
1155.
1156.
1157.
1158.
1159.
1160.
1161.
1162.
1163.
1164.
1165.
1166.
1167.
1168.
1169.
1170.
1171.
1172.
1173.
1174.
1175.
1176.
1177.
1178.
1179.
1180.
1181.
1182.
1183.
1184.
1185.
1186.
1187.
1188.
1189.
1190.
1191.
1192.
1193.
1194.
1195.
1196.
1197.
1198.
1199.
1200.
1201.
1202.
1203.
1204.
1205.
1206.
1207.
1208.
1209.
1210.
1211.
1212.
1213.
1214.
1215.
1216.
1217.
1218.
1219.
1220.
1221.
1222.
1223.
1224.
1225.
1226.
1227.
1228.
1229.
1230.
1231.
1232.
1233.
1234.
1235.
1236.
1237.
1238.
1239.
1240.
1241.
1242.
1243.
1244.
1245.
1246.
1247.
1248.
1249.
1250.
1251.
1252.
1253.
1254.
1255.
1256.
1257.
1258.
1259.
1260.
1261.
1262.
1263.
1264.
1265.
1266.
1267.
1268.
1269.
1270.
1271.
1272.
1273.
1274.
1275.
1276.
1277.
1278.
1279.
1280.
1281.
1282.
1283.
1284.
1285.
1286.
1287.
1288.
1289.
1290.
1291.
1292.
1293.
1294.
1295.
1296.
1297.
1298.
1299.
1300.
1301.
1302.
1303.
1304.
1305.
1306.
1307.
1308.
1309.
1310.
1311.
1312.
1313.
1314.
1315.
1316.
1317.
1318.
1319.
1320.
1321.
1322.
1323.
1324.
1325.
1326.
1327.
1328.
1329.
1330.
1331.
1332.
1333.
1334.
1335.
1336.
1337.
1338.
1339.
1340.
1341.
1342.
1343.
1344.
1345.
1346.
1347.
1348.
1349.
1350.
1351.
1352.
1353.
1354.
1355.
1356.
1357.
1358.
1359.
1360.
1361.
1362.
1363.
1364.
1365.
1366.
1367.
1368.
1369.
1370.
1371.
1372.
1373.
1374.
1375.
1376.
1377.
1378.
1379.
1380.
1381.
1382.
1383.
1384.
1385.
1386.
1387.
1388.
1389.
1390.
1391.
1392.
1393.
1394.
1395.
1396.
1397.
1398.
1399.
1400.
1401.
1402.
1403.
1404.
1405.
1406.
1407.
1408.
1409.
1410.
1411.
1412.
1413.
1414.
1415.
1416.
1417.
1418.
1419.
1420.
1421.
1422.
1423.
1424.
1425.
1426.
1427.
1428.
1429.
1430.
1431.
1432.
1433.
1434.
1435.
1436.
1437.
1438.
1439.
1440.
1441.
1442.
1443.
1444.
1445.
1446.
1447.
1448.
1449.
1450.
1451.
1452.
1453.
1454.
1455.
1456.
1457.
1458.
1459.
1460.
1461.
1462.
1463.
1464.
1465.
1466.
1467.
1468.
1469.
1470.
1471.
1472.
1473.
1474.
1475.
1476.
1477.
1478.
1479.
1480.
1481.
1482.
1483.
1484.
1485.
1486.
1487.
1488.
1489.
1490.
1491.
1492.
1493.
1494.
1495.
1496.
1497.
1498.
1499.
1500.
1501.
1502.
1503.
1504.
1505.
1506.
1507.
1508.
1509.
1510.
1511.
1512.
1513.
1514.
1515.
1516.
1517.
1518.
1519.
1520.
1521.
1522.
1523.
1524.
1525.
1526.
1527.
1528.
1529.
1530.
1531.
1532.
1533.
1534.
1535.
1536.
1537.
1538.
1539.
1540.
1541.
1542.
1543.
1544.
1545.
1546.
1547.
1548.
1549.
1550.
1551.
1552.
1553.
1554.
1555.
1556.
1557.
1558.
1559.
1560.
1561.
1562.
1563.
1564.
1565.
1566.
1567.
1568.
1569.
1570.
1571.
1572.
1573.
1574.
1575.
1576.
1577.
1578.
1579.
1580.
1581.
1582.
1583.
1584.
1585.
1586.
1587.
1588.
1589.
1590.
1591.
1592.
1593.
1594.
1595.
1596.
1597.
1598.
1599.
1600.
1601.
1602.
1603.
1604.
1605.
1606.
1607.
1608.
1609.
1610.
1611.
1612.
1613.
1614.
1615.
1616.
1617.
1618.
1619.
1620.
1621.
1622.
1623.
1624.
1625.
1626.
1627.
1628.
1629.
1630.
1631.
1632.
1633.
1634.
1635.
1636.
1637.
1638.
1639.
1640.
1641.
1642.
1643.
1644.
1645.
1646.
1647.
1648.
1649.
1650.
1651.
1652.
1653.
1654.
1655.
1656.
1657.
1658.
1659.
1660.
1661.
1662.
1663.
1664.
1665.
1666.
1667.
1668.
1669.
1670.
1671.
1672.
1673.
1674.
1675.
1676.
1677.
1678.
1679.
1680.
1681.
1682.
1683.
1684.
1685.
1686.
1687.
1688.
1689.
1690.
1691.
1692.
1693.
1694.
1695.
1696.
1697.
1698.
1699.
1700.
1701.
1702.
1703.
1704.
1705.
1706.
1707.
1708.
1709.
1710.
1711.
1712.
1713.
1714.
1715.
1716.
1717.
1718.
1719.
1720.
1721.
1722.
1723.
1724.
1725.
1726.
1727.
1728.
1729.
1730.
1731.
1732.
1733.
1734.
1735.
1736.
1737.
1738.
1739.
1740.
1741.
1742.
1743.
1744.
1745.
1746.
1747.
1748.
1749.
1750.
1751.
1752.
1753.
1754.
1755.
1756.
1757.
1758.
1759.
1760.
1761.
1762.
1763.
1764.
1765.
1766.
1767.
1768.
1769.
1770.
1771.
1772.
1773.
1774.
1775.
1776.
1777.
1778.
1779.
1780.
1781.
1782.
1783.
1784.
1785.
1786.
1787.
1788.
1789.
1790.
1791.
1792.
1793.
1794.
1795.
1796.
1797.
1798.
1799.
1800.
1801.
1802.
1803.
1804.
1805.
1806.
1807.
1808.
1809.
1810.
1811.
1812.
1813.
1814.
1815.
1816.
1817.
1818.
1819.
1820.
1821.
1822.
1823.
1824.
1825.
1826.
1827.
1828.
1829.
1830.
1831.
1832.
1833.
1834.
1835.
1836.
1837.
1838.
1839.
1840.
1841.
1842.
1843.
1844.
1845.
1846.
1847.
1848.
1849.
1850.
1851.
1852.
1853.
1854.
1855.
1856.
1857.
1858.
1859.
1860.
1861.
1862.
1863.
1864.
1865.
1866.
1867.
1868.
1869.
1870.
1871.
1872.
1873.
1874.
1875.
1876.
1877.
1878.
1879.
1880.
1881.
1882.
1883.
1884.
1885.
1886.
1887.
1888.
1889.
1890.
1891.
1892.
1893.
1894.
1895.
1896.
1897.
1898.
1899.
1900.
1901.
1902.
1903.
1904.
1905.
1906.
1907.
1908.
1909.
1910.
1911.
1912.
1913.
1914.
1915.
1916.
1917.
1918.
1919.
1920.
1921.
1922.
1923.
1924.
1925.
1926.
1927.
1928.
1929.
1930.
1931.
1932.
1933.
1934.
1935.
1936.
1937.
1938.
1939.
1940.
1941.
1942.
1943.
1944.
1945.
1946.
1947.
1948.
1949.
1950.
1951.
1952.
1953.
1954.
1955.
1956.
1957.
1958.
1959.
1960.
1961.
1962.
1963.
1964.
1965.
1966.
1967.
1968.
1969.
1970.
1971.
1972.
1973.
1974.
1975.
1976.
1977.
1978.
1979.
1980.
1981.
1982.
1983.
1984.
1985.
1986.
1987.
1988.
1989.
1990.
1991.
1992.
1993.
1994.
1995.
1996.
1997.
1998.
1999.
2000.
2001.
2002.
2003.
2004.
2005.
2006.
2007.
2008.
2009.
2010.
2011.
2012.
2013.
2014.
2015.
2016.
2017.
2018.
2019.
2020.
2021.
2022.
2023.
2024.
2025.
2026.
2027.
2028.
2029.
2030.
2031.
2032.
2033.
2034.
2035.
2036.
2037.
2038.
2039.
2040.
2041.
2042.
2043.
2044.
2045.
2046.
2047.
2048.
2049.
2050.
2051.
2052.
2053.
2054.
2055.
2056.
2057.
2058.
2059.
2060.
2061.
2062.
2063.
2064.
2065.
2066.
// ==UserScript==
// @name Bot na e2 test!!!
// @version 1.54
// @description bot na e2 w trakcie rozbudowy, dziala na NI i SI
// @author Adi Wilk
// @match http://*.margonem.pl/
// @match https://*.margonem.pl/
// @grant none
// ==/UserScript==
function _instanceof(left, right) {
if (
right != null &&
typeof Symbol !== "undefined" &&
right[Symbol.hasInstance]
) {
return right[Symbol.hasInstance](left);
} else {
return left instanceof right;
}
}
function _slicedToArray(arr, i) {
return (
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
);
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (
var _i = arr[Symbol.iterator](), _s;
!(_n = (_s = _i.next()).done);
_n = true
) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof(obj) {
return typeof obj;
};
} else {
_typeof = function _typeof(obj) {
return obj &&
typeof Symbol === "function" &&
obj.constructor === Symbol &&
obj !== Symbol.prototype
? "symbol"
: typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!_instanceof(instance, Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
(function() {
var a =
/*#__PURE__*/
(function() {
"use strict";
function a(_a, b, c, d, e, f) {
_classCallCheck(this, a);
(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),
this.addNeighbours(),
(this.openSet = []),
(this.closedSet = []),
this.openSet.push(this.start);
}
_createClass(a, [
{
key: "parseCollisions",
value: function parseCollisions(a, c, d) {
var e = Array(c);
for (var f = 0; f < c; f++) {
e[f] = Array(d);
for (var g = 0; g < d; g++) {
e[f][g] = new b(f, g, "0" !== a.charAt(f + g * c));
}
}
return e;
}
},
{
key: "addNeighbours",
value: function addNeighbours() {
for (var _a2 = 0; _a2 < this.width; _a2++) {
for (var _b = 0; _b < this.height; _b++) {
this.addPointNeighbours(this.collisions[_a2][_b]);
}
}
}
},
{
key: "addPointNeighbours",
value: function addPointNeighbours(a) {
var _ref = [a.x, a.y],
b = _ref[0],
c = _ref[1],
d = [];
0 < b && d.push(this.collisions[b - 1][c]),
0 < c && d.push(this.collisions[b][c - 1]),
b < this.width - 1 && d.push(this.collisions[b + 1][c]),
c < this.height - 1 && d.push(this.collisions[b][c + 1]),
(a.neighbours = d);
}
},
{
key: "anotherFindPath",
value: function anotherFindPath() {
for (; 0 < this.openSet.length; ) {
var _a3 = this.getLowestF(),
_b2 = this.openSet[_a3];
if (_b2 === this.end) return this.reconstructPath();
this.openSet.splice(_a3, 1), this.closedSet.push(_b2);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (
var _iterator = _b2.neighbours[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next())
.done);
_iteratorNormalCompletion = true
) {
var _a4 = _step.value;
if (this.closedSet.includes(_a4)) continue;
else {
var c = _b2.g + 1;
var d = !1;
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)),
d &&
((_a4.previous = _b2),
(_a4.g = c),
(_a4.f = _a4.g + _a4.h));
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
}
},
{
key: "getLowestF",
value: function getLowestF() {
var a = 0;
for (var _b3 = 0; _b3 < this.openSet.length; _b3++) {
this.openSet[_b3].f < this.openSet[a].f && (a = _b3);
}
return a;
}
},
{
key: "reconstructPath",
value: function reconstructPath() {
var a = [];
for (var _b4 = this.end; _b4 !== this.start; ) {
a.push(_b4), (_b4 = _b4.previous);
}
return a;
}
},
{
key: "heuristic",
value: function heuristic(a, b) {
return Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
}
}
]);
return a;
})();
var b = function b(a, _b5, c) {
"use strict";
_classCallCheck(this, b);
(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);
};
new /*#__PURE__*/
((function() {
"use strict";
function _class() {
_classCallCheck(this, _class);
(this.storage = JSON.parse(localStorage.getItem("adi-bot-storage")) || {
x: 0,
y: 0,
name: "",
minimalized: !1
}),
(this.interface =
"object" == _typeof(window.Engine)
? "ni"
: "object" == _typeof(window.g)
? "si"
: "none"),
(this.lootfilterSettings = JSON.parse(
localStorage.getItem("adi-bot-lootfilterSettings123")
) || {
stat: {
all: {
translation: "u0141ap wszystkie itemki",
active: !0
},
gold: {
translation: "Zu0142oto",
active: !0
},
quest: {
translation: "Questowe",
active: !0
},
runes: {
translation: "Runy",
active: !0
},
unique: {
translation: "Unikaty",
active: !0
},
heroic: {
translation: "Heroiki",
active: !0
},
legendary: {
translation: "Legendy",
active: !0
}
},
names: []
}),
(this.QuickGroupSettings = JSON.parse(
localStorage.getItem("adi-bot-QuickGroupSettings12")
) || {
adding: {
translation: "Automatycznie dodawaj do grupy znaj/klan",
active: !0
},
accepting: {
translation: "Automatycznie przyjmuj zaproszenia do grupy",
active: !0
},
reSendingMessage: {
translation: "Automatycznie odpisuj innym graczom",
active: !0
}
}),
(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",
"kiedyu015B to byu0142o, nie to co tera",
"to fajnie",
"nom",
"super",
"co ?",
"interesuju0105ce",
"bombowo",
"Bardzo siu0119 cieszu0119.",
"Xd",
"co",
"co.?",
"co?",
"xD",
"xd",
"ehhhhhh",
"heh",
"fajnie fajnie :]"
]),
(this.answersBeforeAddingToEnemies = [
"dobra, do wrogxF3w cie daje :)",
"papapappapapapap",
"nara.",
"w tyu0142ku cie mam gosciu, nara",
"papapapp",
"nara koleu017Cko",
"lecisz do wrogow :P",
"narka ;)",
"hehehehhe, narq",
"ej jesteu015B?",
"haha. ;)"
]),
(this.messagesInc =
JSON.parse(localStorage.getItem("adi-bot-messages")) || {}),
(this.isHealing = !1),
(this.isActuallySendingMessage = !1),
(this.startInctementingLagRefresher = !1),
(this.incrementValue = 0),
this.init();
}
_createClass(_class, [
{
key: "getNpcColsNI",
value: function getNpcColsNI() {
var a = {};
var _arr = Object.values(this.npcs);
for (var _i = 0; _i < _arr.length; _i++) {
var _arr$_i = _arr[_i],
_b6 = _arr$_i.x,
c = _arr$_i.y;
a[_b6 + 256 * c] = !0;
}
return a;
}
},
{
key: "chatParser",
value: function chatParser() {
var _this = this;
"ni" === this.interface &&
window.API.addCallbackToEvent("newMsg", function(_ref2) {
var _ref3 = _slicedToArray(_ref2, 2),
a = _ref3[0],
b = _ref3[1];
_this.chatFilter(b);
}),
"si" === this.interface &&
window.g.chat.parsers.push(function(a) {
_this.chatFilter(a);
});
}
},
{
key: "chatFilter",
value: function chatFilter(a) {
var b = a.n,
c = a.t,
d = a.ts,
e = a.k;
if (
"" !== b &&
b !== this.hero.nick &&
"System" !== b &&
!1 !== this.QuickGroupSettings.reSendingMessage.active &&
5 >= window.unix_time(!0) - d &&
!this.isActuallySendingMessage
) {
if (
void 0 !== this.messagesInc[b + this.world] &&
3 < this.messagesInc[b + this.world]
)
return;
c.toLowerCase().includes(this.hero.nick.toLowerCase()) &&
0 === e &&
this.sendMessage(b, e),
3 === e && this.sendMessage(b, e);
}
}
},
{
key: "sendMessage",
value: function sendMessage(a, b) {
var _this2 = this;
var c =
arguments.length > 2 && arguments[2] !== undefined
? arguments[2]
: !1;
var d = arguments.length > 3 ? arguments[3] : undefined;
(this.isActuallySendingMessage = !0),
this.messagesInc[a + this.world] === void 0
? (this.messagesInc[a + this.world] = 1)
: this.messagesInc[a + this.world]++,
this.saveMessages(),
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)
]),
3 === b && (d = "@".concat(a.split(" ").join("_"), " ").concat(d)),
this.Sleep(1e3 * (Math.floor(11 * Math.random()) + 5)).then(
function() {
window._g("chat", {
c: d
}),
!0 === c && _this2.addToEnemy(a),
(_this2.isActuallySendingMessage = !1);
}
);
}
},
{
key: "Sleep",
value: function Sleep(a) {
return new Promise(function(b) {
setTimeout(function() {
b(null);
}, a);
});
}
},
{
key: "saveMessages",
value: function saveMessages() {
localStorage.setItem(
"adi-bot-messages",
JSON.stringify(this.messagesInc)
);
}
},
{
key: "addToEnemy",
value: function addToEnemy(a) {
window._g("friends&a=eadd&nick=".concat(a));
}
},
{
key: "getWay",
value: function getWay(b, c) {
return new a(
this.collisions,
this.map.x,
this.map.y,
{
x: this.hero.x,
y: this.hero.y
},
{
x: b,
y: c
},
this.npccol
).anotherFindPath();
}
},
{
key: "goTo",
value: function goTo(a, b) {
var c = this.getWay(a, b);
Array.isArray(c) &&
("ni" === this.interface
? (window.Engine.hero.autoPath = c)
: (window.road = c));
}
},
{
key: "getDistanceToNpc",
value: function getDistanceToNpc(a, b) {
var c = this.getWay(a, b);
return Array.isArray(c) ? c.length : void 0;
}
},
{
key: "updateCollisions",
value: function updateCollisions() {
var a = [],
_this$map = this.map,
b = _this$map.x,
c = _this$map.y;
for (var d = 0; d < c; d++) {
for (var _c = 0; _c < b; _c++) {
a.push(window.Engine.map.col.check(_c, d));
}
}
return a.join("");
}
},
{
key: "initBox",
value: function initBox() {
var _this3 = this;
var a = document.createElement("div");
a.classList.add("adi-bot-box"),
this.appendText(a, "Wprowadu017A nazwy elit II:");
var b = document.createElement("input");
(b.type = "text"),
b.classList.add("adi-bot-input-text"),
(b.value = this.storage.name),
b.addEventListener("keyup", function() {
(_this3.storage.name = b.value), _this3.saveStorage();
}),
a.appendChild(b),
this.appendText(a, "Lootfilter:");
var _arr2 = Object.entries(this.lootfilterSettings.stat);
var _loop = function _loop() {
var _arr2$_i = _slicedToArray(_arr2[_i2], 2),
b = _arr2$_i[0],
_arr2$_i$ = _arr2$_i[1],
c = _arr2$_i$.translation,
d = _arr2$_i$.active;
_this3.createCheckBox(a, c, d, function(a) {
(_this3.lootfilterSettings.stat[b].active = a),
localStorage.setItem(
"adi-bot-lootfilterSettings123",
JSON.stringify(_this3.lootfilterSettings)
);
});
};
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
_loop();
}
this.appendText(a, "u0141ap itemki po nazwie:");
var c = document.createElement("input");
c.classList.add("adi-bot-input-text"),
(c.tip = "Oddzielaj przecinkiem!"),
(c.type = "text"),
(c.value = this.lootfilterSettings.names.join(", ")),
c.addEventListener("keyup", function() {
var a = c.value.split(",");
for (var _b7 = 0; _b7 < a.length; _b7++) {
a[_b7] = a[_b7].trim();
}
(_this3.lootfilterSettings.names = a),
localStorage.setItem(
"adi-bot-lootfilterSettings123",
JSON.stringify(_this3.lootfilterSettings)
);
}),
a.appendChild(c),
this.appendText(a, "Ustawienia QG:");
var _arr3 = Object.entries(this.QuickGroupSettings);
var _loop2 = function _loop2() {
var _arr3$_i = _slicedToArray(_arr3[_i3], 2),
b = _arr3$_i[0],
_arr3$_i$ = _arr3$_i[1],
c = _arr3$_i$.translation,
d = _arr3$_i$.active;
_this3.createCheckBox(a, c, d, function(a) {
(_this3.QuickGroupSettings[b].active = a),
localStorage.setItem(
"adi-bot-QuickGroupSettings12",
JSON.stringify(_this3.QuickGroupSettings)
);
});
};
for (var _i3 = 0; _i3 < _arr3.length; _i3++) {
_loop2();
}
this.makeBoxDraggable(a, function() {
(_this3.storage.x = parseInt(a.style.left)),
(_this3.storage.y = parseInt(a.style.top)),
_this3.saveStorage(),
window.message(
'Zapisano pozycju0119 okienka :)'
);
}),
this.storage.hasOwnProperty("minimalized") ||
((this.storage.minimalized = !1), this.saveStorage()),
a.addEventListener("dblclick", function(_ref4) {
var b = _ref4.x,
c = _ref4.y;
!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)),
_this3.saveStorage();
}),
"ni" === this.interface
? document.querySelector(".game-window-positioner").appendChild(a)
: document.body.appendChild(a),
this.initStyle(),
!0 === this.storage.minimalized &&
((a.style.width = "10px"),
(a.style.height = "10px"),
this.changeVisibility(a, !0));
}
},
{
key: "changeVisibility",
value: function changeVisibility(a, b) {
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (
var _iterator2 = a.childNodes[Symbol.iterator](), _step2;
!(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done);
_iteratorNormalCompletion2 = true
) {
var c = _step2.value;
c.style.display = !0 === b ? "none" : "";
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
_iterator2.return();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
}
},
{
key: "appendText",
value: function appendText(a, b) {
var c = document.createElement("div");
c.appendChild(document.createTextNode(b)), a.appendChild(c);
}
},
{
key: "createCheckBox",
value: function createCheckBox(a, b, c, d) {
var e = document.createElement("div"),
f = document.createElement("input");
(f.type = "checkbox"),
(f.name = b + "adi-bot"),
(f.id = b + "adi-bot"),
(f.checked = c),
e.appendChild(f);
var g = document.createElement("label");
g.setAttribute("for", b + "adi-bot"),
(g.innerHTML = b),
f.addEventListener("change", function() {
d(f.checked);
}),
e.appendChild(g),
a.appendChild(e);
}
},
{
key: "makeBoxDraggable",
value: function makeBoxDraggable(a, b) {
$(a).draggable({
containment: "window",
stop: b
});
}
},
{
key: "saveStorage",
value: function saveStorage() {
localStorage.setItem("adi-bot-storage", JSON.stringify(this.storage));
}
},
{
key: "initStyle",
value: function initStyle() {
var a = document.createElement("style"),
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 "
);
(a.type = "text/css"),
a.appendChild(document.createTextNode(b)),
document.head.appendChild(a);
}
},
{
key: "initNewNpc",
value: function initNewNpc() {
var _this4 = this;
if (
("ni" === this.interface &&
(window.API.addCallbackToEvent("newNpc", function(a) {
void 0 !== a && _this4.addNpcs(a.d);
}),
window.API.addCallbackToEvent("removeNpc", function(a) {
void 0 !== a && _this4.removeNpcs(a.d);
})),
"si" === this.interface)
) {
var _a5 = window.newNpc;
window.newNpc = function(b) {
if (void 0 !== b) {
var _arr4 = Object.entries(b);
for (var _i4 = 0; _i4 < _arr4.length; _i4++) {
var _arr4$_i = _slicedToArray(_arr4[_i4], 2),
_a6 = _arr4$_i[0],
c = _arr4$_i[1];
void 0 !== c.del && void 0 !== window.g.npc[_a6]
? _this4.removeNpcs(window.g.npc[_a6], _a6)
: void 0 !== c && _this4.addNpcs(c, _a6);
}
}
_a5(b);
};
}
}
},
{
key: "initNewOther",
value: function initNewOther() {
var _this5 = this;
if (
("ni" === this.interface &&
(this.makeParty(),
window.API.addCallbackToEvent("newOther", function(a) {
_this5.filterOther(a.d);
})),
"si" === this.interface)
) {
this.makeParty();
var _a7 = window.newOther;
window.newOther = function(b) {
if ((_a7(b), void 0 !== b)) {
var _arr5 = Object.values(b);
for (var _i5 = 0; _i5 < _arr5.length; _i5++) {
var _a8 = _arr5[_i5];
_this5.filterOther(_a8);
}
}
};
}
}
},
{
key: "filterOther",
value: function filterOther(a) {
if (a !== void 0) {
var _b8 = a.relation,
c = a.id;
!0 === this.canHeroTryToAttack() &&
["cl", "fr"].includes(_b8) &&
!0 === this.QuickGroupSettings.adding.active &&
this.sendInviteToParty(c);
}
}
},
{
key: "makeParty",
value: function makeParty() {
if ("object" != _typeof(this.party)) return this.sendInvites();
var a =
"ni" === this.interface
? this.party.getLeaderId() === this.hero.id
: 1 === this.party[this.hero.id].r;
!0 == a && this.sendInvites();
}
},
{
key: "sendInvites",
value: function sendInvites() {
if (this.others !== void 0) {
var _arr6 = Object.values(this.others);
for (var _i6 = 0; _i6 < _arr6.length; _i6++) {
var _a9 = _arr6[_i6];
this.filterOther(_a9);
}
}
}
},
{
key: "sendInviteToParty",
value: function sendInviteToParty(a) {
window._g("party&a=inv&id=".concat(a));
}
},
{
key: "initChecker",
value: function initChecker() {
var _this6 = this;
if (
(setTimeout(function() {
_this6.initChecker();
}, 500),
!0 === this.dead &&
(this.removeNpcsFromThisCharId(this.hero.id), this.logout()),
!0 === this.canHeroTryToAttack())
)
try {
if (void 0 !== this.npcToKillId) {
var _this$npcs$this$npcTo = this.npcs[this.npcToKillId],
_a10 = _this$npcs$this$npcTo.x,
_b9 = _this$npcs$this$npcTo.y;
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) {
return a.hasOwnProperty("alert") &&
a.alert.includes(
"Przeciwnik walczy juu017C z kimu015B innym"
)
? void (_this6.lastAttackTimestamp =
_this6.timeStamp + 2)
: void (_this6.lastAttackTimestamp =
_this6.timeStamp + 1);
}
)
: this.goTo(_a10, _b9);
} else this.reFindNpcs();
} catch (a) {
this.npcToKillId = void 0;
}
}
},
{
key: "canHeroTryToAttack",
value: function canHeroTryToAttack() {
return !(this.battle || this.dead);
}
},
{
key: "removeNpcs",
value: function removeNpcs(a) {
var b = a.x,
c = a.y,
d = a.nick,
e = a.lvl;
"ni" === this.interface
? window.Engine.map.col.unset(
b,
c,
window.Engine.map.col.check(b, c)
)
: window.map.nodes.changeCollision(b, c, 0),
this.storage.name !== void 0 &&
this.storage.name.toLowerCase().includes(d.toLowerCase()) &&
(this.addNpcToTimer(d, e),
(this.npcToKillId = void 0),
this.reFindNpcs());
}
},
{
key: "findEilteIIName",
value: function findEilteIIName(a) {
var _arr7 = Object.values(this.npcs);
for (var _i7 = 0; _i7 < _arr7.length; _i7++) {
var _b10 = _arr7[_i7];
var c = _b10.nick,
d = _b10.lvl,
e = _b10.grp,
f = _b10.wt;
if (e === a && 19 < f) return [c, d];
}
}
},
{
key: "addNpcs",
value: function addNpcs(a, b) {
"ni" === this.interface && (b = a.id), this.filterNpc(a, b);
}
},
{
key: "isNpcFake",
value: function isNpcFake(a, b) {
var c = new Image(),
d = document.createElement("canvas").getContext("2d"),
e = function e() {
var a = d.getImageData(Math.floor(d.width / 2), 0, 1, d.height)
.data;
for (var _c2 = 3; _c2 < a.length; _c2 += 4) {
if (0 < a[_c2]) return b(!1);
}
return b(!0);
};
(c.onload = function() {
(d.width = this.width),
(d.height = this.height),
d.drawImage(c, 0, 0),
e();
}),
(c.src = a);
}
},
{
key: "filterNpc",
value: function filterNpc(a, b) {
var _this7 = this;
var c = a.nick,
d = a.icon,
e = a.type,
f = a.wt,
g = a.grp;
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
) {
var _a11 = d.includes("/obrazki/npc/")
? d
: "/obrazki/npc/".concat(d);
this.isNpcFake(_a11, function(a) {
!1 === a &&
((_this7.npcToKillId =
0 === g
? parseInt(b)
: parseInt(_this7.findBestNpcFromGrp(g))),
_this7.makeParty());
});
}
}
},
{
key: "findBestNpcFromGrp",
value: function findBestNpcFromGrp(a) {
var b,
c = 999999;
var _arr8 = Object.entries(this.npcs);
for (var _i8 = 0; _i8 < _arr8.length; _i8++) {
var _arr8$_i = _slicedToArray(_arr8[_i8], 2),
d = _arr8$_i[0],
e = _arr8$_i[1];
var f = e.x,
g = e.y,
h = e.grp;
if (a === h) {
var _a12 = this.getDistanceToNpc(f, g);
_a12 < c && ((b = d), (c = _a12));
}
}
return b;
}
},
{
key: "reFindNpcs",
value: function reFindNpcs() {
var _arr9 = Object.entries(this.npcs);
for (var _i9 = 0; _i9 < _arr9.length; _i9++) {
var _arr9$_i = _slicedToArray(_arr9[_i9], 2),
_a13 = _arr9$_i[0],
_b11 = _arr9$_i[1];
this.filterNpc(_b11, _a13);
}
}
},
{
key: "loout",
value: function logout() {
this.battle ||
this.loots ||
this.issetMyNpcOnMap ||
this.isHealing ||
(window.location.href = "http://margonem.pl");
}
},
{
key: "logIn",
value: function logIn(a, b) {
if (
("none" === this.interface ||
void 0 === this.hero.id ||
this.hero.id != a) &&
!(
"none" !== this.interface &&
(this.battle ||
this.loots ||
this.issetMyNpcOnMap ||
this.isHealing)
)
)
try {
var c = new Date();
c.setTime(c.getTime() + 259200000),
(document.cookie = "mchar_id="
.concat(a, "; path=/; expires=")
.concat(c.toGMTString(), "; domain=.margonem.pl")),
(window.location.href = "http://".concat(
b.toLowerCase(),
".margonem.pl"
));
} catch (a) {}
}
},
{
key: "getNewRespawnTime",
value: function getNewRespawnTime(a) {
return Math.round(
(1 *
(60 *
(200 < a
? 18
: Math.min(18, 0.7 + 0.18 * a - 45e-5 * a * a)))) /
parseInt(this.serverTimerSpeed)
);
}
},
{
key: "addNpcToTimer",
value: function addNpcToTimer(a, b) {
var c = this.mapName;
(this.timerData[a + this.world] = {
name: a,
lvl: b,
mapName: c,
nextRespawn: this.timeStamp + this.getNewRespawnTime(b),
charId: this.hero.id,
world: this.world
}),
this.saveTimersCookies();
}
},
{
key: "deleteNpcFromTimer",
value: function deleteNpcFromTimer(a) {
this.timerData[a] !== void 0 &&
(delete this.timerData[a], this.saveTimersCookies());
}
},
{
key: "removeNpcsFromThisCharId",
value: function removeNpcsFromThisCharId(a) {
if (void 0 !== a) {
var _arr10 = Object.entries(this.timerData);
for (var _i10 = 0; _i10 < _arr10.length; _i10++) {
var _arr10$_i = _slicedToArray(_arr10[_i10], 2),
_b12 = _arr10$_i[0],
c = _arr10$_i[1];
c.charId == a && this.deleteNpcFromTimer(_b12);
}
}
}
},
{
key: "checkTimers",
value: function checkTimers() {
var _arr11 = Object.entries(this.timerData);
for (var _i11 = 0; _i11 < _arr11.length; _i11++) {
var _arr11$_i = _slicedToArray(_arr11[_i11], 2),
_a14 = _arr11$_i[0],
_b13 = _arr11$_i[1];
_b13.nextRespawn + this.waitForNpcRespawn < this.timeStamp &&
this.createNewRespawnTime(_a14);
}
}
},
{
key: "createNewRespawnTime",
value: function createNewRespawnTime(a) {
var _this8 = this;
if (
!(
Object.values(this.npcs).some(function(b) {
return b.nick == _this8.timerData[a].name;
}) || this.timerData[a].charId !== this.hero.id
)
) {
for (; this.timeStamp > this.timerData[a].nextRespawn; ) {
this.timerData[a].nextRespawn += this.getNewRespawnTime(
this.timerData[a].lvl
);
}
this.saveTimersCookies();
}
}
},
{
key: "isThisHeroIssetInTimer",
value: function isThisHeroIssetInTimer(b) {
return (
void 0 !== b &&
Object.values(this.timerData).some(function(c) {
return c.charId == b;
})
);
}
},
{
key: "isntTimersInRange",
value: function isntTimersInRange() {
var _this9 = this;
return Object.values(this.timerData).every(function(b) {
return b.nextRespawn - _this9.timeStamp > _this9.delayToRelog;
});
}
},
{
key: "checkHeroOnGoodMap",
value: function checkHeroOnGoodMap(a) {
var _arr12 = Object.entries(this.timerData);
for (var _i12 = 0; _i12 < _arr12.length; _i12++) {
var _arr12$_i = _slicedToArray(_arr12[_i12], 2),
_b14 = _arr12$_i[0],
c = _arr12$_i[1];
var d = c.mapName,
e = c.charId;
e == a &&
this.mapName !== void 0 &&
d !== void 0 &&
d !== this.mapName &&
this.deleteNpcFromTimer(_b14);
}
}
},
{
key: "initTimer",
value: function initTimer() {
var _this10 = this;
if (0 < Object.keys(this.timerData).length)
if ("none" === this.interface) {
if (
Object.values(this.timerData).some(function(b) {
return (
b.nextRespawn - _this10.timeStamp <= _this10.delayToRelog
);
})
) {
var _Object$values$reduce = Object.values(
this.timerData
).reduce(function(c, a) {
return c.nextRespawn <= a.nextRespawn ? c : a;
}),
_a15 = _Object$values$reduce.world,
_b15 = _Object$values$reduce.charId;
void 0 !== _b15 && this.logIn(_b15, _a15);
}
} else if (
this.isntTimersInRange() &&
this.isThisHeroIssetInTimer(this.hero.id)
)
this.logout();
else {
this.checkHeroOnGoodMap(this.hero.id);
var _a16 = Object.values(this.timerData).filter(function(b) {
return (
b.nextRespawn - _this10.timeStamp <= _this10.delayToRelog
);
});
if (0 < _a16.length) {
var _a16$reduce = _a16.reduce(function(c, a) {
return c.nextRespawn <= a.nextRespawn ? c : a;
}),
_b16 = _a16$reduce.charId,
c = _a16$reduce.world;
void 0 !== this.hero.id &&
parseInt(_b16) !== this.hero.id &&
this.logIn(_b16, c);
}
}
this.checkTimers(),
setTimeout(function() {
_this10.initTimer();
}, 500);
}
},
{
key: "saveTimersCookies",
value: function saveTimersCookies() {
var a = new Date();
a.setMonth(a.getMonth() + 1),
this.setCookie(
"adi-bot-timer",
JSON.stringify(this.timerData),
a,
"/",
"margonem.pl"
);
}
},
{
key: "randomSeconds",
value: function randomSeconds(a, b) {
return (
(a *= 60), (b *= 60), Math.floor(Math.random() * (b - a + 1)) + a
);
}
},
{
key: "randomRefresh",
value: function randomRefresh() {
var _this$refreshTime = _slicedToArray(this.refreshTime, 2),
a = _this$refreshTime[0],
b = _this$refreshTime[1];
setTimeout(function() {
location.href = location.href;
}, 1e3 * this.randomSeconds(a, b));
}
},
{
key: "getCookie",
value: function getCookie(a) {
var b = document.cookie,
c = a + "=";
var d = b.indexOf("; " + c);
if (-1 != d) d += 2;
else if (((d = b.indexOf(c)), 0 != d)) return null;
var e = document.cookie.indexOf(";", d);
return (
-1 == e && (e = b.length), unescape(b.substring(d + c.length, e))
);
}
},
{
key: "setCookie",
value: function setCookie(a, b, c, d, e, f) {
var g =
a +
"=" +
escape(b) +
(c ? "; expires=" + c.toGMTString() : "") +
(d ? "; path=" + d : "") +
(e ? "; domain=" + e : "") +
(f ? "; secure" : "");
document.cookie = g;
}
},
{
key: "createTimerOnMainPage",
value: function createTimerOnMainPage() {
var _this11 = this;
if (0 === Object.keys(this.timerData).length) return;
var a = document.createElement("div");
a.classList.add("adi-bot-minutnik-strona-glowna"),
document.querySelector(".rmenu").appendChild(a);
var b = document.createElement("style");
(b.type = "text/css"),
b.appendChild(
document.createTextNode(
"n .adi-bot-minutnik-strona-glowna {n color: white;n font-size: 14px;n text-align: left;n }nn .timer_data {n font-weight: bold;n float: right;n cursor: pointer;n }nn .timer_data:hover {n color: gray;n }nn .adi-bot-konfiguracja {nn }n "
)
),
document.head.appendChild(b),
this.addNpcsToTimerBox(a),
document.addEventListener("click", function(a) {
try {
if ("timer_data" === a.target.className) {
var _a$target$getAttribut = a.target
.getAttribute("timer-data")
.split("|"),
_a$target$getAttribut2 = _slicedToArray(
_a$target$getAttribut,
2
),
_b17 = _a$target$getAttribut2[0],
c = _a$target$getAttribut2[1];
c !== void 0 &&
_b17 !== void 0 &&
(_this11.deleteNpcFromTimer(_b17 + c),
window.showMsg(
"Usuniu0119to "
.concat(_b17, " ze u015Bwiata ")
.concat(c.charAt(0).toUpperCase() + c.slice(1), ".")
));
}
} catch (a) {}
});
}
},
{
key: "addNpcsToTimerBox",
value: function addNpcsToTimerBox(a) {
var _this12 = this;
var b = {};
var _arr13 = Object.values(this.timerData);
for (var _i13 = 0; _i13 < _arr13.length; _i13++) {
var _c3 = _arr13[_i13];
var _a17 = _c3.name,
d = _c3.nextRespawn,
e = _c3.world;
b[e] === void 0
? (b[e] = [
{
name: _a17,
nextRespawn: d
}
])
: b[e].push({
name: _a17,
nextRespawn: d
});
}
var c = "";
var _arr14 = Object.entries(b);
for (var _i14 = 0; _i14 < _arr14.length; _i14++) {
var _arr14$_i = _slicedToArray(_arr14[_i14], 2),
d = _arr14$_i[0],
e = _arr14$_i[1];
(c += '