Klán tagok épület szintjeinek lekérése

Farkas

Member
A reakció pontszáma
26
Sziasztok!
Csináltam egy scriptet, ami jelenleg csak is kizárólag v84-en működik hibátlanul, ha valaki megtudná buherálni, hogy működjön minden szerveren egyységesen, az elég jó lenne.
Fontos, hogy csak a klán arisztokratái/alapítói tudják használni a scriptet:

javascript:
if(document.URL.match("screen=ally") && document.URL.match("mode=members_buildings"))
{
function Indulas()
{
$('body').append(`<div class="autoHideBox sajtoskenyerl"><p>A klántagok épület szintjeinek kilistázása folyamatban van, kérlek várj...</p></div>`);
let options = $('.input-nicer option'),
values = $.map(options, function(option) { return option.value; }),
tmp = [],
counter = 0,
bejovok = 0,
ido = 0,
interval = null,
seged = 0;
egyszer = 0;
values.shift();

function Data()
{
if (egyszer == 0)
{
$.get(`https://${game_data.world}.klanhaboru.hu/game.php?screen=ally&mode=members_buildings&player_id=${values[counter]}&village=${game_data.village.id}`, (data, status) => {
let s = $(%27<div/>%27).html(data).contents();
s.find(%27.table-responsive table.vis tbody tr%27).each((a,b) => {
if (!~b.outerHTML.indexOf("th") && egyszer == 0)
{
seged = (b.outerHTML.match(/<td class="">/g) || []).length;
seged += (b.outerHTML.match(/<td class="hidden">/g) || []).length;
console.log(seged);

egyszer = 1;
GenerateTableB(seged);
}
});

if (counter < values.length)
{
counter++;
setTimeout(Data(values[counter]), 1000);
}
else
{
counter = 0;
FetchData();
}

tmp = [];
});
}
else
{
counter = 0;
FetchData();
}
}

function FetchData()
{
$.get(`https://${game_data.world}.klanhaboru.hu/game.php?screen=ally&mode=members_buildings&player_id=${values[counter]}&village=${game_data.village.id}`, (data, status) => {
let s = $(%27<div/>%27).html(data).contents();
s.find('.table-responsive table.vis tbody tr').each((a,b) => {
tmp.push(b.outerHTML);
if (!~b.outerHTML.indexOf("hidden") && ~b.outerHTML.indexOf("class"))
{
console.log(b.children[12].innerHTML);
}
});

for (let i = 1; i < tmp.length; ++i)
{
GenerateRows(tmp);
}

if (counter < values.length)
{
counter++;
setTimeout(FetchData(values[counter]), 1000);
}
else
{
$(%27.sajtoskenyerl%27).remove();
$(%27#refresh').prop('disabled', false);
$('body').append(%60<div class="autoHideBox success sajtoskenyer"><p>A klántagok épület szintjei sikeresen kilistázva.</p></div>%60);
Idozito();
}
tmp = [];
});
}

function GenerateRows(tdData)
{
$('.table-responsive table.vis tbody tr:last-child').after(%60${tdData}%60);
}

function GenerateTableB(seged)
{
$('form').after(%60<div class="table-responsive">
<table class="vis w100"
<tbody>
<tr>
<th style="min-width: 200px">Falu</th>
<th>Pont</th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/main.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/barracks.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/stable.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/garage.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/church.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/church.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/snob.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/smith.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/place.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/statue.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/market.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/wood.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/stone.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/iron.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/farm.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/storage.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/hide.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/69990994/graphic/buildings/wall.png" class=""></th>
</tr>
</tbody>
</table>
</div>%60);
}

function Idozito()
{
let start = new Date;
interval = setInterval(function()
{
if (ido < 1)
{
ido = (new Date - start) / 1000;
}
else
{
clearInterval(interval);
$('.sajtoskenyer').remove();
}
}, 1000);
}

$('.table-responsive').remove();
$('form').append(%60<button id="refresh" class="btn btn-default" disabled="disabled">Frissítem</button>%60);
$('form').append(%60<b class="keszito" style="margin-left: 10px;">A scriptet készítette: <span style="color: red;">Farkas</span></b>%60);
$("#refresh").click(function()
{
$('#refresh').remove();
$('.keszito').remove();
Indulas();
});

Data();
}

Indulas();
}
else
{
alert("/Csak a Klán --> Tagok felületen működik a Beérkező résznél. Most átirányítunk oda."); self.location = game_data.link_base_pure.replace(/screen\=\w*/i,"screen=ally&mode=members_buildings");
}
void(0);
 
Fent