Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Brudasy
- // @version
- // @description opis
- // @author czop czop
- // @match *.margonem.pl*
- // @grant none
- // ==/UserScript==
- function enemiesOnMap(a) {
- var clans = ["eternals", "revolutions", "robię salto", "illuminators", "Evolution", "Czeka nas chwała"];
- var people = ['Dylu Dylu','Kaizereq','Kaizer','Mati Orangutan','Kairuś','Erdi'];
- people = people.map(element=>element.toLowerCase());
- var lista = [];
- var enemies = [];
- fetch(`/engine?t=friends&a=show&ev=${g.ev}&browser_token=${g.browser_token}&aid=${g.aid}`).then(body => body.json()).then(jsonFriends => {
- g.ev=jsonFriends.ev;
- jsonFriends.enemies.filter((_, index, _name) => !(index % 6)).forEach(enemy => enemies.push(enemy));
- newOther(g.other);
- });
- var czek = false;
- var oldnewOther = newOther;
- newOther = function (b) {
- oldnewOther(b);
- for (var c in b) {
- if (b[c].nick !== undefined) {
- var czas = new Date();
- var godzina = czas.getHours();
- if (godzina < 10) godzina = "0" + godzina;
- var minuta = czas.getMinutes();
- if (minuta < 10) minuta = "0" + minuta;
- var sekunda = czas.getSeconds();
- if (sekunda < 10) sekunda = "0" + sekunda;
- for (var i = 0; i < lista.length; i++) {
- if (lista[i] == b[c].id) {
- czek = true;
- break;
- } else {
- czek = false;
- continue;
- }
- }
- if (((b[c].clan && clans.includes(b[c].clan.name.toLowerCase()) && map.pvp == 2) || enemies.includes(c) || people.includes(b[c].nick.toLowerCase())) && czek == false) {
- lista.push(b[c].id);
- message('<span style="color: red; font-weight: bold">Wróg: ' + b[c].nick + '</span>');
- if (hero.clan) {
- chatSend("/k Wróg " + b[c].nick + " " + b[c].lvl + b[c].prof + " z klanu " + b[c].clan.name + " na mapie " + map.name + " na kordach " + b[c].x + "," + b[c].y + " - " + godzina + ":" + minuta + ":" + sekunda + ".");
- } else {
- chatSend("/k Wróg " + b[c].nick + " " + b[c].lvl + b[c].prof + " na mapie " + map.name + " na kordach " + b[c].x + "," + b[c].y + " - " + godzina + ":" + minuta + ":" + sekunda + ".");
- }
- for (var i = 0; i < lista.length; i++) {
- if (lista[i] == b[c].id) {
- setTimeout(function () {
- lista.splice(i, 1);
- }, 6e4);
- break;
- }
- }
- }
- }
- }
- };
- }
- g.loadQueue.push({
- fun: enemiesOnMap
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement