[Juego] Me falla un scrip en el mundo 36

  • Autor de hilo DeletedUser31983
  • Fecha de inicio

DeletedUser31983

Guest
Hola :) El scrip que dejare abajo me falla en el mundo 36 pero en todos los demás mundos me funciona a la perfección xc alguien que me pueda orientar del por que me falla solo en el mundo 36 ?

Gracias XD
javascript:
function rename(data_id, new_name) {
$container = $('span[class*="quickedit"][data-id="'+ data_id +'"]');
$container.find('.rename-icon').click();
$container.find('input[type=text]').val(new_name);
$container.find('input[type=button]').click();
}
function extragereComanda(row)
{
var command = {};
command.troops = new Array(0,0,0,0,0,0,0,0,0,0,0,0);
function cellVal(cell){
return Number(row.cells[cell].innerHTML);
}
command.troops[0] = cellVal(0+3);
command.troops[1] = cellVal(1+3);
command.troops[2] = cellVal(2+3);
command.troops[3] = cellVal(3+3);
command.troops[4] = cellVal(4+3);
command.troops[5] = cellVal(5+3);
command.troops[6] = cellVal(6+3);
command.troops[7] = cellVal(7+3);
command.troops[8] = cellVal(8+3);
command.troops[9] = cellVal(9+3);
command.troops[10] = cellVal(10+3);
command.troops[11] = cellVal(11+3);
var icon = $(row).find('img')[0];
if(icon.src.search('attack') != -1 || icon.src.search('farm')!=-1) command.type = 'attack';
else if(icon.src.search('support') != -1) command.type = 'support';
else command.type = 'return';
var name = $(row).find('.quickedit-label').text();
command.destination = name.match(/[0-9]{1,}\|[0-9]{1,}(?![\s\S]*\|)/);
return command;
}
function overView() {
var commands = new Array();
var commandsTable = document.getElementById('commands_table');
for(var row=1; row < commandsTable.rows.length-1; row++) {
commands[row-1] = extragereComanda(commandsTable.rows[row]);
var coords = new String(commands[row-1].destination);
var spear = commands[row-1].troops[0];
var sword = commands[row-1].troops[1];
var axe = commands[row-1].troops[2];
var scout = commands[row-1].troops[4];
var lc = commands[row-1].troops[5];
var hc = commands[row-1].troops[7];
var ram = commands[row-1].troops[8];
var cat = commands[row-1].troops[9];
var noble = commands[row-1].troops[11];

if (noble >= 1) eticheta = 'NOBLE';
else if (axe == 200 && lc >= 100) eticheta = 'Ataque real';
else if (axe >= 200 && lc == 0) eticheta = 'Hacha';
else if (cat == 1 || ram == 1 || axe == 1 || spear == 1 || sword == 1) eticheta = 'Fake';
else if (lc >= 1 && lc <= 10 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '<10';
else if (lc >= 10 && lc <= 20 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '10-20';
else if (lc >= 20 && lc <= 50 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '20-50';
else if (lc >= 50 && lc <= 100 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '50-100';
else if (lc >= 100 && lc <= 150 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '100-150';
else if (lc >= 150 && lc <= 200 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '150-200';
else if (lc >= 200 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '>200';
else if (lc >= 400 && ram == 0 && cat == 0 && hc == 0 && axe == 0 && scout >= 4) eticheta = '>400';
else if (scout >= 1 || ram == 0 || cat == 0 || hc == 0 || axe == 0 || lc == 0) eticheta = 'Espías';
else eticheta = '...';



if (commands[row-1].type=='attack'){
commandId = $(commandsTable.rows[row]).find('.quickedit').attr('data-id');
rename(commandId, eticheta);
}
}
}overView();
 
Arriba