Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Brudasy
- // @version 1.1
- // @description opis
- // @author adison
- // @match *://*/
- // @grant none
- // ==/UserScript==
- ((_pI, hero, ts, message, chatSend, _newOther, map, g, enemyClans) => {
- const getTime = () => {
- const time = new Date();
- const hours = time.getHours() < 10 ? `0${time.getHours()}` : time.getHours();
- const minutes = time.getMinutes() < 10 ? `0${time.getMinutes()}` : time.getMinutes();
- const seconds = time.getSeconds() < 10 ? `0${time.getSeconds()}` : time.getSeconds();
- return `${hours}:${minutes}:${seconds}`;
- }
- const tabWithsIds = localStorage.getItem("tabWithsIds") ? JSON.parse(localStorage.getItem("tabWithsIds")) : new Object();
- const sendInfo = (player) => {
- const {
- x,
- y,
- nick,
- clan
- } = player;
- message(`<span style="color: red; font-weight: bold">Wróg: ${nick}</span>`);
- if (hero.clan > 0) {
- chatSend(`/k Wróg ${nick}${clan ? ` z klanu ${clan}` : ``} na mapie ${map.name} na kordach ${x},${y} - ${getTime()}.`);
- }
- localStorage.setItem("tabWithsIds", JSON.stringify(tabWithsIds));
- }
- const checkPlayer = (player) => {
- const {
- id
- } = player;
- if (!tabWithsIds[id]) {
- tabWithsIds[id] = {
- time: ts()
- }
- sendInfo(player);
- } else if (tabWithsIds[id].time > ts() + 60 * 1000) {
- tabWithsIds[id] = undefined;
- sendInfo(player);
- }
- }
- window.newOther = e => {
- Object.values(e).forEach(player => {
- const {
- nick,
- x,
- clan,
- relation
- } = player;
- if (nick !== undefined && x !== undefined) {
- if (map.pvp == 2 && (["en", "cl-en"].includes(relation) || (clan && enemyClans.includes(clan.toLowerCase())))) {
- checkPlayer(player);
- }
- }
- });
- _newOther(e);
- }
- window.parseInput = (a, b, c) => {
- if (a.hasOwnProperty("f") && a.f.init == 1 && hero.clan > 0) {
- if (!Object.keys(a.f.w).some(id => id < 0)) {
- const team1 = new Array();
- const team2 = new Array();
- for (let x of Object.values(a.f.w))
- x.team == 1 && team1.push(`${x.name} ${x.lvl}${x.prof}`) || team2.push(`${x.name} ${x.lvl}${x.prof} `);
- if (a.f.myteam == 2 && hero.clan > 0) window.chatSend(`/k Zostałem zaatakowany na mapie ${map.name} o godzinie ${getTime()}. ${team1.join(", ")} vs. ${team2.join(", ")}`);
- }
- }
- _pI(a, b, c);
- }
- })(window.parseInput, window.hero, window.ts, window.message, window.chatSend, window.newOther, window.map, window.g, [
- "arystokracja", "freedom", "Archanioły Ciemności", "himaya", "death eaters", "slaughterer", "magnateria", "tórbinoxy i szczeliny", "phasianae", "zwykły klan", "vide cui fide", "hebi", "archanioły ciemności", "fighters of honor", "aeternus"
- ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement