Stotty2009
Guest
Post all your requests you want for scripts here with as much detail as possible.
[spoil]can someone make me 2 scripts for rally point. one to send 100 sp 1sc 4cat the 2nd to contain 100 axe 1sc and 4 cat. pls and thank you in advance, but if you tell me to go to twfr i swear ill jump thru this monitor and defecate on your face
javascript: var coords = "";
var troops = {
spear: [100, 2],
sword: [0, 0],
axe: [0, 0],
spy: [1, 2],
light: [400, 0],
marcher: [0, 0],
heavy: [0, 0],
ram: [0, 0],
catapult: [4, 2],
snob: [0, 0]
};
$.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/fill_troops_main.js");
void(0);
javascript: var coords = "";
var troops = {
spear: [0, 0],
sword: [0, 0],
axe: [100, 2],
spy: [1, 2],
light: [400, 0],
marcher: [0, 0],
heavy: [0, 0],
ram: [0, 0],
catapult: [4, 2],
snob: [0, 0]
};
$.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/fill_troops_main.js");
void(0);
I'm using a script that extracts coordinates. This is the script
Code:javascript:var villas=$("table[class=content-border]").html().match(/\d+\|\d+/g);alert((villas&&(villas.length>0)?villas.join(" "):"No co-ordinates were found"));void(0);
Could someone make a script for me that deletes duplicate coordinates, but still extracts all the coordinates from the page? Because it's really annoying having to go back and delete all the duplicates from it.
[/spoil]Modified to remove duplicates:
[SPOIL][/SPOIL]Code:javascript:var villas=($('table[class="content-border"]').html().match(/\d+\|\d+/g)||[]).filter(function(a,b,c){return c.lastIndexOf(a)===b;});alert((villas&&(villas.length>0)?villas.join(' '):'No co-ordinates were found'));void(0);
[spoil]i want incoming troops overview script who can calculate how many plunder resources are coming in ur village it is useful for not overflowing ur warehouse
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;
A while ago (around V5.0) I used a script that renamed all commands (outgoing or incoming). It had a pop up box that asked for the name, I can no longer find it. Could anyone please modify this script to include the prompt? Thanks
Code:javascript:function labelAttacks(){var ii,eleInput;var eleDoc=(window.frames.length>0)?window.main.document:document;var arrInputs=eleDoc.getElementsByTagName('input');var strDate=$('#serverDate').text();var strTime=$('#serverTime').text();var newName='RAM';for(ii=0;ii<arrInputs.length;ii++){eleInput=arrInputs[ii];if(eleInput.id.indexOf('editInput')>=0&&eleInput.value.match(/Attack/i)){eleInput.value=newName;arrInputs[++ii].click();}}}labelAttacks();
javascript:var%20text=prompt('Rename attacks to:');var%20doc=document;if(window.frames.length>0)doc=window.main.document;var%20inputs=doc.getElementsByTagName('input');for(i=0;i<inputs.length;i++){if(inputs[i].id.indexOf('editInput')!=-1){if(inputs[i].value.substring(0,6)=='Attack'){inputs[i].value=text;inputs[i+1].click();}}}end();
[SPOIL]Script result
[SPOIL][/SPOIL]
The script that need fixes
[SPOIL]LA Map Overlay tags: 7.1, DaleSMckay, LastApparatus, map overlay, time elapsed, time passed, map farming tool
Shows times since each village on the map was last attacked. Also color codes based on most recent hauls.
» More information
[/SPOIL]Code:javascript:(window.main||self).$.getScript('http://ftp.innogames.net/~tracey/scripts/map_attack_overlay.js',function(){var script=new MapAttackOverlay();script.execute();});void(0);
I don't know much about scripts, but I guess this scripts is hard to fix without the admin or founder of the link that the script has.
And if it's not possible to fix it, is there another script that has the same function? If it's not I'm willing to pay some pp for a fresh private script Just send me a pm
Kthxbaii[/SPOIL]
javascript:(window.main||self).$.getScript('http://dl.dropbox.com/u/25377948/twscripts/map_attack_overlay.js',function(){var script=new MapAttackOverlay();script.execute();});void(0);
Market Scripts
Script Name: Offer Generator
Short Description: Creates offers on the market depending on current resources in that village
Script:
javascript: $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/CreateMarketOffers.js"); void(0);
from http://forum.tribalwars.net/showthread.php?t=243208
Using this script, works great. Only one tiny detail.
I was wondering if it would be possible to release a similar script, but with the possibility to user-define settings to the Offer Maximum Duration.
Or to release one with a different time defined.
i.e. 12hrs ( instead of the 40 hrs defined )
Thank you
javascript:var TIME=40;var SELL=500;var BUY=1000; $.getScript("http://dl.dropbox.com/u/13191442/CreateMarketOffers.js"); void(0);
[spoil]Isn't there a time-stopper script or is i illegal? don't remember on which world, but people have used it
to explain it: Stops the time on the commands on the rally point.
for example when you are about to send snipe and there is some troops coming hope just that time. Then you can use time-stopper to make the clock for that command to stop(servertime still going) so that it doesn't interrupt the snipe.
don't have it myself, but would appreciate if someone told me if it is legal and if it is, post it.
javascript: if (timers.length > 0) { tmptimers = timers; timers = []; } else { timers = tmptimers; } void(0);
is there any fake script that fill rally points with the troops that is only available on the village? if not. can someone try and make one?
http://www.mytwstats.com/reports.php?hash=14fc12ba92bdaf052e41&ad_t=D&RV_view=view_village&vid=<village id from script here>
[SPOIL]Dear Mr Stotty,
We have not spoken in a long time, but I wonder if you would be so kind as to attempt this quick script for me please?
All I need is a script that will grab the village ID from the overview page, and then insert this into a web address and open in a new tab.
Code:http://www.mytwstats.com/reports.php?hash=14fc12ba92bdaf052e41&ad_t=D&RV_view=view_village&vid=<village id from script here>
~Matt[/SPOIL]
javascript:window.open('http://www.mytwstats.com/reports.php?hash=14fc12ba92bdaf052e41&ad_t=D&RV_view=view_village&vid='+(window.main||self).game_data.village.id);void(0);
This will grab your current village ID from any page and open that URL in a new Tab:
Code:javascript:window.open('http://www.mytwstats.com/reports.php?hash=14fc12ba92bdaf052e41&ad_t=D&RV_view=view_village&vid='+(window.main||self).game_data.village.id);void(0);
javascript:var YourURL=String(window.location);var VillageID=YourURL.split('&id=');window.open('http://www.mytwstats.com/reports.php?hash=14fc12ba92bdaf052e41&ad_t=D&RV_view=view_village&vid='+VillageID[1]);void(0);
Code:javascript:var YourURL=String(window.location);var VillageID=YourURL.split('&id=');window.open('http://www.mytwstats.com/reports.php?hash=14fc12ba92bdaf052e41&ad_t=D&RV_view=view_village&vid='+VillageID[1]);void(0);
give it a try I havent tested it
No, that doesn't even open a window.
~Matt
check your popup settings, it worked fine for me.
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');}spear
Can someone edit this for a non-archer world please:
[spoil][/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');}spear
Have you tried changing the bit that says archers=true; to something else?
You know, like maybe archers=false; ?
Also, you didn't copy the whole script.
javascript:var%20archers%20=%20false;%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');}
Dale,
Is there anyway you could add the target player name to your awesome outbound renamer at all?
~Matt