javascript: if(CountResources==undefined){var CountResources={totals:new Array(0,0,0),links:document.body.innerHTML.replace(/&/gi,'&').match(/<span id="[^"]+"><a href="[^"]+screen=info_command[^"]+">/g)}}function _img(name){return '<img src="graphic/'+name+'.png"/>';}function get_res(link){matches=link.match(/(\[\d+\])"><a href="([^"]+)"/); var xhReq=new XMLHttpRequest(); xhReq.open("GET", matches[2], false); xhReq.send(null); var resp=xhReq.responseText.replace(/<span class="grey">\.<\/span>/gi,'');res=resp.match(/<td><img [^>]+holz[^>]+>(\d+) <img [^>]+lehm[^>]+>(\d+) <img [^>]+eisen[^>]+>(\d+)/);var label=document.getElementById('labelText'+matches[1]);if(res){var sum=0;for(var i=0;i<3;i++){CountResources.totals[i]+=parseInt(res[i+1]);sum+=parseInt(res[i+1]);}label.innerHTML=_img('res')+sum;}else{label.innerHTML='['+label.innerHTML+']';}}function show_plunders(){var C=CountResources;if(C==-1)return; if(!window.location.href.match(/screen=overview/)){alert("Ce script doit être lancé depuis la vue du village"); return;}if(!C.i){for(C.i = 0 ; C.i < C.links.length ; C.i ++){var total='<th colspan="2" id="total_res">'+_img('holz')+C.totals[0]+_img('lehm')+C.totals[1]+_img('eisen')+C.totals[2]+'</th></tr><tr><th width="100%">';document.body.innerHTML=document.body.innerHTML.replace(/<th width="52%">/,total);}for(C.i = 0 ; C.i < C.links.length ; C.i ++){get_res(C.links[C.i]);var str=_img('holz')+C.totals[0]+_img('lehm')+C.totals[1]+_img('eisen')+C.totals[2];if(C.i+1==C.links.length){str+=' (Terminé)';window.stop();}else{str+=' ('+(C.i+1)+'/'+C.links.length+')';}document.getElementById('total_res').innerHTML=str;}}}show_plunders();