[Pasek] Rekord farmy w profilu

DeletedUser197747

Guest
Witam, mam małą edycja dość przydatną moim zdaniem. Która dopisuje ilość splądrowanych wiosek.

Kod:
javascript:
// ==UserScript==
// @name         Rekord farmy w profilu
// @version      1.10
// @author       Filip Klich  mała edycja DevilOfCry 20.03.2019
// @include        *://*.plemiona.pl/game.php?*screen=info_player*
// ==/UserScript==
//LICENCJA       FREE SOFTWARE - drogi Supporcie <3 wyraĹĽam zgodÄ™ na uĹĽytkowanie i publikowanie tego skryptu przez kaĹĽdÄ… osobÄ™

(function() {
    'use strict';

    var nick=takeNick();
    console.log(nick);
    makeProfileGreatAgain(nick);
    makeProfileGreatAgain1(nick);
})();

function makeProfileGreatAgain(nick){
    $['ajax']({
        async: true,
        url: 'https://pl'+ window.location.href.split("pl")[1].split(".")[0] +'.plemiona.pl/game.php?screen=ranking&mode=in_a_day&type=loot_res&name=' + nick,
        type: 'GET',
        success: function(test) {
            var t = $(test).find('.lit-item:nth-child(4)').html().split(`<span class="grey">.</span>`);
            var x=t[0];
            for (var i=1;i<t.length;i++) {x+=".";x+=t[i];}
            x+=" (" +  $(test)['find']('.lit-item:first')['html']()+".) ";
            x+=" z dnia "+ $(test)['find']('.lit-item:nth-child(5)')['html']().replace("wczoraj", "wczorajszego");
            addLoot(x);
        }
    });
}
function makeProfileGreatAgain1(nick){
    $['ajax']({
        async: true,
        url: 'https://pl'+ window.location.href.split("pl")[1].split(".")[0] +'.plemiona.pl/game.php?screen=ranking&mode=in_a_day&type=loot_vil&name=' + nick,
        type: 'GET',
        success: function(test) {
            var t = $(test).find('.lit-item:nth-child(4)').html().split(`<span class="grey">.</span>`);
            var x=t[0];
            for (var i=1;i<t.length;i++) {x+=".";x+=t[i];}
            x+=" (" +  $(test)['find']('.lit-item:first')['html']()+".) ";
            x+=" z dnia "+ $(test)['find']('.lit-item:nth-child(5)')['html']().replace("wczoraj", "wczorajszego");
            addLoot1(x);
        }
    });
}

function takeNick(){
    var ret = document.getElementsByClassName("selected")[0];
    return (ret === undefined ? $("#content_value")[0].getElementsByTagName("h2")[0].innerText : ret.innerText);
}
function addLoot(loot){
    var tableRef = document.getElementById("player_info").getElementsByTagName("tbody")[0];
    var newRow   = tableRef.insertRow(5);

    var d  = newRow.insertCell(0);
    var f  = newRow.insertCell(0);
    f.appendChild(document.createTextNode('Rekord farmy'));
    d.appendChild(document.createTextNode(loot));
}
function addLoot1(loot1){
    var tableRef = document.getElementById("player_info").getElementsByTagName("tbody")[0];
    var newRow = tableRef.insertRow(6);
 
    var d1 = newRow.insertCell(0);
    var f1 = newRow.insertCell(0);
    f1.appendChild(document.createTextNode('Splądrowane wioski'));
    d1.appendChild(document.createTextNode(loot1));
    }


Rekord farmy 37.083 (67.) z dnia wczorajszego
Splądrowane wioski 1.303 (36.) z dnia wczorajszego
 
Do góry