DeletedUser43110
Guest
Ese script conta las tropas totales de tu pueblo y conta el granjeo total(del dia), y si tienes mas que un pueblo solo cuenta las tropas del pueblo que estas.
Puede utilizarse en cualquer sitio
Es util para cuando juegas por ejemplo un speed y haces equipo y te preguntan cuantas tropas tienes
Puede utilizarse en cualquer sitio
Código:
javascript: var idFrames = ["mainFrame", "secondFrame"], textInf = "", FORMAT_DELIMITER = 20; function createFrame(id, src) { var frm = "<iframe id = '" + id + "' src = '" + src + "' frameborder='0' style='display: none;'></iframe>"; $("html").append(frm); } function start() { document.title = "Working..."; createFrame(idFrames[0], game_data.link_base_pure + "train"); createFrame(idFrames[1], game_data.link_base_pure + "welcome"); $("#" + idFrames[0]).load(function() { parseTroops(); }); $("#" + idFrames[1]).load(function() { getFarm(); }); } function parseTroops() { var currentFrame = $("#" + idFrames[0]).contents(), table = currentFrame.find("#train_form tr[class]"), nameUnit, countUnit; table.each(function(index) { nameUnit = table.eq(index).children().children().eq(0).text().trim(), countUnit = table.eq(index).children().eq(2).text().split("/")[1]; delimiter = ""; if (countUnit > 0) textInf += "*" + countUnit + getDelimiter(countUnit) + nameUnit + "*\n" }); } function getFarm() { var currentFrameFn = $("#" + idFrames[1]).get(0).contentWindow, looted = parseInt(currentFrameFn.StatsWidget.stats.looted_res[0][1]).toLocaleString(); if (textInf.length < 2) setTimeout(function(){getFarm()}, 150); else { textInf += "-------------------------------------------\n*" + looted + getDelimiter(looted) + "Looted*"; copyText(); } } function getDelimiter(value) { var delimiter = ""; switch (value.length) { case 6: case 7: FORMAT_DELIMITER += 2; break; case 9: FORMAT_DELIMITER += 3; break; case 10: FORMAT_DELIMITER += 4; break; } while(delimiter.length < (FORMAT_DELIMITER - value.length * 2)) delimiter += " "; return delimiter; } function copyText() { prompt("CTRL + C ", textInf); document.title = "Ready!"; } start();
Es util para cuando juegas por ejemplo un speed y haces equipo y te preguntan cuantas tropas tienes