- Počet poděkování
- 114
Počty jednotek jdoucí na podpory
Popis skriptu: Vytvoří kopírovatelný přehled (do zprávy, na forum) s cílovými vesnicemi a počty jednotek. Vyžaduje premiový účet.
Jak skript nastavit a použít?
1. Následující skript vložte do rychlého náhledu
Kód:
javascript:
/**
* Created by Trsak
*/var units = {};
var msg = '';
$("#commands_table .nowrap").each(function (index) {
var id = 0;
var village = $(this).children('td').text();
var regExp = /\([0-9]{3,3}\|[0-9]{3,3}\)/g;
var coord = regExp.exec(village);
if (typeof units[coord] == 'undefined') {
units[coord] = [];
for(i = 0; i < 10; i++) {
units[coord].push(0);
}
}
$(this).children('.unit-item').each(function(tdEL) {
units[coord][id++] += Number($(this).text());
});
});
$.each(units , function(index, coord) {
msg += 'Na cestě: [coord]'+index+'[/coord]:\n';
msg += '[unit]spear[/unit] '+units[index][0]+' ';
msg += '[unit]sword[/unit] '+units[index][1]+' ';
msg += '[unit]axe[/unit] '+units[index][2]+' ';
msg += '[unit]spy[/unit] '+units[index][3]+' ';
msg += '[unit]light[/unit] '+units[index][4]+' ';
msg += '[unit]heavy[/unit] '+units[index][5]+' ';
msg += '[unit]ram[/unit] '+units[index][6]+' ';
msg += '[unit]catapult[/unit] '+units[index][7]+' ';
msg += '[unit]knight[/unit] '+units[index][8]+' ';
msg += '\n';
msg += '\n';
});
function SelectText(element) {
var doc = document, text = doc.getElementById(element), range, selection;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
}
document.onclick = function(e) {
if (e.target.className === 'click') {
SelectText('skript_export');
}
};
$("#quickbar_contents").append('<textarea style="width:550px; height:350px; padding: 3px;" id="skript_export">'+msg+'</textarea><br><button class="click">Označit</button><br>');
Kód:
javascript:
/**
* Created by Trsak
*/var units = {};
var msg = '';
$("#commands_table .nowrap").each(function (index) {
var id = 0;
var village = $(this).children('td').text();
var regExp = /\([0-9]{3,3}\|[0-9]{3,3}\)/g;
var coord = regExp.exec(village);
if (typeof units[coord] == 'undefined') {
units[coord] = [];
for(i = 0; i < 12; i++) {
units[coord].push(0);
}
}
$(this).children('.unit-item').each(function(tdEL) {
units[coord][id++] += Number($(this).text());
});
});
$.each(units , function(index, coord) {
msg += 'Na cestě: [coord]'+index+'[/coord]:\n';
msg += '[unit]spear[/unit] '+units[index][0]+' ';
msg += '[unit]sword[/unit] '+units[index][1]+' ';
msg += '[unit]axe[/unit] '+units[index][2]+' ';
msg += '[unit]archer[/unit] '+units[index][3]+' ';
msg += '[unit]spy[/unit] '+units[index][4]+' ';
msg += '[unit]light[/unit] '+units[index][5]+' ';
msg += '[unit]marcher[/unit] '+units[index][6]+' ';
msg += '[unit]heavy[/unit] '+units[index][7]+' ';
msg += '[unit]ram[/unit] '+units[index][8]+' ';
msg += '[unit]catapult[/unit] '+units[index][9]+' ';
msg += '[unit]knight[/unit] '+units[index][10]+' ';
msg += '[unit]snob[/unit] '+units[index][11]+' ';
msg += '\n';
msg += '\n';
});
function SelectText(element) {
var doc = document, text = doc.getElementById(element), range, selection;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
}
document.onclick = function(e) {
if (e.target.className === 'click') {
SelectText('skript_export');
}
};
$("#quickbar_contents").append('<textarea style="width:550px; height:350px; padding: 3px;" id="skript_export">'+msg+'</textarea><br><button class="click">Označit</button><br>');
2. (Podpory) Náhledy > Příkazy > Podpora > KLIK na skript
(Útoky) Náhledy > Příkazy > Útoky > KLIK na skript
3. V horní části stránky se zobrazí box s textem který můžete kopírovat na forum, nebo poslat zprávou
Potřebujete poradit?
Máte problémy se spuštěním skriptu? Potřebujete jinak poradit? Kontaktujte uživatele Dux2311 nebo přímo herní podporu přes ticket systém.
Naposledy upraveno: