All Broken Scripts

DeletedUser

Guest
I have no attitude nor did iI intend any in the post. If that is how it came across then i apologise.
 

DeletedUser

Guest
if you want to lend fnf your account pm her your username/pw

Shes such a nice person she'll probably still look at it for you
 

DeletedUser103411

Guest
Attack tagger generator by Dalesmckay doesnt work. After a long series of game updates.

[SPOIL]
javascript: var format = "{unit} {sent} {coords} {player} {duration} {distance} {return} {attack_id}"; var titleArr = ["Scout", "LC", "HC", "Axe", "Sword", "Ram", "***Noble***"]; var showMS = false; var n = 'fnGenerateTaggerScript'; var s = 'http://crosstrigger.com/tw/generate_tagger.js'; var a = (window.frames.length > 0) ? window.main : window; var z = 0; function c(m) { a.document.body.appendChild(a.document.createTextNode(m)); a.document.body.appendChild(a.document.createElement('br')); } function e() { if (!a.document.getElementById(n)) { c("Embedding Script..."); var A = a.document.createElement('script'); A.id = n; A.type = 'text/javascript'; A.src = s + '?' + Math.round(Math.random() * 1000000); a.document.getElementsByTagName("head")[0].appendChild(A); setTimeout(e, 1000); return false; } if (typeof(a.fnGenerateTaggerScript) == "undefined") { c("Finalizing Script..."); setTimeout(e, 1000); return false; } try { c("Executing Script" + (z > 0 ? " (retry " + z + ")" : "") + "..."); a.fnGenerateTaggerScript(format, titleArr, showMS); } catch (errorObj) { z++; if (z < 3) { setTimeout(e, 1000); } else { c("Script Failed"); } return false; } return true; } e();void(0); }​
[/SPOIL]
 

DeletedUser

Guest
The inc tagger works very well, but time of attack sent isn't displayed correctly (it shows a sentence like NaN:NaN:NaN etc.). I think there is a problem with the {sent} variable. Anyone able to fix it? Thank you.

Code:
javascript: theFormat = '{unit} - {origin} - {sent} - {arrival}';  $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/IncomingRenamer.js");  void(0);
 

dalesmckay

Guest
Attack tagger generator by Dalesmckay doesnt work. After a long series of game updates.

[SPOIL]
javascript: var format = "{unit} {sent} {coords} {player} {duration} {distance} {return} {attack_id}"; var titleArr = ["Scout", "LC", "HC", "Axe", "Sword", "Ram", "***Noble***"]; var showMS = false; var n = 'fnGenerateTaggerScript'; var s = 'http://crosstrigger.com/tw/generate_tagger.js'; var a = (window.frames.length > 0) ? window.main : window; var z = 0; function c(m) { a.document.body.appendChild(a.document.createTextNode(m)); a.document.body.appendChild(a.document.createElement('br')); } function e() { if (!a.document.getElementById(n)) { c("Embedding Script..."); var A = a.document.createElement('script'); A.id = n; A.type = 'text/javascript'; A.src = s + '?' + Math.round(Math.random() * 1000000); a.document.getElementsByTagName("head")[0].appendChild(A); setTimeout(e, 1000); return false; } if (typeof(a.fnGenerateTaggerScript) == "undefined") { c("Finalizing Script..."); setTimeout(e, 1000); return false; } try { c("Executing Script" + (z > 0 ? " (retry " + z + ")" : "") + "..."); a.fnGenerateTaggerScript(format, titleArr, showMS); } catch (errorObj) { z++; if (z < 3) { setTimeout(e, 1000); } else { c("Script Failed"); } return false; } return true; } e();void(0); }​
[/SPOIL]

That is a very very old version.
It was moved to drop box quite some time ago now.

Attack Tagger Generator Script:
[SPOIL]
Code:
javascript:
	var format='{unit} {sent} {coords} {player} {duration} {distance} {return} {attack_id}';
	var titleArr=['Scout','LC','HC','Axe','Sword','Ram','***Noble***'];
	var showMS=false;
	(window.main||self).$.getScript('http://dl.dropbox.com/u/25377948/twscripts/jquery.tw.generate.tagger.js',function(){$.twGenerateTagger(format,titleArr,showMS);});
	void(0);
[/SPOIL]
 

DeletedUser103411

Guest
Thanks)

What about your farm finder script?

I've got 1.07 version. Player and tribe tag options disable((
Code:
javascript:  var debugEnabled=true;  var branch='http://dl.dropbox.com/u/25377948/twscripts/';  (window.main||self).$.getScript(branch+'jquery.tw.farmfinder.js',function(){$.twFarmFinder(branch,debugEnabled);});  void(0);
 

DeletedUser

Guest
Can anyone make this work again?

Was a haul script that tallied up what hauls returning troops had. I liked it and would appreciate having it working again if possible

[SPOIL]
Code:
javascript:ukScript="http://ftp.innogames.net/~tracey/scripts/twcheese_commandHauls.js";s=document.createElement('script');s.type='text/javascript';s.src=ukScript+'?'+Math.floor((new Date()).valueOf()/604800000);document.getElementsByTagName('head')[0].appendChild(s);void 0;
[/SPOIL]
 

DeletedUser

Guest
4 grid village renamer:

[spoil]
Code:
javascript:function%20convert_coords(x,y){con=Math.floor(y/100)+''+Math.floor(x/100);sec=(Math.floor(y/10)%2510)+''+(Math.floor(x/10)%2510);sub=(y%2510)+''+(x%2510);ns=y.substr(1,3); if(ns>50)ns='S'; else ns='N';ew=x.substr(1,3); if(ew>50)ew='E'; else ew='W';return%20con+'-'+ns+''+ew+'-'+sec+'-'+sub+'';}var%20doc=document;if(window.frames.length>0)doc=window.main.document;var%20inputs=doc.getElementsByTagName('input');for(i=0;i<inputs.length;i++){id=inputs.id;index=id.indexOf('edit_input');if(index!=-1){id=id.substring(index+11);str=doc.getElementById('label_text_'+id).innerHTML;mid=str.lastIndexOf('|');x=str.substring(str.lastIndexOf('(')+1,mid);y=str.substring(mid+1,str.lastIndexOf(')'));inputs.value=convert_coords(x,y);inputs[i+1].click();}}end();
[/spoil]

Mass recruitment:

[spoil]
Code:
javascript:var%20archers%20=%20true;%20var%20configuration%20=%20[0,0,0,0,0,0,0,0,0,0];var%20units;var%20unitsNET;var%20costs;function%20arrayMin(array){var%20value=array[0];for(var%20%20t=1;t%3Carray.length;t++){if(array[t]%3Cvalue){value=array[t];}}return%20%20value;}function%20linearDivideArray(array1,array2){var%20%20value=[];if(array1.length==array2.length){for(var%20%20t=0;t%3Carray1.length;t++){if(array2[t]!=0){value[t]=array1[t]*1.0/array2[t];}else{value[t]=0;}}}return%20%20value;}function%20linearAddArray(array1,array2){var%20%20value=[];if(array1.length==array2.length){for(var%20%20t=0;t%3Carray1.length;t++){value[t]=array1[t]+array2[t];}}return%20%20value;}function%20getUnitId(unit){for(var%20%20t=0;t%3Cunits.length;t++){if(unit==unitsNET[t]){return%20%20t;}}return-1;}function%20getQueue(record){var%20value=[0,0,0,0,0,0,0,0,0,0];for(var%20%20u=3;u%3Crecord.cells.length;u++){try{value[u-3]=parseInt(record.cells[u].childNodes[1].childNodes[1].firstChild.title,10);}catch(e){}if(isNaN(value[u-3])){value[u-3]=0;}}return%20%20value;}function%20getResources(record){var%20%20value=[0,0,0,0];var%20res=record.cells[1].textContent.split(%22\n%22);var%20%20farm=record.cells[2].innerHTML.split('/');value[0]=parseInt(res[1].replace(%22.%22,%22%22),10);value[1]=parseInt(res[2].replace(%22.%22,%22%22),10);value[2]=parseInt(res[3].replace(%22.%22,%22%22),10);value[3]=farm[1]-farm[0];return%20%20value;}function%20getProduced(record){var%20%20value=[0,0,0,0,0,0,0,0,0,0];for(var%20%20u=3;u%3Crecord.cells.length;u++){try{value[u-3]=parseInt(record.cells[u].childNodes[1].textContent.split(%22\n%22)[2],10);}catch(e){}if(isNaN(value[u-3])){value[u-3]=0;}}return%20%20value;}if(document.URL.match('screen=train')&&document.URL.match('mode=mass')){var%20%20records=document.getElementById('mass_train_table').rows;if(archers){units=['spear','sword','axe','archer','spy','light','marcher','heavy','ram','catapult'];unitsNET=['Spear%20Fighter','Swordsman','Axeman','Archer','Scout','Light%20Cavalry','Mounted%20Archer','Heavy%20Cavalry','Ram','Catapult'];costs=[[50,30,10,1],[30,30,70,1],[60,30,40,1],[100,30,60,1],[50,50,20,2],[125,100,250,4],[250,100,150,5],[200,150,600,6],[300,200,200,5],[320,400,100,8]];}else{units=['spear','sword','axe','spy','light','heavy','ram','catapult'];unitsNET=['Spear%20Fighter','Swordsman','Axeman','Scout','Light%20Cavalry','Heavy%20Cavalry','Ram','Catapult'];costs=[[50,30,10,1],[30,30,70,1],[60,30,40,1],[50,50,20,2],[125,100,250,4],[200,150,600,6],[300,200,200,5],[320,400,100,8]];}for(r=1;r%3Crecords.length;r++){var%20%20subconf=[];var%20total_costs=[0,0,0,0];var%20%20i;var%20resources=getResources(records[r]);var%20%20queue=getQueue(records[r]);var%20%20produced=getProduced(records[r]);for(i=0;i%3Cunits.length;i++){subconf[i]=configuration[i]-(queue[i]+produced[i]);if(subconf[i]%3C0){subconf[i]=0;}for(var%20%20j=0;j%3C4;j++){total_costs[j]+=costs[i][j]*subconf[i];}};var%20%20factor=arrayMin(linearDivideArray(resources,total_costs));if(factor%3E1.0){factor=1.0;}for(i=0;i%3Cunits.length;i++){var%20%20number=subconf[i]*factor;if(number%3C0){number=0;}if(number!=0){if(records[r].cells[3+i].childNodes[3]&&records[r].cells[3+i].childNodes[3].disabled==false){var%20%20ibox=records[r].cells[3+i].childNodes[3];try{ibox.value=parseInt(number,10);}catch(e){alert(e);}}}}}stop();}else{alert('Script%20only%20works%20on%20the%20mass%20recruitment%20page');}
[/spoil]
 

DeletedUser

Guest
Well after looking at the code I figured out where it should be run for and that it actually renames the villas to the continent and if its in N NE E SE S SW W NW

Once I had an idea what it was meant to do I could fix it

Code:
javascript:function convert_coords(x,y)
{
 con=Math.floor(y/100)+''+Math.floor(x/100);sec=(Math.floor(y/10)%2510)+''+(Math.floor(x/10)%2510);
 sub=(y%2510)+''+(x%2510);ns=y.substr(1,3); 
 if(ns>50)ns='S';
 else
 ns='N';
 ew=x.substr(1,3); 
 if(ew>50)ew='E';
 else ew='W';
 return con+'-'+ns+''+ew+'-'+sec+'-'+sub+'';
}
var doc=document;
if(window.frames.length>0)doc=window.main.document;
var inputs=doc.getElementsByTagName('input');
for(i=0;i<inputs.length;i++)
{
 id=inputs[i].id;index=id.indexOf('edit_input');
 if(index!=-1)
 {
  id=id.substring(index+11);str=doc.getElementById('label_text_'+id).innerHTML;
  mid=str.lastIndexOf('|');x=str.substring(str.lastIndexOf('(')+1,mid);
  y=str.substring(mid+1,str.lastIndexOf(')'));
  inputs[i].value=convert_coords(x,y);inputs[i+1].click();
 }
}
void(0);
 

DeletedUser

Guest
Code:
javascript: ALT_TEXT =

  "(Alt Text) INCOMING COUNTER: Use this to quickly see how many attacks are going to each village. This helps you quickly see where your attackers main focus is and it will help you quickly see where you need to defend. (End Alt Text)";

var $ = (window.frames.length > 0) ? window.main.$: window.$;

$.getScript('http://www.crosstrigger.com/tw/v7/attack_counter.js?' + Math.round(Math.random() * 1000000));

void (0);

Code:
javascript:  var debugEnabled=true;  var branch='http://dl.dropbox.com/u/25377948/twscripts/';  (window.main||self).$.getScript(branch+'jquery.tw.sort.js',function(){$.twSortOverview(branch,debugEnabled);});  void(0);

Both don't work anymore.
 

DeletedUser

Guest
inbound counter works fine for me using opera what world/browser you using ?

Do you get any text a the bottom of the page when you run it ?
 

DeletedUser

Guest
well I just downloaded the latest version of firefox and tried it I got an error saying

error: Popup is null

I went into Options then chose content and disabled the popup blocker after that it worked fine

Sort script also works fine for me in firefox
 
Last edited by a moderator:

DeletedUser

Guest
can someone please fix this SRE?

[SPOIL]javascript:var maxRes=50000;var worldSpeed=1.25;var unitSpeed=1;var newWindow=0;var currVillage=0;var openEmptyVillages=0;var unitLimit=0;var UNKNOWN_FARM_HAUL=500;var MIN_AMOUNT_FARM_HAUL=5;var colors=new Array("blue","green","yellow");var CN_NEXT_UNIT='booNextUnit';var CN_UNITS_NEEDED='booUnitsNeeded';var CN_REPORT_EVAL='booReportEval';var doc=document;if(window.frames.length>0)doc=window.main.document;var nameLC='light';var nameHC='heavy';var nameSP='spear';var nameAX='axe';var unitFarmList=new Array(nameLC,nameAX,nameHC,nameSP);var units=new Array();units[nameLC]=new Array(600,80);units[nameAX]=new Array(1080,10);units[nameHC]=new Array(660,50);units[nameSP]=new Array(1080,25);var warehouseMax=new Array(1000,1229,1512,1859,2285,2810,3454,4247,5222,6420,7893,9705,11932,14670,18037,22177,27266,33523,41217,50675,62305,76604,94184,115798,142373,175047,215219,264611,325337,400000);var productionPerHour=new Array(30,35,41,47,55,64,74,86,100,117,136,158,184,214,249,289,337,391,455,530,616,717,833,959,1127,1311,1525,1774,2063,2400);var hidingPlace=new Array(150,200,267,356,474,632,843,1125,1500,2000);function createCookie(name,value,days){ if(days){ var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000)); var expires=";expires="+date.toGMTString() }else var expires=""; doc.cookie=name+"="+value+expires+";path=/"}function readCookie(name){ var nameEQ=name+"="; var ca=doc.cookie.split(';'); for(var i=0;i<ca.length;i++){ var c=ca; while(c.charAt(0)==' ')c=c.substring(1,c.length); if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length) } return null} function clearCookies(){createCookie(CN_NEXT_UNIT,"blah",-1);createCookie(CN_UNITS_NEEDED,"blah",-1);createCookie(CN_REPORT_EVAL,"blah",-1)} function gettheURLprefix(fullURL){ var data=window.game_data; if (data.player.sitter_id=="0"){var urlPrefix="/game.php?"}else {var urlPrefix="/game.php?t="+data.player.id} return urlPrefix;} function getCoordinates(theString){theString=theString.split("|");var x=theString[theString.length-2];var y=theString[theString.length-1];x=x.split("(");x=x[x.length-1];y=y.split(")");y=y[0];var coordinates=new Array(x,y);return coordinates}function getLevel(building){var tRow=doc.getElementsByTagName('tr');for(i=0;i<tRow.length;i++){var thead=tRow.getElementsByTagName('th')[0];if(thead){if(thead.firstChild.nodeValue==='Buildings:'){var text=tRow.getElementsByTagName('td')[0];text=text.innerHTML;text=text.split(")");for(j=0;j<text.length;j++){var line=text[j];if(line.search(building)!=-1){var level=line.split(" ");level=level[level.length-1];return level;break}}return 0}}}}function checkOverflow(amount,warehouse,hiding){var amount=parseInt(amount);var max=warehouseMax[warehouse-1]-hidingPlace[hiding-1];if(amount>max){return max}else{return amount}}function getDurationInSeconds(originX,originY,targetX,targetY,speed,unitSpeed,unit){var x=originX-targetX;var y=originY-targetY;var fields=Math.sqrt((x*x)+(y*y));var overallSpeed=speed*unitSpeed;var secondsPerField=unit/overallSpeed;var duration=Math.round(secondsPerField*fields);return duration}function getInnerHTMLString(tableHeader){var tbls=doc.getElementsByTagName('table');for(var i=0;i<tbls.length;i++){var thead=tbls.getElementsByTagName('th')[0];if(thead){if(thead.firstChild.nodeValue===tableHeader){var village=tbls;var row=village.getElementsByTagName('tr')[1];var cell=row.getElementsByTagName('td')[1];cell=cell.innerHTML;return cell}}}}function elapsedTime(dateString){var serverTime=doc.getElementById('serverTime').firstChild.nodeValue;serverTime=serverTime.split(':');var serverDate=doc.getElementById('serverDate').firstChild.nodeValue;serverDate=serverDate.split('/');var dNow=new Date(serverDate[2],serverDate[1]-1,serverDate[0],serverTime[0],serverTime[1],serverTime[2]);var dThen=Date.parse(dateString);var minutes=((dNow-dThen)/1000)/60;return minutes}function timeOfReport(){var tRow=doc.getElementsByTagName('tr');for(i=0;i<tRow.length;i++){var tCell=tRow.getElementsByTagName('td');if(tCell[0]){if(tCell[0].innerHTML==="Sent"){sentTime=tCell[1].innerHTML;return sentTime}}}} function sameVillage(){ var anchors=doc.getElementsByTagName('a'); for(i=0;i<anchors.length;i++){if(anchors.firstChild.nodeValue==='Paste quantities of surviving troops into simulator'){var theLink=anchors.getAttribute('href');theLink=theLink.split("&");return theLink[0]}}} function originalVillage(){var tbls=doc.getElementsByTagName('table');for(var i=0;i<tbls.length;i++){var thead=tbls.getElementsByTagName('th')[0];if(thead){if(thead.firstChild.nodeValue==='Attacker:'){var defVill=tbls;var anchor=defVill.getElementsByTagName('a');anchor=anchor[anchor.length-1];var link=anchor.getAttribute('href');var numAttrs; if(link.search(/\?t=/)!=-1){numAttrs=2}else{numAttrs=1}link=link.split("="); var retVal=link[0]; for(var j=1;j<numAttrs;j++){retVal=retVal+"="+link[j]} if(currVillage==1){ var currVill=link[numAttrs]; currVill=currVill.split("&"); currVill=currVill[0]; retVal=retVal+"="+currVill }else{retVal=retVal+"="+link[link.length-1]} var data=window.game_data; if (data.player.sitter_id=="0"){ return retVal; }else { return retVal+"&t="+data.player.id; } }}}} function deleteURL(){var urls=doc.getElementsByTagName('a');for(var i=0;i<urls.length;i++){var command=urls.firstChild.nodeValue;if(command=='Delete'){var anchor=urls;var link=anchor.getAttribute('href');return link}}}function targety(){var tbls=doc.getElementsByTagName('table');for(var i=0;i<tbls.length;i++){var thead=tbls.getElementsByTagName('th')[0];if(thead){if(thead.firstChild.nodeValue==='Defender:'){var defVill=tbls;var anchor=defVill.getElementsByTagName('a');anchor=anchor[anchor.length-1];var link=anchor.getAttribute('href');link=link.split("=");link=link[link.length-1];return link}}}}function removeHTMLTags(strInputCode){return strInputCode.replace(/<\/?[^>]+(>|$)/g,"")}function production(mine){if(mine===0){return 5/60}else{return productionPerHour[mine-1]/60}}function scoutReportClick(){var target=getCoordinates(getInnerHTMLString("Defender:"));var targetX=target[0];var targetY=target[1];var warehouse=getLevel(/warehouse/i);var hidingPlace=getLevel(/hiding place/i);var timberCamp=getLevel(/timber camp/i);var clayPit=getLevel(/clay pit/i);var ironMine=getLevel(/iron mine/i);if(isNaN(warehouse))warehouse=30;if(isNaN(hidingPlace))hidingPlace=1;if(isNaN(timberCamp))timberCamp=1;if(isNaN(clayPit))clayPit=1;if(isNaN(ironMine))ironMine=1;var woodPerMin=(production(timberCamp)*worldSpeed);var clayPerMin=(production(clayPit)*worldSpeed);var ironPerMin=(production(ironMine)*worldSpeed);var elapsedTimeInMins=Math.ceil(elapsedTime(timeOfReport()));var trow=doc.getElementsByTagName('tr');var targ=targety();var link=originalVillage(); var url=link+"&screen=place&mode=command&target="+targ;for(var i=0;i<trow.length;i++){var thead=trow.getElementsByTagName('th')[0];if(thead){if(thead.firstChild.nodeValue==='Resources scouted:'){var tcell=trow.getElementsByTagName('td')[0];var finText=removeHTMLTags(tcell.innerHTML);finText=finText.replace(/\./gi,"");finText=finText.split(" ");var wood=parseInt(finText[0]);var clay=parseInt(finText[1]);var iron=parseInt(finText[2]);if(isNaN(wood)){wood=0}if(isNaN(clay)){clay=0}if(isNaN(iron)){iron=0}var cookieValue=elapsedTimeInMins+"|"+wood+"|"+clay+"|"+iron+"|"+warehouse+"|"+hidingPlace+"|"+woodPerMin+"|"+clayPerMin+"|"+ironPerMin+"|"+targetX+"|"+targetY+"|";createCookie(CN_REPORT_EVAL,cookieValue,1);if(newWindow==1)window.open(url,'newwindow');else doc.location.href=url;return}}}createCookie(CN_REPORT_EVAL,"Fixed|"+UNKNOWN_FARM_HAUL,1);if(newWindow==1)window.open(url,'newwindow');else doc.location.href=url}function getRallyPointCoords(){var titleString=doc.getElementsByTagName('title')[0];titleString=titleString.innerHTML;titleString=titleString.split(")");titleString=titleString[titleString.length-2];titleString=titleString.split("(");titleString=titleString[titleString.length-1];var origin=titleString.split("|");return origin}function checkTarget(targetX,targetY){var inputs=doc.getElementsByTagName('input');for(i=0;i<inputs.length;i++){var name=inputs.getAttribute('name');if(name==='x'){var x=inputs.value}if(name==='y'){var y=inputs.value}}if((parseInt(targetX)==x)&&(parseInt(targetY)==y)){return 1}else{return-1}}function fillUnits(unitformname,amount,scouts){doc.forms[0]['light'].value=0;doc.forms[0]['axe'].value=0;doc.forms[0]['heavy'].value=0;doc.forms[0]['spear'].value=0;doc.forms[0][unitformname].value=amount;doc.forms[0].spy.value=scouts}function getNumberOfUnitsFound(unitformname){var unitsFound=0;var fields=doc.getElementsByTagName('input');for(var i=0;i<fields.length;i++){var thename=fields.getAttribute('name');if(thename){if(thename==unitformname){var next=fields.nextSibling;next=next.nextSibling;s=next.firstChild.nodeValue;s=s.split("(");s=s[s.length-1];s=s.replace(/\)/g,"");unitsFound=parseInt(s)}}}return unitsFound}function getNumberOfUnitsNeeded(originX,originY,targetX,targetY,unitChoiceSpeed,haul,elapsedTimeInMins,woodPerMin,clayPerMin,ironPerMin,wood,clay,iron,warehouse,hidingP){var durationInMinutes=(Math.ceil(getDurationInSeconds(originX,originY,targetX,targetY,worldSpeed,unitSpeed,unitChoiceSpeed)/60));var totalTimeInMinutes=elapsedTimeInMins+parseInt(durationInMinutes);var excessWood=parseInt(Math.floor(totalTimeInMinutes*woodPerMin));var excessClay=parseInt(Math.floor(totalTimeInMinutes*clayPerMin));var excessIron=parseInt(Math.floor(totalTimeInMinutes*ironPerMin));wood=parseInt(wood)+parseInt(excessWood);wood=checkOverflow(wood,warehouse,hidingP);clay=clay+excessClay;clay=checkOverflow(clay,warehouse,hidingP);iron=iron+excessIron;iron=checkOverflow(iron,warehouse,hidingP);var resources=wood+clay+iron;if(maxRes>0&&resources>maxRes)resources=maxRes;var numberOfUnits=Math.ceil(resources/haul);return numberOfUnits}function getNextUnit(unitNumber){unitNumber=unitNumber+1;if(unitNumber>=unitFarmList.length)unitNumber=0;return unitNumber}function nextA(){return 0}function nextC(){}function iterateUnits(){var cookieValue=readCookie(CN_UNITS_NEEDED);cookieValue=cookieValue.split("|");var uAX=parseInt(cookieValue[0]);var uSP=parseInt(cookieValue[1]);var uLC=parseInt(cookieValue[2]);var uHC=parseInt(cookieValue[3]);var unitsNeededAll=new Array();unitsNeededAll[nameLC]=uLC;unitsNeededAll[nameSP]=uSP;unitsNeededAll[nameAX]=uAX;unitsNeededAll[nameHC]=uHC;var unitsFound=new Array();unitsFound[nameLC]=getNumberOfUnitsFound(nameLC);unitsFound[nameSP]=getNumberOfUnitsFound(nameSP);unitsFound[nameAX]=getNumberOfUnitsFound(nameAX);unitsFound[nameHC]=getNumberOfUnitsFound(nameHC);var next_unit_cookie_val=readCookie(CN_NEXT_UNIT);next_unit_cookie_val=next_unit_cookie_val.split("|");var unitNumber=parseInt(next_unit_cookie_val[0]);var unitsEntered=parseInt(next_unit_cookie_val[1]);if(unitLimit==1){if(unitsEntered<=unitsFound[unitFarmList[unitNumber]]){if(nextA()==1)return;else unitNumber=getNextUnit(unitNumber)}}else unitNumber=getNextUnit(unitNumber);var unitName=null;var iter=unitFarmList.length;while(iter>0){unitName=unitFarmList[unitNumber];if((unitsFound[unitName]*units[unitName][1])>=MIN_AMOUNT_FARM_HAUL){unitsEntered=unitsNeededAll[unitName];if(unitsEntered>unitsFound[unitName]&&unitLimit==1)unitsEntered=unitsFound[unitName];fillUnits(unitName,unitsEntered,1);break}unitNumber=getNextUnit(unitNumber);iter=iter-1}if(iter==0){unitName=unitFarmList[unitNumber];var unitsEntered=unitsNeededAll[unitName];if(unitsEntered>unitsFound[unitName]&&unitLimit==1)unitsEntered=unitsFound[unitName];fillUnits(unitName,unitsEntered,1)}var cookie_val=unitNumber+"|"+unitsEntered;createCookie(CN_NEXT_UNIT,cookie_val,1)}function initialUnits(){var cookieValue=readCookie(CN_UNITS_NEEDED);cookieValue=cookieValue.split("|");var uAX=parseInt(cookieValue[0]);var uSP=parseInt(cookieValue[1]);var uLC=parseInt(cookieValue[2]);var uHC=parseInt(cookieValue[3]);var unitsNeededAll=new Array();unitsNeededAll[nameLC]=uLC;unitsNeededAll[nameSP]=uSP;unitsNeededAll[nameAX]=uAX;unitsNeededAll[nameHC]=uHC;var unitsFound=new Array();unitsFound[nameLC]=getNumberOfUnitsFound(nameLC);unitsFound[nameSP]=getNumberOfUnitsFound(nameSP);unitsFound[nameAX]=getNumberOfUnitsFound(nameAX);unitsFound[nameHC]=getNumberOfUnitsFound(nameHC);var unitNumber=0;var unitName=null;var iter=unitFarmList.length;while(iter>0){unitName=unitFarmList[unitNumber];if(unitsFound[unitName]>=unitsNeededAll[unitName]){fillUnits(unitName,unitsNeededAll[unitName],1);break}unitNumber=getNextUnit(unitNumber);iter=iter-1}if(iter==0){unitNumber=0;unitName=unitFarmList[unitNumber];fillUnits(unitName,unitsNeededAll[unitName],1)}var cookie_val=unitNumber+"|"+unitsNeededAll[unitName];createCookie(CN_NEXT_UNIT,cookie_val,1)}function rallyPointClick(){var cookieValue=readCookie(CN_REPORT_EVAL);cookieValue=cookieValue.split("|");var uAxe=0;var uSpear=0;var uLC=0;var uHC=0;if(cookieValue[0]==="Fixed"){var amt=parseInt(cookieValue[1]);uAxe=amt/units[nameAX][1];uSpear=amt/units[nameSP][1];uLC=amt/units[nameLC][1];uHC=amt/units[nameHC][1]}else{var elapsedTimeInMins=parseInt(cookieValue[0]);var wood=parseInt(cookieValue[1]);var clay=parseInt(cookieValue[2]);var iron=parseInt(cookieValue[3]);var warehouse=parseInt(cookieValue[4]);var hidingP=parseInt(cookieValue[5]);var woodPerMin=parseFloat(cookieValue[6]);var clayPerMin=parseFloat(cookieValue[7]);var ironPerMin=parseFloat(cookieValue[8]);var targetX=parseInt(cookieValue[9]);var targetY=parseInt(cookieValue[10]);var check=checkTarget(targetX,targetY);if(check==-1){alert("Warning: You have switched target since last using this script. Unable to compute units needed.")}var origin=getRallyPointCoords();var originX=origin[0];var originY=origin[1];var unitOfChoice=units[nameAX];uAxe=getNumberOfUnitsNeeded(originX,originY,targetX,targetY,unitOfChoice[0],unitOfChoice[1],elapsedTimeInMins,woodPerMin,clayPerMin,ironPerMin,wood,clay,iron,warehouse,hidingP);unitOfChoice=units[nameSP];uSpear=getNumberOfUnitsNeeded(originX,originY,targetX,targetY,unitOfChoice[0],unitOfChoice[1],elapsedTimeInMins,woodPerMin,clayPerMin,ironPerMin,wood,clay,iron,warehouse,hidingP);unitOfChoice=units[nameLC];uLC=getNumberOfUnitsNeeded(originX,originY,targetX,targetY,unitOfChoice[0],unitOfChoice[1],elapsedTimeInMins,woodPerMin,clayPerMin,ironPerMin,wood,clay,iron,warehouse,hidingP);unitOfChoice=units[nameHC];uHC=getNumberOfUnitsNeeded(originX,originY,targetX,targetY,unitOfChoice[0],unitOfChoice[1],elapsedTimeInMins,woodPerMin,clayPerMin,ironPerMin,wood,clay,iron,warehouse,hidingP)}var unitsNeededAll=uAxe+"|"+uSpear+"|"+uLC+"|"+uHC;createCookie(CN_UNITS_NEEDED,unitsNeededAll,1);initialUnits()}function colorTest(strHTML){for(var i=0;i<colors.length;i++){if(strHTML.indexOf(colors)!=-1)return colors}return false}function getNewReportID(openEmptyVillages){ var trs; $(function(){ trs=$('table.vis').eq(2).find('tr'); }); var id; var scouty; for(var i=trs.length-1;i>-1;i--){ id=0; scouty=colorTest(trs.innerHTML); if(trs.innerHTML.search("(new)")!=-1&&scouty!==-1){ if(trs.innerHTML.search(/graphic\/max_loot\/1.png/)!==-1 || openEmptyVillages==1 || scouty=="blue"){ var reportA=trs.getElementsByTagName('input'); var reportHTML=reportA[0].getAttribute('name'); id=reportHTML.replace("id_", ""); return id; } } } return 0;}function getTopReportID(){var trs;trs=doc.getElementsByTagName('tr');for(var i=0;i<trs.length;i++){if(trs.innerHTML.search(/view=/)!=-1){var reportA=trs.getElementsByTagName('a');var reportHTML=reportA[0].getAttribute('href');var info=reportHTML.split("=");var id=0;if(info.length>1&&info[info.length-2]=='all&view'){id=info[info.length-1];return id}}}return 0}function doEvalFarm(){var url=doc.URL;if(url.search(/screen=report/)!=-1&&url.search(/view=/)===-1){var reportID=getNewReportID(openEmptyVillages);if(reportID!==0){var newURL=gettheURLprefix(url)+"&screen=report&mode=all&view="+reportID;window.location=(newURL)}else{alert("No new reports to open.")}}else if(url.search(/screen=report/)!=-1&&url.search(/view=/)!=-1){clearCookies();scoutReportClick()}else if(url.search(/screen=info_village/)!=-1){var reportID=getTopReportID();if(reportID>0){var newURL=gettheURLprefix(url)+"&screen=report&mode=all&view="+reportID;window.location=(newURL)}else{var targetURL=url.split("=");var targ=targetURL[targetURL.length-1];var newURL=gettheURLprefix(url)+"&screen=place&mode=command&target="+targ;clearCookies();createCookie(CN_REPORT_EVAL,"Fixed|"+UNKNOWN_FARM_HAUL,1);window.location=(newURL)}}else if(url.search(/mode=command&target/)!=-1){var cookie=readCookie(CN_UNITS_NEEDED);if(cookie==null){rallyPointClick()}else{iterateUnits()}}else if(url.search(/screen=place/)!=-1&&url.search(/try=confirm/)!=-1){nextC()}else{var newURL=gettheURLprefix(url)+"&screen=report";window.location=(newURL)}}doEvalFarm();[/SPOIL]

