Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name zapraszanie znaj i klan na mapie
- // @version 0.1
- // @description try to take over the world!
- // @author frok
- // @match http://*.margonem.pl/
- // @grant none
- // ==/UserScript==
- (() => {
- 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.keyCode === 76 && !["INPUT", "TEXTAREA"].includes(ev.target.tagName) && canCreateParty()){
- Object.entries(window.g.other).forEach(([id, {relation}]) => {
- if(["cl", "fr"].includes(relation) && !inParty(id)){
- window._g(`party&a=inv&id=${id}`);
- }
- })
- }
- })
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement