// ==UserScript==
// @name Zap z całej mapy pod G
// @version 1.0
// @match https://*.margonem.pl/
// @grant none
// @author Fire Devil
// @run-at document-body
// ==/UserScript==
var acceptGrp = mAlert;
mAlert = function(a,c,d,b){
acceptGrp(a,c,d,b);
if(a.indexOf('Czy chcesz doĹÄ
czyÄ do druĹźyny gracza') != -1) $('#a_ok').click();
};
$(document).keyup(function(e){
if(e.which==75 && e.target.tagName!="TEXTAREA" && e.target.tagName!='INPUT'){
for(n in g.other){
if ((Math.abs(hero.x - g.other[n].x) <= 1 && Math.abs(hero.y - g.other[n].y) <= 1) && !isset(g.party[n])){
_g("party&a=inv&id="+n)
}
}
}
});
(() => {
const canCreateParty = () => {
return (!window.g.party || window.g.party && window.g.party[window.hero.id].r === 1) && !window.g.battle && !window.g.dead;
}
const inParty = id => {
return window.g.party[id] !== undefined;
}
document.addEventListener("keyup", ev => {
if(ev.key === 'g' && !["INPUT", "TEXTAREA"].includes(ev.target.tagName) && canCreateParty()){
Object.entries(window.g.other).forEach(([id, {relation}]) => {
if([2, 4, 5].includes(relation) && !inParty(id)){
window._g(`party&a=inv&id=${id}`);
}
})
}
})
})()
Paste Hosted With By Wklejamy.pl