Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Wykrywacz amatorow Arrivederci
- // @version 6.9
- // @description Wykrywacz pedalow
- // @author adi wilk
- // @match http://gefion.margonem.pl/
- // @grant none
- // ==/UserScript==
- (function(_n, data, ut) {
- //pobranie localStorage
- let dane = {};
- if (localStorage.getItem("adiherosybrutus")) {
- dane = JSON.parse(localStorage.getItem("adiherosybrutus"));
- }
- if (dane) {
- for (let i in dane) {
- if (ut() > dane[i].time) {
- delete dane[i];
- }
- }
- }
- //getTime
- function getTime() {
- let czas = new Date(),
- godzina = czas.getHours(),
- sekunda = czas.getSeconds(),
- minuta = czas.getMinutes();
- if (godzina < 10) godzina = `0${godzina}`;
- if (minuta < 10) minuta = `0${minuta}`;
- if (sekunda < 10) sekunda = `0${sekunda}`;
- return `${godzina}:${minuta}:${sekunda}`;
- }
- //funkcja wysłania na diskordzika
- function sendToDiscord(lvl, nick, icon, x, y) {
- $.ajax({
- url: data[0],
- type: 'POST',
- data: JSON.stringify({
- 'embeds': [{
- 'title': `${hero.nick} · ${hero.lvl}${hero.prof} znalazł herosa/tytana!`,
- 'color': ((Math.floor(lvl / 300 * 221) + 32) * 256 + (Math.floor(lvl / 300 * (-112)) + 120)) * 256 + Math.floor(lvl / 300 * (-204)) + 217,
- 'description': `${nick} (${lvl}lvl)\n${map.name} (${x}, ${y})\n${getTime()}\n${g.worldname[0].toUpperCase() + g.worldname.substring(1)}`,
- 'thumbnail': {
- 'url': `http://gefion.margonem.pl${icon}`
- }
- }],
- content: `@everyone ${nick} na mapie ${map.name}`,
- username: `Wołacz`,
- avatar_url: `http://vignette4.wikia.nocookie.net/happyfeet/images/2/2e/18.1e045.happyfeet1.C--300x300.jpg`
- }),
- contentType: 'application/json; charset=utf-8',
- dataType: 'json',
- async: false
- });
- }
- //funkcja sprawdzajaca czy dane id z ts istnieje
- function checkHerosData(id) {
- if (dane[id]) {
- if (ut() > dane[id].time) {
- delete dane[id];
- return true;
- } else {
- return false;
- }
- }
- return true;
- }
- newNpc = function(e) {
- _n.apply(this, arguments);
- for (let i in e) {
- let heros = e[i];
- if (map.mode != 5 && heros.lvl == 51 && heros.wt > 79 && g.worldname != "experimental" && checkHerosData(heros.id)) {
- dane[heros.id] = {
- time: ut() + (10 * 60)
- }
- localStorage.setItem("adiherosybrutus", JSON.stringify(dane));
- if (hero.clan > 0) chatSend(`/k Znalazłem ${heros.nick} ${heros.lvl}lvl na mapie ${map.name}(${heros.x},${heros.y}).`);
- sendToDiscord(heros.lvl, heros.nick, heros.icon, heros.x, heros.y);
- break;
- }
- }
- }
- })(newNpc, ["https://discordapp.com/api/webhooks/600639304586231849/3_S8rE58mQugseRV0OEcIzTiED0gQoqMndsCknr5YIQRvJKINBXcOBM9S812ESZgamt9"], unix_time)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement