Klán tagok Védelmei lekérése

Farkas

Member
A reakció pontszáma
26
a másik pedig a Klán --> Tagok --> Védelem fülön működik, ez is jelenleg v84-re van csinálva, ezt is megkell nézni és úgy átírni, hogy mindenhol tökéletesen működjön!
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_defense"))
{
function Indulas()
{
$('body').append(`<div class="autoHideBox sajtoskenyerl"><p>A védekezés 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_defense&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_defense&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"))
{
let tmpNumber = parseInt(b.children[12].innerHTML);
if (!isNaN(tmpNumber))
{
bejovok+=parseInt(b.children[1].innerHTML);
}

console.log(b.children[12].innerHTML);
console.log(bejovok);
$(%27.bejovo%27).html(%27(%27 + bejovok + %27)%27);
}
});

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 védekezés 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)
{
switch (seged)
{
case 11:
$('form').after(%60<div class="table-responsive">
<table class="vis w100"
<tbody>
<tr>
<th style="min-width: 200px">Falu</th>
<th></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_spear.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_sword.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_axe.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_archer.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_spy.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_light.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_marcher.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_heavy.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_ram.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_catapult.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_knight.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_snob.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/b923b0bb/graphic/unit/att.png" class="" style="vertical-align: -3px">
<strong class="bejovo"> (0) </strong>
</th>
</tr>
</tbody>
</table>
</div>%60);
break;
case 12:
$('form').after(%60<div class="table-responsive">
<table class="vis w100"
<tbody>
<tr>
<th style="min-width: 200px">Falu</th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_spear.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_sword.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_axe.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_archer.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_spy.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_light.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_marcher.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_heavy.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_ram.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_catapult.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_knight.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_snob.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_militia.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/b923b0bb/graphic/unit/att.png" class="" style="vertical-align: -3px">
<strong class="bejovo"> (0) </strong>
</th>
</tr>
</tbody>
</table>
</div>%60);
break;
default:
$('form').after(%60<div class="table-responsive">
<table class="vis w100"
<tbody>
<tr>
<th style="min-width: 200px">Falu</th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_spear.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_sword.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_axe.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_archer.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_spy.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_light.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_marcher.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_heavy.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_ram.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_catapult.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_knight.png" class=""></th>
<th><img src="https://dshu.innogamescdn.com/asset/e79f7947/graphic/unit/unit_snob.png" class=""></th>
</tr>
</tbody>
</table>
</div>%60);
break;

}
}

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 Védekezés résznél. Most átirányítunk oda."); self.location = game_data.link_base_pure.replace(/screen\=\w*/i,"screen=ally&mode=members_defense");
}
void(0);
 
Fent