Facebook
From Commodious Sheep, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 214
  1. // ==UserScript==
  2. // @name         rozbudowaneKtoTuJest v2.00
  3. // @version      2.12
  4. // @description  A takie se ktotujest z takimi se funkcjami różnyśnymi.
  5. // @match        *://*/
  6. // @grant        none
  7. // ==/UserScript==
  8. //skrypt pościgu
  9.  
  10. $.getScript("https://pastebin.com/raw/R8hHUftc");
  11.  
  12. var powiadomienia = localStorage;
  13. if (powiadomienia.getItem('pdzwiekowe') == null) powiadomienia.setItem('pdzwiekowe', 'false');
  14. g.loadQueue.push({
  15.     fun: function() {
  16.         $('<div id="pDzw">Włącz powiadomienia dźwiękowe</div>').appendTo('#cfg_options').click(function() {
  17.             if ($('#pDzw').attr('style') == 'background-position: 0px -22px') {
  18.                 $('#pDzw').attr('style', 'background-position: 0px 0px');
  19.                 powiadomienia.setItem('pdzwiekowe', 'false')
  20.             } else {
  21.                 $('#pDzw').attr('style', 'background-position: 0px -22px');
  22.                 powiadomienia.setItem('pdzwiekowe', 'true')
  23.             }
  24.         });
  25.         if (powiadomienia.getItem('pdzwiekowe') == 'true') $('#pDzw').attr('style', 'background-position: 0px -22px');
  26.         else $('#pDzw').attr('style', 'background-position: 0px 0px');
  27.     },
  28.     data: ''
  29. });
  30.  
  31. if (powiadomienia.getItem('pwrog') == null) powiadomienia.setItem('pwrog', 'false');
  32. g.loadQueue.push({
  33.     fun: function() {
  34.         $('<div id="pTekst">Informuj o wrogu na mapce</div>').appendTo('#cfg_options').click(function() {
  35.             if ($('#pTekst').attr('style') == 'background-position: 0px -22px') {
  36.                 $('#pTekst').attr('style', 'background-position: 0px 0px');
  37.                 powiadomienia.setItem('pwrog', 'false')
  38.             } else {
  39.                 $('#pTekst').attr('style', 'background-position: 0px -22px');
  40.                 powiadomienia.setItem('pwrog', 'true')
  41.             }
  42.         });
  43.         if (powiadomienia.getItem('pwrog') == 'true') $('#pTekst').attr('style', 'background-position: 0px -22px');
  44.         else $('#pTekst').attr('style', 'background-position: 0px 0px');
  45.     },
  46.     data: ''
  47. });
  48.  
  49. if (powiadomienia.getItem('ptyt') == null) powiadomienia.setItem('ptyt', 'false');
  50. g.loadQueue.push({
  51.     fun: function() {
  52.         $('<div id="pTytan">Informuj o tytanie/herosie na mapie</div>').appendTo('#cfg_options').click(function() {
  53.             if ($('#pTytan').attr('style') == 'background-position: 0px -22px') {
  54.                 $('#pTytan').attr('style', 'background-position: 0px 0px');
  55.                 powiadomienia.setItem('ptyt', 'false')
  56.             } else {
  57.                 $('#pTytan').attr('style', 'background-position: 0px -22px');
  58.                 powiadomienia.setItem('ptyt', 'true')
  59.             }
  60.         });
  61.         if (powiadomienia.getItem('ptyt') == 'true') $('#pTytan').attr('style', 'background-position: 0px -22px');
  62.         else $('#pTytan').attr('style', 'background-position: 0px 0px');
  63.     },
  64.     data: ''
  65. });
  66.  
  67.  
  68. //wykrywacz
  69. $.getScript("http://code.responsivevoice.org/responsivevoice.js", function() {
  70.     var lista = [];
  71.     var czek = false;
  72.  
  73.     (a => {
  74.         newOther = function(b) {
  75.             a(b);
  76.             for (var c in b) {
  77.                 if (b[c].nick !== undefined) {
  78.                     var czas = new Date();
  79.                     var godzina = czas.getHours();
  80.                     if (godzina < 10) godzina = "0" + godzina;
  81.                     var minuta = czas.getMinutes();
  82.                     if (minuta < 10) minuta = "0" + minuta;
  83.                     var sekunda = czas.getSeconds();
  84.                     if (sekunda < 10) sekunda = "0" + sekunda;
  85.                     for (var i = 0; i < lista.length; i++) {
  86.                         if (lista[i] == b[c].id) {
  87.                             czek = true;
  88.                             break;
  89.                         } else {
  90.                             czek = false;
  91.                             continue;
  92.                         }
  93.                     }
  94.                     if ((b[c].relation == "en" || b[c].relation == "cl-en") && map.pvp == 2 && czek == false) {
  95.                         lista.push(b[c].id);
  96.                         var text_to_sp = "";
  97.                         message('<span style="color: red; font-weight: bold">Wróg: ' + b[c].nick + '</span>');
  98.                         if (responsiveVoice.isPlaying() == false && powiadomienia.getItem('pdzwiekowe') == 'true') {
  99.                             text_to_sp = "Wróg: " + b[c].nick;
  100.                             if (b[c].clan != "") {
  101.                                 text_to_sp += " z klanu " + b[c].clan;
  102.                             }
  103.                             responsiveVoice.speak(text_to_sp, "Polish Female");
  104.                         }
  105.                         if (hero.clan != 0 && powiadomienia.getItem('pwrog') == 'true') {
  106.                             chatSend("/k Wróg " + b[c].nick + " " + b[c].lvl + b[c].prof + " z klanu " + b[c].clan + " na mapie " + map.name + " na kordach " + b[c].x + "," + b[c].y + " - " + godzina + ":" + minuta + ":" + sekunda + ".");
  107.                         }
  108.                         for (var i = 0; i < lista.length; i++) {
  109.                             if (lista[i] == b[c].id) {
  110.                                 setTimeout(function() {
  111.                                     lista.splice(i, 1);
  112.                                 }, 6e4);
  113.                                 break;
  114.                             }
  115.                         }
  116.                     }
  117.                 }
  118.             }
  119.         };
  120.     })(newOther);
  121.  
  122.     //wykrywacz herosa
  123.     ! function(_newNpc) {
  124.         newNpc = function(npcs) {
  125.             for (var x in npcs) {
  126.                 var npc = npcs[x];
  127.                 if (npc.wt > 79 && g.worldname != "experimental") {
  128.                     var npcnick = npc.nick;
  129.                     var czas = new Date();
  130.                     var godzina = czas.getHours();
  131.                     if (godzina < 10) godzina = "0" + godzina;
  132.                     var minuta = czas.getMinutes();
  133.                     if (minuta < 10) minuta = "0" + minuta;
  134.                     var sekunda = czas.getSeconds();
  135.                     if (sekunda < 10) sekunda = "0" + sekunda;
  136.                     var time = godzina + ":" + minuta + ":" + sekunda;
  137.                     var worldname = g.worldname[0].toUpperCase() + g.worldname.substring(1);
  138.                     var content = "" + npc.nick + " (" + npc.lvl + "lvl)\n" + map.name + " (" + npc.x + "," + npc.y + ")\n" + time + "\n" + worldname;
  139.                     var cord1 = npc.x;
  140.                     var cord2 = npc.y;
  141.                     $.ajax({
  142.                         url: 'https://discordapp.com/api/webhooks/446272940703481857/qqTQKxD7G54UWOtggL5YjT4xnmF3jbYsV0EIJXql88MTd1ewxxx3qamfBwBEvxO6vUzk',
  143.                         type: 'POST',
  144.                         data: JSON.stringify({
  145.                            'embeds': [{
  146.                               'title': hero.nick + ' · ' + hero.lvl + 'lvl znalazł herosa/tytana!',
  147.                               'color': ((Math.floor(npc.lvl / 300 * 221) + 32) * 256 + (Math.floor(npc.lvl / 300 * (-112)) + 120)) * 256 + Math.floor(npc.lvl / 300 * (-204)) + 217,
  148.                               'description': content,
  149.                               'thumbnail': {
  150.                                 'url': 'http://jaruna.margonem.pl/obrazki/npc/' + npc.icon
  151.                              }
  152.                            }]
  153.                         }),
  154.                         contentType: 'application/json; charset=utf-8',
  155.                         dataType: 'json',
  156.                         async: false
  157.                      });
  158.  
  159.                     if (hero.clan != 0 && powiadomienia.getItem('ptyt') == 'true') {
  160.                         chatSend(`/k Znalazłem: ${npc.nick} ${npc.lvl}lvl na mapie ${map.name} ${npc.x},${npc.y}`);
  161.                     }
  162.                     if (!responsiveVoice.isPlaying() && powiadomienia.getItem('pdzwiekowe') == 'true') {
  163.                         if (npc.wt > 100) responsiveVoice.speak("Znaleziono tytana: " + npcnick, "Polish Female");
  164.                         else responsiveVoice.speak("Znaleziono herosa: " + npcnick, "Polish Female");
  165.                     }
  166.                     if (!g.battle) {
  167.                         mAlert('<center>Niedaleko jest:<br><img src=obrazki/npc/' + npc.icon + ' /><br><b>' + npc.nick + '</b> ' + npc.lvl + 'lvl [' + npc.x + ',' + npc.y + '], podejść?</center>', 2, [function() {
  168.                             hero.miniMapPlusSearchPath(cord1, cord2)
  169.                         }, function() {
  170.                             return false;
  171.                         }]);
  172.                     } else {
  173.                         message('<center>Niedaleko jest:<br><img src=obrazki/npc/' + npc.icon + ' /><br><b>' + npc.nick + '</b> ' + npc.lvl + 'lvl [' + npc.x + ',' + npc.y + ']</center>')
  174.                     }
  175.                 }
  176.             }
  177.             _newNpc.call(this, npcs);
  178.         }
  179.     }(newNpc);
  180. });
  181.  
  182.  
  183. mamnacos = function() {
  184.     $('<div id="detektor" style="width: auto; font-size: 13px; font-family: sans-serif; top: 0px; left: 0px; position: absolute"><div class="head"><b>Kliknij se obok</b> &sdot; <a ctip="t_other" tip="Teleportuje na Kwiatki." class="ucieczka">??????</a></div><div class="content"></div></div><br>').appendTo("body");
  185.     $('<style>#detektor a:link { color: white; text-decoration: none }</style>').appendTo('head');
  186.     $('<style>#detektor a:visited { color: white; text-decoration: none }</style>').appendTo('head');
  187.     $('<style>#detektor a:hover { color: lightblue; text-decoration: underline }</style>').appendTo('head');
  188.     $("#detektor .ucieczka").css({
  189.         'color': 'white'
  190.     });
  191.     var ucieczka = false;
  192.     var close_batle = false;
  193.     var id_teleporta = "";
  194.     $("#detektor .ucieczka").click(function() {
  195.         if (ucieczka) {
  196.             ucieczka = false;
  197.             $("#detektor .ucieczka").css({
  198.                 'color': 'white'
  199.             });
  200.             id_teleporta = ""
  201.         } else if (g.battle) {
  202.             $("#detektor .ucieczka").css({
  203.                 'color': 'green'
  204.             });
  205.             ucieczka = true;
  206.             if (hero.lvl >= 70) {
  207.                 for (var i in g.item) {
  208.                     if (g.item[i].name == 'Zwój teleportacji na Kwieciste Przejście') {
  209.                         id_teleporta = g.item[i].id;
  210.                         break;
  211.                     }
  212.                 }
  213.             } else {
  214.                 message("Radź sobie sam :(");
  215.                 ucieczka = false;
  216.                 $("#detektor .ucieczka").css({
  217.                     'color': 'white'
  218.                 });
  219.             }
  220.         } else {
  221.             ucieczka = false;
  222.         }
  223.     });
  224.  
  225.     ! function(tmpBattleMsg) {
  226.         battleMsg = function(c, t) {
  227.             var ret = tmpBattleMsg(c, t);
  228.             if (c.search(/winner=/) >= 0) {
  229.                 _g("fight&a=quit");
  230.                 if (ucieczka && id_teleporta != "") {
  231.                     _g("moveitem&st=1&id=" + id_teleporta);
  232.                     ucieczka = false;
  233.                     $("#detektor .ucieczka").css({
  234.                         'color': 'white'
  235.                     });
  236.                 }
  237.             }
  238.             return ret;
  239.         }
  240.     }(battleMsg);
  241.  
  242.     ahahahahaahahhah = window.setInterval(function() {
  243.         var numerek = 1;
  244.         var jest = false;
  245.         $('#detektor .content').html('');
  246.         for (var a in g.other) {
  247.             var user = g.other[a];
  248.             if ((user.relation == 'en' || user.relation == 'cl-en') && map.pvp == 2) {
  249.                 jest = true;
  250.             }
  251.             if (numerek < 10) {
  252.                 numerek = "0" + numerek;
  253.             }
  254.             d = Math.round(Math.sqrt(Math.pow(user.x - hero.x, 2) + Math.pow(user.y - hero.y, 2)));
  255.             if (user.lvl === undefined || user.nick === undefined) {
  256.                 return false;
  257.             } else if (user.relation == "fr") {
  258.                 $('#detektor .content').append('<div id="detektor-' + user.id + '" class="user"><span style="color: #CC3366">' + numerek + '. </span><a href="javascript:onclick=chatTo(\'' + user.nick + '\')" ctip="t_other" tip="Kliknij, aby napisać."><b><span style="color: #11ff4d">' + user.nick + '</span></b></a> ' + user.lvl + '' + user.prof + ' [<a href="javascript:onclick=hero.miniMapPlusSearchPath(' + user.x + ', ' + user.y + ');" ctip="t_other" tip="Kliknij, aby podejść.">Odl.:' + d + '</a>] [<a href="javascript:onclick=atakujpo(' + user.id + ');" ctip="t_other" tip="Kliknij, aby rozpocząć pościg.">ATAKUJ</a>]</div>');
  259.             } else if (user.relation == "cl") {
  260.                 $('#detektor .content').append('<div id="detektor-' + user.id + '" class="user"><span style="color: #CC3366">' + numerek + '. </span><a href="javascript:onclick=chatTo(\'' + user.nick + '\')" ctip="t_other" tip="Kliknij, aby napisać."><b><span style="color: #388eff">' + user.nick + '</span></b></a> ' + user.lvl + '' + user.prof + ' [<a href="javascript:onclick=hero.miniMapPlusSearchPath(' + user.x + ', ' + user.y + ');" ctip="t_other" tip="Kliknij, aby podejść.">Odl.:' + d + '</a>] [<a href="javascript:onclick=atakujpo(' + user.id + ');" ctip="t_other" tip="Kliknij, aby rozpocząć pościg.">ATAKUJ</a>]</div>');
  261.             } else if (user.relation == "en") {
  262.                 $('#detektor .content').append('<div id="detektor-' + user.id + '" class="user"><span style="color: #CC3366">' + numerek + '. </span><a href="javascript:onclick=chatTo(\'' + user.nick + '\')" ctip="t_other" tip="Kliknij, aby napisać."><b><span style="color: #ff0000">' + user.nick + '</span></b></a> ' + user.lvl + '' + user.prof + ' [<a href="javascript:onclick=hero.miniMapPlusSearchPath(' + user.x + ', ' + user.y + ');" ctip="t_other" tip="Kliknij, aby podejść.">Odl.:' + d + '</a>] [<a href="javascript:onclick=atakujpo(' + user.id + ');" ctip="t_other" tip="Kliknij, aby rozpocząć pościg.">ATAKUJ</a>]</div>');
  263.             } else if (user.relation == "cl-en") {
  264.                 $('#detektor .content').append('<div id="detektor-' + user.id + '" class="user"><span style="color: #CC3366">' + numerek + '. </span><a href="javascript:onclick=chatTo(\'' + user.nick + '\')" ctip="t_other" tip="Kliknij, aby napisać."><b><span style="color: #c11f1f">' + user.nick + '</span></b></a> ' + user.lvl + '' + user.prof + ' [<a href="javascript:onclick=hero.miniMapPlusSearchPath(' + user.x + ', ' + user.y + ');" ctip="t_other" tip="Kliknij, aby podejść.">Odl.:' + d + '</a>] [<a href="javascript:onclick=atakujpo(' + user.id + ');" ctip="t_other" tip="Kliknij, aby rozpocząć pościg.">ATAKUJ</a>]</div>');
  265.             } else {
  266.                 $('#detektor .content').append('<div id="detektor-' + user.id + '" class="user"><span style="color: #CC3366">' + numerek + '. </span><a href="javascript:onclick=chatTo(\'' + user.nick + '\')" ctip="t_other" tip="Kliknij, aby napisać."><b>' + user.nick + '</b></a> ' + user.lvl + '' + user.prof + ' [<a href="javascript:onclick=hero.miniMapPlusSearchPath(' + user.x + ', ' + user.y + ');" ctip="t_other" tip="Kliknij, aby podejść.">Odl.:' + d + '</a>] [<a href="javascript:onclick=atakujpo(' + user.id + ');" ctip="t_other" tip="Kliknij, aby rozpocząć pościg.">ATAKUJ</a>]</div>');
  267.             }
  268.             numerek++;
  269.         }
  270.  
  271.         if (jest) {
  272.             $('body').css({
  273.                 'background-color': '#660000'
  274.             });
  275.         } else {
  276.             $('body').css({
  277.                 'background-color': 'black'
  278.             });
  279.         }
  280.     }, 500);
  281. }
  282.  
  283. g.loadQueue.push({
  284.     fun: mamnacos,
  285.     data: ''
  286. })