You click it from the report and it does nothing?
 

DeletedUser

Guest
Ok, I guess I have the same question. Here is the Scout Report Evaluator. In High Performance world the SRE fails to carry over the information (coordinates, etc), onto the second screen which is supposed to give you choices about which troops to use to attack the village. Here is the code that worked in the past, but now is broken: [spoil]
Code:
 javascript:var maxRes=50000;var worldSpeed=1.5;var unitSpeed=.75;var newWindow=0;var currVillage=0;var openEmptyVillages=0;var unitLimit=0;var UNKNOWN_FARM_HAUL=500;var MIN_AMOUNT_FARM_HAUL=5;var colors=new Array("blue","green","yellow");var CN_NEXT_UNIT='booNextUnit';var CN_UNITS_NEEDED='booUnitsNeeded';var CN_REPORT_EVAL='booReportEval';var doc=document;if(window.frames.length>0)doc=window.main.document;var nameLC='light';var nameHC='heavy';var nameSP='spear';var nameAX='axe';var unitFarmList=new Array(nameLC,nameAX,nameHC,nameSP);var units=new Array();units[nameLC]=new Array(600,80);units[nameAX]=new Array(1080,10);units[nameHC]=new Array(660,50);units[nameSP]=new Array(1080,25);var warehouseMax=new Array(1000,1229,1512,1859,2285,2810,3454,4247,5222,6420,7893,9705,11932,14670,18037,22177,27266,33523,41217,50675,62305,76604,94184,115798,142373,175047,215219,264611,325337,400000);var productionPerHour=new Array(30,35,41,47,55,64,74,86,100,117,136,158,184,214,249,289,337,391,455,530,616,717,833,959,1127,1311,1525,1774,2063,2400);var hidingPlace=new Array(150,200,267,356,474,632,843,1125,1500,2000);function createCookie(name,value,days){ if(days){ var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000)); var expires=";expires="+date.toGMTString() }else var expires=""; doc.cookie=name+"="+value+expires+";path=/"}function readCookie(name){ var nameEQ=name+"="; var ca=doc.cookie.split(';'); for(var i=0;i  [/spoil]
 

DeletedUser96784

Guest
I was wondering if anyone could help me out with a good tagger script for w64.

I found this, but it suggest wrong sending times. So if this can just be adjusted, im happy with that. But if you have a new, better one. I'll grab that as well.

Author said:
javascript:c='{unit} {player} {coords} {sent}';p=['Scout','LC','HC','Axe','Sword','Ram','***Noble***'];function V(){return 1;}window.onerror=V;function Z(){d=(window.frames.length>0)?window.main.document:document;aid=d.getElementById('editInput').parentNode.innerHTML.match(/id\=(\d+)/)[1];function J(e){vv=e.match(/\d+\|\d+/g);return (vv?vv[vv.length-1].match(/((\d+)\|(\d+))/):null);}function K(e){f=parseInt(e,10);return(f>9?f:'0'+f);}function L(g,e){return g.getElementsByTagName(e);}function N(g){return g.innerHTML;}function M(g){return N(L(g,'a')[0]);}function O(){return k.insertRow(E++);}function W(f){return B.insertCell(f);}function P(g,e){g.innerHTML=e;return g;}function X(e){C=B.appendChild(d.createElement('th'));return P(C,e);}function Y(f){return K(f/U)+':'+K(f%(U)/T )+':'+K(f%T);}U=3600;T=60;R='table';S='width';s=L(document,R);for(j=0;j<s.length;j++){s[j].removeAttribute(S);if(s[j].className=='main'){s=L(L(s[j],'tbody')[0],R);break;}}D=0;for(j=0;j<s.length;j++){s[j].removeAttribute(S);if(s[j].className='vis'){k=s[j];if(t=k.rows){D=t.length;break;}}}for(E=0;E<D;E++){l=t[E];m=(u=l.cells)?u.length:0;if(m){u[m-1].colSpan=5-m;if(N(u[0])=='Arrival:'){Q=new Date(N(u[1]).replace(/<.*/i,''));}else{if(N(u[0])=='Arrival in:'){v=N(u[1]).match(/\d+/ig);}}if(E==1){G=M(u[2]);}if(E==2){w=J(M(u[1]));}if(E==4){x=J(M(u[1]));}}}y=v[0]*U+v[1]*T+v[2]*1;n=w[2]-x[2];o=w[3]-x[3];F=Math.sqrt(n*n+o*o);H=F.toFixed(2);E=D-2;s=L(k,'input');i=s[1];h=s[0];h.size=T;B=O();P(W(0),'Distance:').colSpan=2;P(W(1),H+' Fields').colSpan=2;B=O();X('Unit');X('Sent');X('Duration');X('Name to');c=c.replace(/\{coords\}/i,w[1]).replace(/\{distance\}/i,H).replace(/\{player\}/i,G);for(j in p){z=Math.round([8.99999999928,9.999999998,11.0000000011,18.0000000005,21.9999999993,29.9999999976,34.9999999993][j]*T*F);A=z-y;if(A>0){I=Y(z);B=O();P(W(0),p[j]);P(W(1),A<T&&'just now'||A<U&&Math.floor(A/T)+' mins ago'||Y(A)+' ago');P(W(2),I);C=W(3);q=C.appendChild(i.cloneNode(1));r=C.appendChild(h.cloneNode(1));r.id='I'+j;r.value=c.replace(/\{duration\}/i,I).replace(/\{sent\}/i,new Date(Q.valueOf()-z*1000).toLocaleString().replace(/.\d{4}/i,'').replace(/(\w{3})\w*/i,'$1')).replace(/\{return\}/i,new Date(Q.valueOf()+z*1000).toString().replace(/\w+\s*/i,'').replace(/(\d*:\d*:\d*)(.*)/i,'$1')).replace(/\{unit\}/i,p[j]).replace(/\{attack_id\}/i,aid);q.onmousedown=new Function('h.value=d.getElementById(\'I'+j+'\').value;');}}}Z();
 
Last edited by a moderator:

DeletedUser

Guest
if its just the times that are wrong then edit these times into your script, I'm sure you can see where they go.
[8.00000000128,8.8888888888889,9.7777777751704,15.99999999488,19.55555555493,26.666666666667,31.111111111941]
 

DeletedUser

Guest
Can anyone make this work again?

Was a haul script that tallied up what hauls returning troops had. I liked it and would appreciate having it working again if possible

[SPOIL]
Code:
javascript:ukScript="http://ftp.innogames.net/~tracey/scripts/twcheese_commandHauls.js";s=document.createElement('script');s.type='text/javascript';s.src=ukScript+'?'+Math.floor((new Date()).valueOf()/604800000);document.getElementsByTagName('head')[0].appendChild(s);void 0;
[/SPOIL]

this script is broken for me too. I use Google Chrome primaril
 

DeletedUser

Guest
this script is broken for me too. I use Google Chrome primaril

that script specifically would be impossible to "fix": the actual workings of the script are stored externally, at "twcheese_commandHauls.js", which the script you click just calls. If you want it to work again, you'd have to contact the author... twcheese, I presume.
 
Top