All Broken Scripts

Stotty2009

Guest
As moderating this forum from 150 pages of threads, we are now down to 4 pages (may change as I can restore threads if I need them), I see lots of requests saying "my script is broken", this thread is for ALL scripts which are broken and once fixed, the second post will be updated with broken and their fix and your post will be deleted so it can be kept as clean as possible.

Simple rules for when posting a broken script. Read this thread and post 2 of this current thread, if you do not see your script either a fix or an improved script of the one your requesting, then please post it.
Your script must be wrapped like this
CodeSpoil.PNG

Then please explain what the script is suppose to do.
 
Last edited:

Stotty2009

Guest
Title: instant look on noble claims, sorted by victim:

Old Script:

[spoil]
Code:
javascript:var win=(window.frames.length>0)?window.main:window;var victim="File Not Found";if(victim){var village=win.location.href.match(/village\=\d+/i);var sitter=win.location.href.match(/t\=\d+/i);var buff="<form action='/game.php?screen=ally&mode=reservations&page=&sort=target_player_name&order=DESC"+(village?("&"+village):"")+(sitter?("&"+sitter):"")+"' method='post' id='nobleClaims'><input type='hidden'value='1'name='reservation_search'/><input type='hidden'name='search_for'value='"+victim+"'/><input type='hidden'name='search_by'value='p.name'/><input type='submit'value='Search'style='display:none'/></form>";win.document.body.innerHTML+=buff;win.document.getElementById("nobleClaims").submit();}
[/spoil]

New Script:

[spoil]
Code:
[/spoil]

------------------------------------------------------------------------------------------------------------------

Title: BB-Codes Map Export

Old Script:

[spoil]
Code:
javascript:if(window.location.href.match(/screen\=map/i)){if(!$("#village_coords").length){$("body").app end($("<div id=\"village_coords\"><span>Click a village on the map to select it:</span><br/><textarea id=\"villageList\" cols=\"40\" rows=\"20\" value=\"\"/>"));}$("table[class=map] a[onmouseover*=Map.map_popup]").each(function(i,e){e.href='javascript:var villageList=$("#villageList")[0];if(villageList.value){villageList.value+="\\n";}v illageList.value+="[coord]'+String(e.onmouseover).match(/\d+\|\d+/)+'[/coord]";void(0);';});}else{alert('This script works only on the map');}void(0);
[/spoil]

New Script:

[spoil]
Code:
javascript:    var win=(window.frames.length>0)?window.main:window;  var coords=[];  var outputID='villageList';  var encodeID='cbBBEncode';  var isEncoded=true;    function fnRefresh(){win.$('#'+outputID).attr('value',coords.map(function(e){return isEncoded?'[coord]'+e+'[\/coord]':e;}).join(isEncoded?'\n':' '));}    win.$(win.document).ready(function(){  if(win.$('#'+outputID).length<=0){  if(win.game_data.screen=='map'){  var srcHTML=  '<div id="coord_picker">'+  '<span style="color:blue;text-decoration:underline;">dalesmckay\'s co-ordinate picker v7.1:</span><br/><br/>'+  '<input type="checkbox" id="cbBBEncode" onClick="isEncoded=this.checked;fnRefresh();"'+(isEncoded?'checked':'')+'/>BB-Codes<br/>'+  '<textarea id="'+outputID+'" cols="40" rows="10" value="" onFocus="this.select();"/>'+  '</div>';    ele=win.$('body').append(win.$(srcHTML));    win.TWMap.map._handleClick=function(e){  var pos=this.coordByEvent(e);  var coord=pos.join("|");  var ii=coords.indexOf(coord);  if(ii>=0){  coords.splice(ii,1);  }  else{  coords.push(coord);  }    fnRefresh();    return false;  };  }  else{  alert("Run this script from the Map.\nRedirecting now...");  self.location=win.game_data.link_base_pure.replace(/screen\=\w*/i,"screen=map");  }  }  });    void(0);
[/spoil]

------------------------------------------------------------------------------------------------------------------

Title: Noble Planner View Own Claims

Old Script:

[spoil]
Code:
javascript: ALT_TEXT = "(Alt Text) YOUR CLAIMS: This script will take you quickly to your claims in noble planner. (End Alt Text)"; var player = window.game_data.player.name; var sitter = window.location.href.match(/t\=\d+/i); var buff = "<form action='/game.php?screen=ally&mode=reservations&page=&sort=target_player_name&order=DESC" + (sitter ? ( "&" + sitter): "") + "' method='post' id='nobleClaims'><input type='hidden'value='1'name='reservation_search'/><input type='hidden'name='search_for'value='" + player + "'/><input type='hidden'name='search_by'value='pres.name'/><input type='submit'value='Search'style='display:none'/></form>"; document.body.innerHTML += buff; document.getElementById("nobleClaims").submit();
[/spoil]

New Script:

[spoil]
Code:
javascript:var player = window.game_data.player.id;var sitter = window.location.href.match(/t\=\d+/i);window.location="game.php?village=" + window.game_data.village.id + "&screen=ally&mode=reservations&group_id=creator_id&filter=" + player + (sitter ? ("&" + sitter) : "")
[/spoil]

------------------------------------------------------------------------------------------------------------------

Title: Proximity

Old Script:

[spoil]
Code:
javascript: $.getScript("http://dl.dropbox.com/u/24469843/Scripts/V7.1/Proxmity2.js"); void(0);
[/spoil]

New Script:

[spoil]
Code:
javascript: $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/Proxmity.js"); void(0);
[/spoil]

------------------------------------------------------------------------------------------------------------------

Title: Multi Purpose

Old Script:

[spoil]
Code:
javascript: var worldSpeed=2; var speed={ spear:18/worldSpeed, sword:22/worldSpeed, archer:18/worldSpeed, axe:18/worldSpeed, spy:9/worldSpeed, light:10/worldSpeed, marcher:11/worldSpeed, heavy:11/worldSpeed, ram:30/worldSpeed, catapult:30/worldSpeed, knight:10/worldSpeed, snob:35/worldSpeed, militia:0/worldSpeed }; var win=(window.main||self); var destby=win.game_data.village.coord; $.getScript("http://dl.dropbox.com/u/24469843/Scripts/V7.1/MultiPurposeProximity.js"); void(0);
[/spoil]

New Script:

[spoil]
Code:
javascript: var worldSpeed=2; var speed={ spear:18/worldSpeed, sword:22/worldSpeed, archer:18/worldSpeed, axe:18/worldSpeed, spy:9/worldSpeed, light:10/worldSpeed, marcher:11/worldSpeed, heavy:11/worldSpeed, ram:30/worldSpeed, catapult:30/worldSpeed, knight:10/worldSpeed, snob:35/worldSpeed, militia:0/worldSpeed }; var win=(window.main||self); var destby=win.game_data.village.coord; $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/MultiPurposeProximity.js"); void(0);
[/spoil]

------------------------------------------------------------------------------------------------------------------

Title: Troop Count

Old Script:

[spoil]
Code:
javascript:function c(){var a=(window.frames.length>0)?window.main.document:document;var b=a.createElement('script');b.type='text/javascript';b.src='http://www.crosstrigger.com/tw/troop_counter.js?'+Math.round(Math.random()*1000000);a.getElementsByTagName('head')[0].appendChild(b);}c();
[/spoil]

New Script:

[spoil]
Code:
javascript:(window.main||self).$.getScript('http://crosstrigger.com/tw/v7/troop_counter.js');void(0);
[/spoil]

------------------------------------------------------------------------------------------------------------------

Title: Member Activity Graphs

Old Script:

[spoil]
Code:
javascript:  name_var = 'Name';    show_points = true;  show_villages = true;  show_ODA = true;  show_ODD =  true;  dimensions =[180, 96]; /* Change nothing below here */  plus_one  = 1;  type = "player";    if (typeof (main) != 'undefined')     {$ =  main.$;      game_data = main.game_data;     }    if(game_data.market !=  "en")     {twstats = "http://"+game_data.market+".twstats.com/";      }    else      {twstats = "http://twstats.com/";     }    if  (document.getElementById("ally_content") != null)     {table =  document.getElementById("ally_content").getElementsByTagName("table")[0];       plus_one = 0;     }  else if  (document.getElementById("player_ranking_table"))     {table =  document.getElementById("player_ranking_table");     }  else if  (document.getElementById("ally_ranking_table"))     {table =  document.getElementById("ally_ranking_table");      type = "tribe";     }   else if (document.getElementById("con_ally_ranking_table"))     {table  = document.getElementById("con_ally_ranking_table");      type =  "tribe";     }  else if  (document.getElementById("con_player_ranking_table"))     {table =  document.getElementById("con_player_ranking_table");     }  else if  (document.getElementById("kill_player_ranking_table"))     {table =  document.getElementById("kill_player_ranking_table").parentNode.getElementsByTagName("table")[1];      }  else if (document.getElementById("kill_ally_ranking_table"))      {table =  document.getElementById("kill_ally_ranking_table").parentNode.getElementsByTagName("table")[1];       type="tribe";     }  else      {table =  $("table:contains('"+name_var+"')")[$("table:contains('"+name_var+"')").length  - 1];      plus_one = 1;     }  rows =  table.getElementsByTagName("tr");  if (show_points == true)     {    rows[0].innerHTML +=  "<th><center><b><u>Points</u></b></center></th>";      }  if (show_villages == true)     {   rows[0].innerHTML +=  "</b></center></th><th><center><b><u>Villages</u></b></center></th>";      }  if (show_ODA == true)     {rows[0].innerHTML +=  "<th><center><b><u>ODA</u></b></center></th>";      }  if (show_ODD == true)     {rows[0].innerHTML +=  "<th><center><b><u>ODD</u></b></center></th>";      }  for (i = 1;i < rows.length - 1 + plus_one;i++)     {pid =  rows[I].getElementsByTagName("a")[0].toString().match(/id=\d+/).toString().split( "=")[1];      if (show_points == true)         {rows[I].innerHTML  += "<td><img src='"+twstats + game_data.world +  "/image.php?type=" + type +             "graph&graph=points&id="  + pid + "' style='width:" + dimensions[0] + "px; height:" +  dimensions[1] + "px'></img></td>";         }      if  (show_villages == true)         {rows[I].innerHTML += "<td><img  src='"+twstats + game_data.world + "/image.php?type=" + type +  "graph&graph=villages&id=" +             pid + "' style='width:"  + dimensions[0] + "px; height:" + dimensions[1] +  "px'></img></td>";         }      if (show_ODA == true)          {rows[I].innerHTML += "<td><img src='"+twstats +  game_data.world + "/image.php?type=" + type +  "graph&graph=oda&id=" + pid + "' style='width:" + dimensions[0] +              "px; height:" + dimensions[1] +  "px'></img></td>";         }      if (show_ODD == true)          {rows[I].innerHTML += "<td><img src='"+twstats +  game_data.world + "/image.php?type=" + type +              "graph&graph=odd&id=" + pid + "' style='width:" + dimensions[0] +  "px; height:" + dimensions[1] +              "px'></img></td>";         }     }  void (0);
[/spoil]

New Script:

[spoil]
Code:
javascript:   show_points = true;  show_villages = true;  show_ODA = true;  show_ODD = true;  dimensions =[180, 96]; /* Change nothing below here */  plus_one = 1;  type = "player";    if (typeof (main) != 'undefined')     {$ = main.$;      game_data = main.game_data;     }    if(game_data.market != "en")     {twstats = "http://"+game_data.market+".twstats.com/";      }   else      {twstats = "http://twstats.com/";     }    if (document.getElementById("ally_content") != null)     {table = document.getElementById("ally_content").getElementsByTagName("table")[0];      plus_one = 0;     }  else if (document.getElementById("player_ranking_table"))     {table = document.getElementById("player_ranking_table");     }  else if (document.getElementById("ally_ranking_table"))     {table = document.getElementById("ally_ranking_table");      type = "tribe";     }  else if (document.getElementById("con_ally_ranking_table"))     {table = document.getElementById("con_ally_ranking_table");      type = "tribe";     }  else if (document.getElementById("con_player_ranking_table"))     {table = document.getElementById("con_player_ranking_table");     }  else if (document.getElementById("kill_player_ranking_table"))     {table = document.getElementById("kill_player_ranking_table").parentNode.getElementsByTagName("table")[1];     }  else if (document.getElementById("kill_ally_ranking_table"))     {table = document.getElementById("kill_ally_ranking_table").parentNode.getElementsByTagName("table")[1];      type="tribe";     }  else      {table = $("table:contains('Name')")[$("table:contains('Name')").length - 1];      plus_one = 1;     }  rows = table.getElementsByTagName("tr");  if (show_points == true)     {   rows[0].innerHTML += "<th><center><b><u>Points</u></b></center></th>";     }  if (show_villages == true)     {   rows[0].innerHTML += "</b></center></th><th><center><b><u>Villages</u></b></center></th>";     }  if (show_ODA == true)     {rows[0].innerHTML += "<th><center><b><u>ODA</u></b></center></th>";     }  if (show_ODD == true)     {rows[0].innerHTML += "<th><center><b><u>ODD</u></b></center></th>";     }  for (i = 1;i < rows.length - 1 + plus_one;i++)     {pid = rows[i].getElementsByTagName("a")[0].toString().match(/id=\d+/).toString().split( "=")[1];      if (show_points == true)         {rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +             "graph&graph=points&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";         }      if (show_villages == true)         {rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=villages&id=" +             pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] + "px'></img></td>";         }      if (show_ODA == true)         {rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type + "graph&graph=oda&id=" + pid + "' style='width:" + dimensions[0] +             "px; height:" + dimensions[1] + "px'></img></td>";         }      if (show_ODD == true)         {rows[i].innerHTML += "<td><img src='"+twstats + game_data.world + "/image.php?type=" + type +             "graph&graph=odd&id=" + pid + "' style='width:" + dimensions[0] + "px; height:" + dimensions[1] +             "px'></img></td>";         }     }  void (0);
[/spoil]

------------------------------------------------------------------------------------------------------------------


Title: Send even resources to coordinates

Old Script:

[spoil]
Code:
javascript:var arrRatio=[1,1,1];var intMinMerchants=10;var w="451|225 453|228 453|225 452|221 451|221 455|222 453|224 452|230 454|221";function l(){var j=(window.frames.length>0)?window.main.document:document;var k=$("form[name=units]")[0];function m(){$("input[type=submit][value*=OK]").click()}function x(z,A){if($("#Status").length<=0){$("<table class=\"box\" align=\"center\" width=\""+$("#header_info").attr("width")+"\"><tr><td><img id=\"StatusImg\"/></td><td><span id=\"Status\"></span></td></tr></table>").insertBefore($("#header_info"))}$("#Status").text(z);$("#StatusImg").attr("src","/graphic/dots/"+A+".png")}function n(r){return parseInt(r,10)}var s=j.location.search;if(!s.match(/screen\=market/i)||(!$("td[class=selected]").html().match(/mode\=send/i))){if(s.match(/try\=confirm_send/i)){x("Pe pagina de confirmare... Clik pe OK","green");m()}else{var b=s.match(/village\=\d+/i);var c=s.match(/t\=\d+/i);var s2="?screen=market&mode=send"+((b)?"&"+b:"")+((c)?"&"+c:"");x("Va redirectionez spre "+s2+"...","red");j.location.search=s2}return}if((n(k.wood.value)>0)||(n(k.stone.value)>0)||(n(k.iron.value)>0)){x("Valorile au fost setate... Dau OK","green");m();return}var intSum=0;arrRatio.forEach(function(r,p,arrParam){intSum+=r});var e=[n($("#wood").html()),n($("#stone").html()),n($("#iron").html())];var arrFactors=e.map(function(r,p,arrParam){return arrRatio[p]>0?(r)/arrRatio[p]:999999});var numFactor=Math.min.apply(Math,arrFactors);var arrSendResources=arrRatio.map(function(r,p,arrParam){return Math.floor(numFactor*r)});var numSum=0;arrSendResources.forEach(function(r,p,arrParam){numSum+=r});var u="Insufficient Resources: "+e;var blSend=(intMinMerchants*1000)<=numSum;if(blSend){var intMaxMerchants=n($("td[valign=top] table[class*=vis] tr th").text().match(/(\d+)\/(\d+)/)[1]);u="Insufficient Merchants: "+intMaxMerchants+"<"+intMinMerchants;blSend=(intMaxMerchants>=intMinMerchants)}if(!blSend){x(u,"red");location.href=$("a[accessKey=d]")[0].href;return}var o=Math.min(intMaxMerchants,Math.floor(numSum/1000));arrLastResources=arrRatio.map(function(r,p,arrParam){return Math.floor(1000*o*r/intSum)});var h=w.split(" ");index=0;marketcookie=j.cookie.match("[^|;]\s?market\=([^;]*)[;|$]");if(marketcookie)index=n(marketcookie[1]);if(index>=h.length){alert("last village");index=0}var i=h[index].split("|");index++;cookie_date=new Date();cookie_date.setTime(cookie_date.getTime()+(24*60*60*1000));j.cookie="market="+index+";expires="+cookie_date.toGMTString();insertNumber(k.wood,arrLastResources[0]);insertNumber(k.stone,arrLastResources[1]);insertNumber(k.iron,arrLastResources[2]);insertNumber(k.x,parseInt(i[0]));insertNumber(k.y,parseInt(i[1]));x("Valorile au fost setate... Rulati scriptul din nou pentru a continua...","green")}l();void(0);
[/spoil]

New Script:

[spoil]
Code:
javascript: var arrRatio = [4, 5, 5];  var intMinMerchants = 1;  var w = "424|581 422|583 421|584 427|584 422|586";  $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/MarketSender.js");  void(0);
[/spoil]

------------------------------------------------------------------------------------------------------------------

Title: Incoming Sorter

Old Script:

[spoil]
Code:
javascript:function main(){newRows.sort(sortBy);for(i=0;i<newRows.length;i++){table.rows[i+1].innerHTML=newRows[i].innerHTML;}}function sortSent(a,b){aid=getParam(a.cells[0].getElementsByTagName('a')[0].href,'id');bid=getParam(b.cells[0].getElementsByTagName('a')[0].href,'id');if(asc)return aid-bid;else{return bid-aid;}}function getParam(url, pName){var start=url.indexOf(pName+"=")+pName.length+1;if(pName.length==start)return null;var end=url.indexOf('&',start);if(end>0)return url.substring(start,end);else{return url.substring(start);}return null;}function sortOrigin(a,b){valA=a.cells[2].childNodes[0].innerHTML.toLowerCase();valB=b.cells[2].childNodes[0].innerHTML.toLowerCase();r=sortString(valA,valB);if(r==0)r=sortArrival(a,b);return r;}function sortAttackName(a,b){valA=a.getElementsByTagName('span')[1].innerHTML;valB=b.getElementsByTagName('span')[1].innerHTML;r=sortString(valA,valB);if(r==0)r=sortArrival(a,b);return r;}function sortArrival(a,b){valA=a.cells[4].childNodes[0].innerHTML.split(':');valB=b.cells[4].childNodes[0].innerHTML.split(':');r=0;for(i=0;i<3&&r==0;i++){r=valA[i]-valB[i];}if(!asc)r*=-1;if(r==0)r=sortSent(a,b);return r;}function sortString(a,b){r=new Number(a>b);if(r==0)r--;if(valA==valB)r=0;if(!asc)r=r*-1;return r;}var doc=(window.frames.length>0)?window.main.document:window.document;if(typeof(table)=='undefined')var table=null;if(typeof(asc)=='undefined')var asc=true;if(typeof(sortBy)=='undefined')var sortBy=sortArrival;if(typeof(newRows)=='undefined')var newRows=null;if(!table){ths=doc.getElementsByTagName('th');for(i=0;i<ths.length&&!table;i++){if(ths[i].innerHTML=='Command')table=ths[i].parentNode.parentNode;}if(table){newRows=[];rows=table.rows;for(i=1;i<rows.length-1;i++){newRows.push(rows[i].cloneNode(true));}menu=doc.createElement('table');menu.className='vis';menu.insertRow(0);row=menu.rows[0];title=doc.createElement('th');title.innerHTML='Order By:';menu.rows[0].appendChild(title);row.insertCell(1);row.cells[1].innerHTML='<label onclick=\'asc=true\'><input type=radio name=order checked=true />Ascending </label>';row.insertCell(2);row.cells[2].innerHTML='<label onclick=\'asc=false\'/><input type=radio name=order />Decending </label>';menu.insertRow(1);row=menu.rows[1];row.insertCell(0);row.cells[0].innerHTML='<th>Sort By:</th>';row.insertCell(1);row.cells[1].innerHTML='<label onclick=\'sortBy=sortArrival\'><input type=radio name=sort checked=true />Arrival Time </label>';row.insertCell(2);row.cells[2].innerHTML='<label onclick=\'sortBy=sortSent\'/><input type=radio name=sort />Sent Time </label>';row.insertCell(3);row.cells[3].innerHTML='<label onclick=\'sortBy=sortOrigin\'/><input type=radio name=sort />Player Name </label>';row.insertCell(4);row.cells[4].innerHTML='<label onclick=\'sortBy=sortAttackName\'/><input type=radio name=sort />Attack Name </label>';row.insertCell(5);row.cells[5].innerHTML='<label onclick=\'sortBy=sortDestination\'/><input type=radio name=sort />Destination </label>';menu.insertRow(2);menu.rows[2].innerHTML='<td><input type="button" value="Sort" onClick="main();void(0);"/></td>';table.parentNode.parentNode.insertBefore(menu,table.parentNode);table.parentNode.parentNode.insertBefore(doc.createElement('br'),table.parentNode);}else{alert('the script could not find the appropriate table.\nMake sure you\'re on the right page.');}}void(0);
[/spoil]

New Script:

[spoil]
Code:
javascript: 
function main() {
    newRows.sort(sortBy);
    for (i = 0; i < newRows.length; i++) {
        table.rows[i + 1].innerHTML = newRows[i].innerHTML;
    }
}
function sortSent(a, b) {
    aid = getParam(a.cells[0].getElementsByTagName('a')[0].href, 'id');
    bid = getParam(b.cells[0].getElementsByTagName('a')[0].href, 'id');
    if (asc) return aid - bid;
    else {
        return bid - aid;
    }
}
function getParam(url, pName) {
    var start = url.indexOf(pName + "=") + pName.length + 1;
    if (pName.length == start) return null;
    var end = url.indexOf('&', start);
    if (end > 0) return url.substring(start, end);
    else {
        return url.substring(start);
    }
    return null;
}
function sortOrigin(a, b) {
    valA = a.cells[2].childNodes[0].innerHTML.toLowerCase();
    valB = b.cells[2].childNodes[0].innerHTML.toLowerCase();
    r = sortString(valA, valB);
    if (r == 0) r = sortArrival(a, b);
    return r;
}
function sortAttackName(a, b) {
    valA = a.getElementsByTagName('span')[1].innerHTML;
    valB = b.getElementsByTagName('span')[1].innerHTML;
    r = sortString(valA, valB);
    if (r == 0) r = sortArrival(a, b);
    return r;
}
function sortArrival(a, b) {
    valA = a.cells[4].childNodes[0].innerHTML.split(':');
    valB = b.cells[4].childNodes[0].innerHTML.split(':');
    r = 0;
    for (i = 0; i < 3 && r == 0; i++) {
        r = valA[i] - valB[i];
    }
    if (!asc) r *= -1;
    if (r == 0) r = sortSent(a, b);
    return r;
}
function sortString(a, b) {
    r = new Number(a > b);
    if (r == 0) r--;
    if (valA == valB) r = 0;
    if (!asc) r = r * -1;
    return r;
}
var doc = (window.frames.length > 0) ? window.main.document : window.document;
if (typeof (table) == 'undefined') var table = null;
if (typeof (asc) == 'undefined') var asc = true;
if (typeof (sortBy) == 'undefined') var sortBy = sortArrival;
if (typeof (newRows) == 'undefined') var newRows = null;
if (!table) {
    ths = doc.getElementsByTagName('th');
    for (i = 0; i < ths.length && !table; i++) {
        if (ths[i].innerHTML.match(/Command/)) { table = ths[i].parentNode.parentNode; }
    }
    if (table) {
        newRows = [];
        rows = table.rows;
        for (i = 1; i < rows.length - 1; i++) {
            newRows.push(rows[i].cloneNode(true));
        }
        menu = doc.createElement('table');
        menu.className = 'vis';
        menu.insertRow(0);
        row = menu.rows[0];
        title = doc.createElement('th');
        title.innerHTML = 'Order By:';
        menu.rows[0].appendChild(title);
        row.insertCell(1);
        row.cells[1].innerHTML = '<label onclick=\'asc=true\'><input type=radio name=order checked=true />Ascending </label>';
        row.insertCell(2);
        row.cells[2].innerHTML = '<label onclick=\'asc=false\'/><input type=radio name=order />Decending </label>';
        menu.insertRow(1);
        row = menu.rows[1];
        row.insertCell(0);
        row.cells[0].innerHTML = '<th>Sort By:</th>';
        row.insertCell(1);
        row.cells[1].innerHTML = '<label onclick=\'sortBy=sortArrival\'><input type=radio name=sort checked=true />Arrival Time </label>';
        row.insertCell(2);
        row.cells[2].innerHTML = '<label onclick=\'sortBy=sortSent\'/><input type=radio name=sort />Sent Time </label>';
        row.insertCell(3);
        row.cells[3].innerHTML = '<label onclick=\'sortBy=sortOrigin\'/><input type=radio name=sort />Player Name </label>';
        row.insertCell(4);
        row.cells[4].innerHTML = '<label onclick=\'sortBy=sortAttackName\'/><input type=radio name=sort />Attack Name </label>';
        row.insertCell(5);
        row.cells[5].innerHTML = '<label onclick=\'sortBy=sortDestination\'/><input type=radio name=sort />Destination </label>';
        menu.insertRow(2);
        menu.rows[2].innerHTML = '<td><input type="button" value="Sort" onClick="main();void(0);"/></td>';
        table.parentNode.parentNode.insertBefore(menu, table.parentNode);
        table.parentNode.parentNode.insertBefore(doc.createElement('br'), table.parentNode);
    } else {
        alert('the script could not find the appropriate table.\nMake sure you\'re on the right page.');
    }
}
void (0);
[/spoil]

------------------------------------------------------------------------------------------------------------------


Title: Fake by K

Old Script:

[spoil]
Code:
javascript:function c(){var a=document;if(window.frames.length>0)a=window.main .document;var b=a.createElement('script');b.type='text/javascript';b.src='http://dl.dropbox.com/u/12951642/fakebyk.js';a.getElementsByTagName('head')[0].appendChild(b);}c();
[/spoil]

New Script:

[spoil]
Code:
 Javascript:  $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/OPGen_Basic.js");    void (0);
[/spoil]

------------------------------------------------------------------------------------------------------------------


Title: 1 ram 1 sc fake generator

Old Script:

[spoil]
Code:
javascript:var includeName = true;function e(){var n='op_gen',s='http://dl.dropbox.com/u/12951642/op_gen.js';var a=(window.frames.length>1)?window.main:window;func tion c(m){a.document.body.appendChild(a.document.create TextNode(m));a.document.body.appendChild(a.documen t.createElement('br'));}if(a.document.getElementBy Id(n)==null){c('Creating script entry in doc head...');var A=a.document.createElement('script');A.id=n;A.type ='text/javascript';A.src=s;a.document.getElementsByTagNam e('head')[0].appendChild(A);setTimeout(e,500);return;}if(typeo f(a.document.getElementById(n))=='undefined'){c('L oading script...');setTimeout(e,200);return 0;}c('Loaded');a.generateOp(includeName);}e();
[/spoil]

New Script:

[spoil]
Code:
Javascript:  $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/op_gen.js");    void (0);
[/spoil]

------------------------------------------------------------------------------------------------------------------


Title: Simple Farming Script

Old Script:

[spoil]
Code:
javascript:sp=0;sw=0;ax=00;scout=1;lc=3;hv=0;cat= 0;ra=0;coords='234|443 234|445 230|443 238|439 231|447 235|436 240|444 235|435 239|437 231|450 229|450 243|438 228|450 233|432 244|443 245|443 245|444 241|432 ';var doc=document;if(window.frames.length>0)doc=window. main.document;url=document.URL;if(url.indexOf('scr een=place')==-1)alert('This script needs to be run from the rally point');coords=coords.split(" ");index=0;farmcookie=document.cookie.match('( ^|;) ?farm=([^;]*)(;|$)');if(farmcookie!=null)index=parseInt(farmc ookie[2]);if(index>=coords.length)alert('last village');if(index>=coords.length)index=0;coords=c oords[index];coords=coords.split("|");index=index+1;cookie_dat e=new Date(2019,11,11);document.cookie ="farm="+index+";expires="+cookie_date.toGMTStr ing ();doc.forms[0].x.value=coords[0];doc.forms[0].y.value=coords[1];insertUnit(doc.forms[0].spear,sp);insertUnit(doc.forms[0].sword,sw);insertUnit(doc.forms[0].axe,ax);insertUnit(doc.forms[0].spy,scout);insertUnit(doc.forms[0].light,lc);insertUnit(doc.forms[0].heavy,hv);insertUnit(doc.forms[0].ram,ra);insertUnit(doc.forms[0].catapult,cat);end();
[/spoil]

New Script:

[spoil]
Code:
javascript:sp=0;sw=0;ax=00;scout=1;lc=3;hv=0;cat=0;ra=0;coords='234|443 234|445 230|443 238|439 231|447 235|436 240|444 235|435 239|437 231|450 229|450 243|438 228|450 233|432 244|443 245|443 245|444 241|432';if(document.URL.indexOf('screen=place')==-1)alert('This script needs to be run from the rally point');coords=coords.split(" ");index=0;farmcookie=document.cookie.match('( ^|;) ?farm=([^;]*)(;|$)');if(farmcookie!=null)index=parseInt(farmcookie[2]);if(index>=coords.length)alert('last village');if(index>=coords.length)index=0;coords=coords[index];coords=coords.split("|");index=index+1;cookie_date=new Date(2019,11,11);document.cookie="farm="+index+";expires="+cookie_date.toGMTString();document.forms[0].x.value=coords[0];document.forms[0].y.value=coords[1];insertUnit(document.forms[0].spear,sp);insertUnit(document.forms[0].sword,sw);insertUnit(document.forms[0].axe,ax);insertUnit(document.forms[0].spy,scout);insertUnit(document.forms[0].light,lc);insertUnit(document.forms[0].heavy,hv);insertUnit(document.forms[0].ram,ra);insertUnit(document.forms[0].catapult,cat);void(0);
[/spoil]

------------------------------------------------------------------------------------------------------------------


Title: Withdraw Troop old script:

Old Script:

[spoil]
Code:
Javascript: $.getScript("http://dl.dropbox.com/u/24469843/Scripts/V7.2/Distance_RallyPoint.js"); void(0);[/spoil]

New Script:

[spoil]
Code:
Javascript: $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/Distance_RallyPoint.js"); void(0);[/spoil]

------------------------------------------------------------------------------------------------------------------


Title: Send Back old script:

Old Script:

[spoil]
Code:
Javascript: $.getScript("http://dl.dropbox.com/u/24469843/Scripts/V7.2/Distance_RallyPoint_SB.js"); void(0);[/spoil]

New Script:

[spoil]
Code:
Javascript: $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/Distance_RallyPoint_SB.js"); void(0);[/spoil]

------------------------------------------------------------------------------------------------------------------


Title:

Old Script:

[spoil]
Code:
[/spoil]

New Script:

[spoil]
Code:
[/spoil]

------------------------------------------------------------------------------------------------------------------




Title: Micro Farming Script

New Useful Script

[spoil]
Code:
javascript:var config={spy:1,spear:0,sword:0,axe:0,archer:0,light:20,heavy:0,ram:0,catapult:0,snob:0,knight:0};$("#units_form input[class=unitsInput]").each(function(i,e){e.value=Math.min(Math.max(0,$(e).next().html().match(/\((\d+)\)/i)[1]),config[e.name]||0);});void(0);
[/spoil]

URL: http://forum.tribalwars.net/showpost.php?p=6110339&postcount=6
------------------------------------------------------------------------------------------------------------------

Script Name: Attack timer
Script Link: [spoil]
Code:
javascript:var fixtime=1; var timer;  var planned_time; var back_timer; var servertime_arr; var  serverdate_arr; var landing_time="-";for (var f=10;f<=50;f++) {if  (document.getElementsByTagName('tbody')[f])if (  (document.getElementsByTagName('tbody')[f].innerHTML).match(/td  id\=\"date_arrival\"/g)  )table_n=f;}var  table_ind=document.getElementsByTagName('tbody')[table_n];var  dur_n=3;for (f=1;f<=4;f++) {if  (table_ind.getElementsByTagName('tr')[f].getElementsByTagName('td')[1].id=='date_arrival')  dur_n=f-1;}var  dur_txt=table_ind.getElementsByTagName('tr')[dur_n].getElementsByTagName('td')[1].innerHTML;var   dur_arr=dur_txt.match(/\d+/g);getlandingtime();landing_time.setMinutes(landing_time.getMinutes()+2);var   landing_arr=[landing_time.getDate(),landing_time.getMonth(),landing_time.getYear(),landing_time.getHours(),landing_time.getMinutes(),landing_time.getSeconds()];if  (!table_ind.getElementsByTagName('tr')[dur_n+3]) {  table_ind.innerHTML=table_ind.innerHTML+"<tr><th  colspan=&quot;2&quot;>Plan</th></tr><tr><td>Landing   Time</td><td>"+landing_time+"</td></tr><tr><td>Planned  Time</td><td><input value="+landing_arr[0]+"  size=&quot;1&quot; type=&quot;text&quot;>/<input  value="+(landing_arr[1]+1)+" size=&quot;1&quot;  type=&quot;text&quot;>/<input  value="+(landing_arr[2]+1900)+" size=&quot;3&quot;  type=&quot;text&quot;><br><input  value="+landing_arr[3]+" size=&quot;1&quot;  type=&quot;text&quot;>:<input value="+landing_arr[4]+"  size=&quot;1&quot; type=&quot;text&quot;>:<input  value="+landing_arr[5]+" size=&quot;1&quot;  type=&quot;text&quot;></td></tr><tr><td>Timer</td><td></td></tr>";  }refresh();function refresh() {planned_time=new  Date(table_ind.getElementsByTagName('input')[5].value,  table_ind.getElementsByTagName('input')[4].value-1,  table_ind.getElementsByTagName('input')[3].value,  table_ind.getElementsByTagName('input')[6].value,  table_ind.getElementsByTagName('input')[7].value,  table_ind.getElementsByTagName('input')[8].value);getlandingtime();back_timer=(planned_time-landing_time)/1000;table_ind.getElementsByTagName('tr')[dur_n+4].getElementsByTagName('td')[1].innerHTML=landing_time.toLocaleString();if(back_timer<60)   {table_ind.getElementsByTagName('tr')[dur_n+6].getElementsByTagName('td')[1].innerHTML="<font  color=red><b>"+back_timer+"</b></font>"; }else  {table_ind.getElementsByTagName('tr')[dur_n+6].getElementsByTagName('td')[1].innerHTML=back_timer;  }landing_time.setSeconds(landing_time.getSeconds()+1);timer =  setTimeout("refresh()",200);}function getlandingtime()  {servertime_arr=(document.getElementById('serverTime').innerHTML).match(/\d+/g);serverdate_arr=(document.getElementById('serverDate').innerHTML).match(/\d+/g);landing_time=new  Date(serverdate_arr[2], serverdate_arr[1]-1, serverdate_arr[0],  servertime_arr[0]-(-dur_arr[0]), servertime_arr[1]-(-dur_arr[1]),  servertime_arr[2]-(-dur_arr[2]-fixtime));}end()
[/spoil]

Please, fix that script. Hope on your intelligence

Ok... let me know how this goes.

Attack Timer Script: (rewrite)
[SPOIL]
Code:
javascript:function fnLandingTime(){var a=$("#date_arrival").closest("tr").prev("tr").find("td:eq(1)").text().match(/\d+/g);var b=$("#serverTime").text().match(/\d+/g);var c=$("#serverDate").text().match(/\d+/g);var d=fnInt($("#dsmLag").val());return new Date(Date.UTC(c[2],c[1]-1,c[0],b[0]- -a[0],b[1]- -a[1],b[2]-(-a[2]-d)))}function refresh(){var a=fnLandingTime();$("#date_arrival").html(fnZeroPad(a.getUTCDate(),2)+"/"+fnZeroPad(a.getUTCMonth()+1,2)+"/"+a.getUTCFullYear()+" "+a.getUTCHours()+":"+fnZeroPad(a.getUTCMinutes(),2)+":"+fnZeroPad(a.getUTCSeconds(),2));$("#dsmCT").html($("#serverDate").text()+" "+$("#serverTime").text());var b=new Date(Date.UTC(fnInt($("#dsmYY").val()),fnInt($("#dsmMM").val())-1,fnInt($("#dsmDD").val()),fnInt($("#dsmHH").val()),fnInt($("#dsmNN").val()),fnInt($("dsmSS").val())));var c=(b-a)/1e3;$("#dsmBT").html('<span style="'+(c<60?"color:red;font-weight:bold;":"")+'">'+(c>0?c+" second(s)":"TOO LATE... YOU MISSED IT!")+"</span>");setTimeout("refresh()",200)}function fnInt(a){return parseInt(a||"0",10)}function fnZeroPad(a,b){var c=a.toString();while(c.length<b){c="0"+c}return c}javascript:var defaultLagSeconds=0;if($("#dsmPlannedTime").length<=0){var landingTime=fnLandingTime();landingTime.setUTCMinutes(landingTime.getUTCMinutes()+2);var srcHTML="<tr>"+"<td>Current Time:</td>"+'<td id="dsmCT">'+$("#serverDate").text()+" "+$("#serverTime").text()+"</td>"+"</tr>"+"<tr>"+"<td>Timer:</td>"+'<td id="dsmBT"></td>'+"</tr>"+'<tr id="dsmPlannedTime"><th colspan="2">Plan</th></tr>'+"<tr>"+"<td>Lag Time:</td>"+"<td>"+'<input id="dsmLag" value="'+defaultLagSeconds+'" size="2" type="text"/>'+'<span style="margin-left:0.25em;">second(s)</span>'+"</td>"+"</tr>"+"<tr>"+"<td>Planned Time:</td>"+"<td>"+'<input id="dsmDD" value="'+fnZeroPad(landingTime.getUTCDate(),2)+'" size="2" type="text"/>'+"/"+'<input id="dsmMM" value="'+fnZeroPad(landingTime.getUTCMonth()+1,2)+'" size="2" type="text"/>'+"/"+'<input id="dsmYY" value="'+landingTime.getUTCFullYear()+'" size="4" type="text"/>'+"<br>"+'<input id="dsmHH" value="'+fnZeroPad(landingTime.getUTCHours(),2)+'" size="2" type="text"/>'+":"+'<input id="dsmNN" value="'+fnZeroPad(landingTime.getUTCMinutes(),2)+'" size="2" type="text"/>'+":"+'<input id="dsmSS" value="'+fnZeroPad(landingTime.getUTCSeconds(),2)+'" size="2" type="text"/>'+"</td>"+"</tr>"+'<tr><th colspan="2">Other Info</th></tr>';$(srcHTML).insertAfter($("#date_arrival").closest("tr"));$("#date_arrival").html(landingTime)}refresh();void(0);
[/SPOIL]
 
Last edited:

DeletedUser94981

Guest
hey having some problems with this script, although i know nothing about how it is made etc, i just use it.
some background data on this: used this script in w50 or w52 and it worked fine. i think it was before the new interface(black and red screen). now it doesnt seem to work for me, though was working 2 days ago. and now is just stuffing up. i am a non prem player

[spoil]
Code:
  javascript:var scouts=5;var config={victim:'FARMS',trainSize:1,units:{ram:0,catapult:0,spear:150,sword:0,axe:0,archer:0,light:0,marcher:0,heavy:0},cookieID:'fake'};var targets='717|399 716|398 716|396';if(targets.replace(/^\s\s*/,'').replace(/\s\s*$/,'')===''){throw('There are no Targets');}var coords=targets.split(' ');function escapeStr(text){var specials=['/','.',',','~','`','@','#','%','-','_','*','+','?','|','$','=',':','!','^','<','>','(',')','[',']','{','}','\\'];var sRE=new RegExp('(\\'+specials.join('|\\')+')','g');return text.replace(sRE,'\\$1');}function zeroPad(number,length){var n=number.toString();while(n.length<length){n='0'+n;}return n;}function fnWriteCookie(index){var cookie_date=new Date(2099,11,11);eleDoc.cookie=vWorld+'$'+config.victim+'$'+config.cookieID+'='+(index+1)+';expires='+cookie_date.toGMTString();}function fnAssignUnits(index,isManualReset){if((index<0)||(index>=coords.length)){index=0;if(eleDoc.fakeSequence==1){alert('cycle restarted');}}eleDoc.getElementById('fake_combo').selectedIndex=index;var villa=coords[index].match(/(\d+)\|(\d+)/);if(!isManualReset&&(eleDoc.fakeSequence<config.trainSize)){eleDoc.fakeSequence++;}else{eleDoc.fakeSequence=(isManualReset?2:1);fnWriteCookie(isManualReset?index-1:index);}var eleForm=eleDoc.getElementById('units_form');eleForm.x.value=villa[1];eleForm.y.value=villa[2];var win=(window.frames.length>0)?window.main:window;win.$("input[class=unitsInput]").attr("value","0");var count;if(scouts>0){count=parseInt(eleForm.spy.nextSibling.nextSibling.innerHTML.match(/\d+/));if(count>0){eleForm.spy.value=Math.min(scouts,count);}}for(var unit in config.units){if(config.units.hasOwnProperty(unit)){if((config.units[unit]>0)&&(typeof(eleForm[unit])!="undefined")){count=parseInt(eleForm[unit].nextSibling.nextSibling.innerHTML.match(/\d+/));if(count>0){eleForm[unit].value=Math.min(config.units[unit],count);break;}}}}}try{var eleDoc=(window.frames.length>0)?window.main.document:document;if(typeof(eleDoc.fakeSequence)=='undefined'){eleDoc.fakeSequence=1;}var scrape,vScreen=(scrape=eleDoc.URL.match(/\&screen=(\w+)/i))?scrape[1]:null;var vWorld=(scrape=eleDoc.URL.match(/\/\/(\w+)\./i))?scrape[1]:null;var village=eleDoc.getElementsByTagName('title')[0].innerHTML.match(/\(\d+\|\d+\)/);if(vScreen=='place'){var index=0;var twCookie=eleDoc.cookie.match('[^|;]s?'+escapeStr(vWorld+'$'+config.victim+'$'+config.cookieID+'=')+'([^;]*)[;|$]');if(twCookie){index=parseInt(twCookie[1],10);}if(!eleDoc.getElementById('fake_combo')){var eleInputs=eleDoc.getElementsByTagName('input');if(eleInputs){for(var ii=0;ii<eleInputs.length;ii++){if(eleInputs[ii].name=='support'){var optionList='';for(var jj=0;jj<coords.length;jj++){optionList+='<option>'+zeroPad(jj+1,4)+':'+coords[jj]+'</option>';}eleInputs[ii].parentNode.parentNode.innerHTML+='<TD rowspan="2"><div id="fakes"><table class="main"><tr><td id="fake_content_value"><span style="font-weight:bold">Current Target:</span><select id="fake_combo" name="fake_combo" size="1" onchange="fnAssignUnits(this.selectedIndex,true);">'+optionList+'</select><span style="font-weight:100;font-style:italic;text-decoration:none;font-size:x-small;"><a href="http://www.crosstrigger.com" target="_blank"> by dalesmckay</a></span></td></tr></table></div></TD>';break;}}}}fnAssignUnits(index,false);}else{throw('Run from the Rally point');}void(0);}catch(objErr){alert(objErr);}
[/spoil]


the script is a farming script which enters units and co-ordinates into the rally point and cycles the co-ordinates until it hits the last village and restarts. this one is better than the other farming script u have posted because the one that you have posted skips setting up the units on every 2nd village for me, whereas this one used to work perfectly.

any help or suggesting on this script will be useful, or any links to the same sort of scripts.
 

DeletedUser

Guest
javascript: var arrRatio = [4, 5, 5]; var intMinMerchants = 1; var w = "424|581 422|583 421|584 427|584 422|586"; $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/MarketSender.js"); void(0);



opera broser..it going to market but it not automatically fill resources and coordinate as usual
 

DeletedUser104452

Guest
javascript: var arrRatio = [4, 5, 5]; var intMinMerchants = 1; var w = "424|581 422|583 421|584 427|584 422|586"; $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/MarketSender.js"); void(0);



opera broser..it going to market but it not automatically fill resources and coordinate as usual

I need it aswel
 

dalesmckay

Guest
Send Market Script:
[SPOIL]
Code:
javascript:
var arrRatio=[1,1,1];
var intMinMerchants=10;
var coords='111|111 222|222 333|333 500|500';
(window.main||self).$.getScript('http://dl.dropbox.com/u/25377948/twscripts/send_market.js',function(){SendMarket(arrRatio,intMinMerchants,coords);});void(0);
[/SPOIL]
 

dalesmckay

Guest
[SPOIL]I have two questions/requests on scripts, and would be very grateful for some shared wisdom from the genii here.

First: how can I find a script that simply opens all my village rally points in separate tabs — or all the rally points in a selected group?

Second: In using a hotkey to bookmark a village switching script I find it performs a different action somehow than clicking on the arrows — namely it resets elements on the page, e.g with farm assistant and the 'distance' column. The script I'm trying is thus:
[spoil]javascript:var player = window.game_data.player.id;var sitter = window.location.href.match(/t\=\d+/i);window.location="game.php?village=n" + window.game_data.village.id + "&screen=" + window.game_data.screen + "&t='search_for'" + player + (sitter ? ("&" + sitter) : "")[/spoil]

Thank you !-)[/SPOIL]

  1. It is illegal for scripts to open multiple tabs.
    You can use the script that Anomandaris Irake posted to insert rally point links next to each village.
    You will then have to manually click the links for the village(s) you wish to open in a new tab.
    (or use functionality that is built into the webbrowser to open multiple tabs)

  2. I have no idea what your village switching script is doing, it contains some junk.

    Switch to Next Village Script:
    [SPOIL]
    Code:
    javascript:var win=(window.main||self);win.location=win.location.href.replace(/village\=w*/i,'village=n'+win.game_data.village.id);void(0);
    [/SPOIL]
    Switch to Previous Village Script:
    [SPOIL]
    Code:
    javascript:var win=(window.main||self);win.location=win.location.href.replace(/village\=w*/i,'village=p'+win.game_data.village.id);void(0);
    [/SPOIL]
 
Last edited:

DeletedUser

Guest
1. It is illegal for scripts to open multiple tabs.
You can use the script that Anomandaris Irake posted to insert rally point links next to each village.
You will then have to manually click the links for the village(s) you wish to open in a new tab.
(or use functionality that is built into the webbrowser to open multiple tabs)

Yeah you can either use the addon snaplinks for both opera and FF or use the links panel for opera.


2. I have no idea what your village switching script is doing, it contains some junk.

Switch to Next Village Script:
[SPOIL]
Code:
javascript:var win=(window.main||self);win.location=win.location.href.replace(/village\=w*/i,'village=n'+win.game_data.village.id);void(0);
[/SPOIL]
Switch to Previous Village Script:
[SPOIL]
Code:
javascript:var win=(window.main||self);win.location=win.location.href.replace(/village\=w*/i,'village=p'+win.game_data.village.id);void(0);
[/SPOIL]

:icon_redface: Hey be nice Dale, I made that one. lol

It's always worked fine for me but I just cobbled together a few scripts that I found
 

DeletedUser

Guest
this old customizable fill rally point script written by demaouse stopped working for months now.

been looking for a fix on it failed.... anybody has a working version or anything similar to this ?

Code:
javascript:coords="";var troops={spear:[200,0],sword:[0,0],axe:[0,1],spy:[5,1],light:[0,1],heavy:[100,1],ram:[10,1],catapult:[0,1],snob:[1,0]};function c(){var a=document;if(window.frames.length>0){a=window.main.document}var b=a.createElement("script");b.type="text/javascript";b.src="http://damouse.wartool.net/collectables/fill_troops_main.js";a.getElementsByTagName("head")[0].appendChild(b)}c();

the-hanout link for explanitions
 

DeletedUser93066

Guest
this old customizable fill rally point script written by demaouse stopped working for months now.

been looking for a fix on it failed.... anybody has a working version or anything similar to this ?

Code:
javascript:coords="";var troops={spear:[200,0],sword:[0,0],axe:[0,1],spy:[5,1],light:[0,1],heavy:[100,1],ram:[10,1],catapult:[0,1],snob:[1,0]};function c(){var a=document;if(window.frames.length>0){a=window.main.document}var b=a.createElement("script");b.type="text/javascript";b.src="http://damouse.wartool.net/collectables/fill_troops_main.js";a.getElementsByTagName("head")[0].appendChild(b)}c();

the-hanout link for explanitions

Use this instead. This is set up for offense and defense both.
Any Luck with mine tho?


Code:
javascript:coords="487|655 489|655";var troops={spear:[0,1],sword:[0,1],archer:[0,1],axe:[0,1],spy:[0,1],light:[0,1],marcher:[0,1],heavy:[0,1],ram:[0,1],catapult:[0,1],snob:[1,0]};function c(){var a=document;if(window.frames.length>0){a=window.main.document}var b=a.createElement("script");b.type="text/javascript";b.src="http://taktimer.net/scripts/fill_troops_main.js";a.getElementsByTagName("head")[0].appendChild(b)}c();
 

DeletedUser40486

Guest
Hi there. Could someone fix this script please?
i have an op generator here which is combination of many op generators and support scripts. But now many scripts don't work or are defective. If anyone could rewrite the whole script and get the whole op generator in one script would be great.

I also have trouble getting all scripts out in opera. It works in firefox but it will open multiple tabs instead of one if you enter option 1 under this script.

Code:
javascript: $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/OPCreater.js"); void(0);
 

Stotty2009

Guest
Hi there. Could someone fix this script please?
i have an op generator here which is combination of many op generators and support scripts. But now many scripts don't work or are defective. If anyone could rewrite the whole script and get the whole op generator in one script would be great.

I also have trouble getting all scripts out in opera. It works in firefox but it will open multiple tabs instead of one if you enter option 1 under this script.

Code:
javascript: $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/OPCreater.js"); void(0);

What you have just said is not going to get any one to fix any of these scripts...

What number do you enter for it to break? Paste the script which you are trying to run e.g. the fake script etc
 

DeletedUser40486

Guest
What you have just said is not going to get any one to fix any of these scripts...

What number do you enter for it to break? Paste the script which you are trying to run e.g. the fake script etc


can you fix this script please:APOCALYPSE

Code:
javascript:coords='';var fakeLimit = false;var doc = (window.frames.length > 0) ?   window.main.document: document;coords = coords.split(" ");var index =   0;var farmcookie = document.cookie.match("(^|;) ?fluffy_fake=([^;]*)(;|$)");if (farmcookie !== null) index = parseInt(farmcookie[2]);if   (index == coords.length - 1) alert("last village");if (index >=   coords.length) index = 0;var coord = coords[index].split("|");index++;cookie_date = new Date(2099, 11, 11);document.cookie =   "fluffy_fake=" + index +"; expires=" + cookie_date.toGMTString  ();doc.forms[0].x.value = coord[0];doc.forms[0].y.value = coord  [1];doc.forms[0].x.focus();function getTroop(a){return parseInt  (doc.units[a].parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/), 10);} var scouts =   getTroop("spy"); var spear = getTroop("spear"); var axe = getTroop  ("axe"); var rams = getTroop("ram"); var light = getTroop("light");var   mounted = getTroop("marcher");var cats = getTroop("catapult");var hc =   getTroop("heavy");var archer =   getTroop("archer"); doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;function getTroop(a){return parseInt(doc.units[a].parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/),10);}var scouts=getTroop("spy");var spear=getTroop("spear");var axe=getTroop("axe");var rams=getTroop("ram");var light=getTroop("light");var mounted=getTroop("marcher");var cats=getTroop("catapult");var hc=getTroop("heavy");if(rams>=100&&light>=2000&&cats>=20){doc.forms[0].axe.value=axe;doc.forms[0].light.value=light-50;doc.forms[0].spy.value=scouts;doc.forms[0].catapult.value=cats-20;doc.forms[0].ram.value=rams;doc.forms[0].marcher.value=mounted;}else if(rams>=100&&axe>=4000&&cats>=20){doc.forms[0].axe.value=axe-100;doc.forms[0].light.value=light;doc.forms[0].spy.value=scouts;doc.forms[0].catapult.value=cats-20;doc.forms[0].ram.value=rams;doc.forms[0].marcher.value=mounted;}else if(rams>=100&&mounted>=2000&&cats>=20){doc.forms[0].axe.value=axe;doc.forms[0].light.value=light;doc.forms[0].spy.value=scouts;doc.forms[0].catapult.value=cats-20;doc.forms[0].ram.value=rams;doc.forms[0].marcher.value=mounted-50;}else if(cats>=35){if(axe>=100){doc.forms[0].axe.value=100;}else if (light >= 100) doc.forms[0].light.value = 100;else if (mounted >= 100) doc.forms[0].marcher.value = 100;else if(hc>=100){doc.forms[0].heavy.value=100;}else if (hc == 66) doc.forms[0].heavy.value = 66;else if (archer >= 100) doc.forms[0].archer.value = 100;else if(spears>=100){doc.forms[0].spear.value=100;}else{alert("Not enough troops to support your Fanged Fake. Check the tavern.");}if(scouts>=5){doc.forms[0].spy.value=5;}doc.forms[0].catapult.value=35;}else if(scouts>=100){doc.forms[0].spy.value=100;if(rams>=1){doc.forms[0].ram.value=1;}else if(cats>=1){doc.forms[0].catapult.value=1;}else{alert("No rams or cats available for Intel Fake.");}}else{if(axe>=100)doc.forms[0].axe.value=100;else if(spear>=100){doc.forms[0].spear.value=100;}else{alert("Not enough troops to support your trash fake. You shouldn't have even got this far. Better start recruiting!");}if(rams>=1){doc.forms[0].ram.value=1;}else if(cats>=1){doc.forms[0].catapult.value=1;}else{alert("No rams or cats available");}if(scouts>=5){doc.forms[0].spy.value=5;doc.forms[0].x.focus();}}void(0);

you can find our here what this script is supposed to do:
http://forum.tribalwars.net/showthread.php?t=233613

thanks
 

Stotty2009

Guest
can you fix this script please:APOCALYPSE

Code:
javascript:coords='';var fakeLimit = false;var doc = (window.frames.length > 0) ?   window.main.document: document;coords = coords.split(" ");var index =   0;var farmcookie = document.cookie.match("(^|;) ?fluffy_fake=([^;]*)(;|$)");if (farmcookie !== null) index = parseInt(farmcookie[2]);if   (index == coords.length - 1) alert("last village");if (index >=   coords.length) index = 0;var coord = coords[index].split("|");index++;cookie_date = new Date(2099, 11, 11);document.cookie =   "fluffy_fake=" + index +"; expires=" + cookie_date.toGMTString  ();doc.forms[0].x.value = coord[0];doc.forms[0].y.value = coord  [1];doc.forms[0].x.focus();function getTroop(a){return parseInt  (doc.units[a].parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/), 10);} var scouts =   getTroop("spy"); var spear = getTroop("spear"); var axe = getTroop  ("axe"); var rams = getTroop("ram"); var light = getTroop("light");var   mounted = getTroop("marcher");var cats = getTroop("catapult");var hc =   getTroop("heavy");var archer =   getTroop("archer"); doc=document;if(window.frames.length>0)doc=window.main.document;url=document.URL;function getTroop(a){return parseInt(doc.units[a].parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/),10);}var scouts=getTroop("spy");var spear=getTroop("spear");var axe=getTroop("axe");var rams=getTroop("ram");var light=getTroop("light");var mounted=getTroop("marcher");var cats=getTroop("catapult");var hc=getTroop("heavy");if(rams>=100&&light>=2000&&cats>=20){doc.forms[0].axe.value=axe;doc.forms[0].light.value=light-50;doc.forms[0].spy.value=scouts;doc.forms[0].catapult.value=cats-20;doc.forms[0].ram.value=rams;doc.forms[0].marcher.value=mounted;}else if(rams>=100&&axe>=4000&&cats>=20){doc.forms[0].axe.value=axe-100;doc.forms[0].light.value=light;doc.forms[0].spy.value=scouts;doc.forms[0].catapult.value=cats-20;doc.forms[0].ram.value=rams;doc.forms[0].marcher.value=mounted;}else if(rams>=100&&mounted>=2000&&cats>=20){doc.forms[0].axe.value=axe;doc.forms[0].light.value=light;doc.forms[0].spy.value=scouts;doc.forms[0].catapult.value=cats-20;doc.forms[0].ram.value=rams;doc.forms[0].marcher.value=mounted-50;}else if(cats>=35){if(axe>=100){doc.forms[0].axe.value=100;}else if (light >= 100) doc.forms[0].light.value = 100;else if (mounted >= 100) doc.forms[0].marcher.value = 100;else if(hc>=100){doc.forms[0].heavy.value=100;}else if (hc == 66) doc.forms[0].heavy.value = 66;else if (archer >= 100) doc.forms[0].archer.value = 100;else if(spears>=100){doc.forms[0].spear.value=100;}else{alert("Not enough troops to support your Fanged Fake. Check the tavern.");}if(scouts>=5){doc.forms[0].spy.value=5;}doc.forms[0].catapult.value=35;}else if(scouts>=100){doc.forms[0].spy.value=100;if(rams>=1){doc.forms[0].ram.value=1;}else if(cats>=1){doc.forms[0].catapult.value=1;}else{alert("No rams or cats available for Intel Fake.");}}else{if(axe>=100)doc.forms[0].axe.value=100;else if(spear>=100){doc.forms[0].spear.value=100;}else{alert("Not enough troops to support your trash fake. You shouldn't have even got this far. Better start recruiting!");}if(rams>=1){doc.forms[0].ram.value=1;}else if(cats>=1){doc.forms[0].catapult.value=1;}else{alert("No rams or cats available");}if(scouts>=5){doc.forms[0].spy.value=5;doc.forms[0].x.focus();}}void(0);

you can find our here what this script is supposed to do:
http://forum.tribalwars.net/showthread.php?t=233613

thanks

Which part of the script doesn't work?
 

DeletedUser40486

Guest
Which part of the script doesn't work?

Offense troops doesn't enter. It is supposed to enter offense troops first but save 20 cats ( if cats not available saves rams). then you click again and it sends fakes to other villages. But right now it is only sending fakes.
 

DeletedUser

Guest
Hello guys,
is there any chance to fix original TakSelector script?
[spoil]
Code:
Javascript:
/* http://taktimer.net/scripts/ppSelectCoords.js */
scriptName = "TakSelector";
majorVersion = 2;
minorVersion = 01; /*End Version Data*/


if (typeof (defaultExString) == "undefined") {
defaultExString = "{COORDS} ";
}
else {
defaultExString += " ";
}


/* Define major object variables */

var table = document.getElementById("villages_list");
/*V7.3 added in a new feature to the player profile which only showed the first 100 villages - this fixes this error*/
if (table.tBodies[0].rows.length > 100 && table.tBodies[0].rows.length < 102) {
/*This checks to see if its over 100 rows (if it is, then it means that annoying button is there, which you need to get rid of*/
var str = table.tBodies[0].rows[100].getElementsByTagName("td")[0].getElementsByTagName("a")[0].getAttribute("onclick").replace("return false", "");
var patt1 = /\d+/g;
var x = (str.match(patt1));
Player.getAllVillages(this, '/game.php?village=' + x[0] + '&screen=info_player&ajax=fetch_villages&player_id=' + x[1]);
table.tBodies[0].deleteRow(100);
javascript: $.getScript("http://dl.dropbox.com/u/24469843/Tribalwars/Scripts/TakSelector.js"); void (0);
end();
}

table2 = $("th:contains('Villages')");
if(document.URL.match('divokekmeny.cz')){table2 = $("th:contains('Vesnice')");}
table2 = table2[table2.length - 1].parentNode.parentNode;

mainTable = table2.parentNode.parentNode.nextSibling;

/* End define major object variables */

var x = (table.tHead.innerHTML);

table.tHead.innerHTML = (x.replace("</tr>", "") + "<th>Include village?</th><th>Select/Deselect All<br><input type='checkbox' id='selectAllBox' onClick='javascript: selectAll(); void(0)'></input></th><th>Invert list<br><input type='checkbox' id='invertListBox' onClick='javascript: invertAll(); void(0)'></input></th>");

/* Add and Identify Checkboxes */

for (i = 0; i < table.tBodies[0].rows.length; i++) {
table.tBodies[0].rows.innerHTML += "<td><input type='checkbox' id='includeCoordsInputBox_" + i + "'></input></td>";
}

/* End Add and Identify Checkboxes */

mainTable.innerHTML = "<br><br><br><br><br><br><br><br>" + mainTable.innerHTML;

/*Experimental Output Format Table*/
mainTable.innerHTML = "<br><table><tr><th>Experimental List Format</th><td><input type='text' name='experimentalListFormat' value='" + defaultExString + "' id='experimentalFormatBox' /><br>Insert data <select id='experimentalSelectBox' onChange=\"javascript: document.getElementById('experimentalFormatBox').value += document.getElementById('experimentalSelectBox').value; void(0);\"><option value=''>Select an item to add</option><option value='{COUNTER} '>Counter</option><option value='{COORDS} '>Coordinates</option><option value='Objekt není k dispozici '>BBCoded Coordinates</option><option value='{VILLAGE LINK} '>Village Links</option><option value='{TARGET PLAYER} '>Target Player Name</option><option value='{TARGET PLAYER}'>BBCoded Player name</option><option value='{POINTS} '>Points</option><option value='{DV}'> - Divider -</option><option value='{NL}'>New Line</option></select></td></tr><tr><th></th><td><input type='button' value='Output list' onClick='javascript: outputExperimentalList(); void(0);' /></td></tr></table>" + mainTable.innerHTML;
/*End EXPERIMENTAL Output Format Table*/

/*Output Format Table*/
mainTable.innerHTML = "<br><table><tr><th>List Format</th><td>Script style:<input type='radio' name='listFormat' value='script format' id='sRadBut' /><br>Claimslist format:<input type='radio' name='listFormat' value='bbcode format' id='bRadBut' /> Show points: <input type='checkbox' id='pointsBox' /></td></tr><tr><th></th><td><input type='button' value='Output list' onClick='javascript: outputList(); void(0);' /><input type='button' value='Reset list' onClick='javascript: resetList(); void(0);' /></td></tr></table>" + mainTable.innerHTML; /*End Output Format Table*/

/*Text Match Table*/
mainTable.innerHTML = "<br><table><tr><th>Text Match</th><td><input type='text' id='textMatchBox' size='17' value='common text to match'/></td></tr><tr><th></th><td><input type='button' value='Perform Text Match' onClick='javascript: byText(); void(0);'></input></td></tr></table><br>" + mainTable.innerHTML; /*End Text Match Table*/

/*Points Table*/
mainTable.innerHTML = "<br><table><tr><th>Minimum Points</th><td><input type='text' id='minPointsBox' size='8' value='0'/></td></tr><tr><th>Maximum Points</th><td><input type='text' id='maxPointsBox' size='8' value='13000'/></td></tr><tr><th></th><td><input type='button' value='Perform points filter' onClick='javascript: byPoints(); void(0);'></input></td></tr></table><br>" + mainTable.innerHTML; /*End Points Table*/

/*Travel Time Table*/
mainTable.innerHTML = "<br><table><tr><th>Select by Travel Time</th><td>HMS :<input type='text' size='3' value='24' id='maxH'></input>:<input type='text' size='3' value='00' id='maxM'></input>:<input type='text' size='3' value='00' id='maxS'></input></td></tr><tr><th>Central Coordinates</th><td>X:<input type='text' size='5' value='" + game_data.village.coord.split('|')[0] + "' id='centralX1'></input> Y:<input type='text' size='5' value='" + game_data.village.coord.split('|')[1] + "' id='centralY1'></td></tr><tr><th><select id='troopTypeBox'><option value='NONE'>Select Troop Type</option><option value='spear'>Spear / Axe / Archer</option><option value='sword'>Sword</option><option value='spy'>Scout</option><option value='light'>Light Cav</option><option value='marcher'>Mounted Archer</option><option value='heavy'>Heavy Cav</option><option value='ram'>Rams / Catapults</option><option value='snob'>Nobleman</option></select></th><td><input type='button' value='GO!' onClick='javascript: byTravelTime(); void(0);'></input></td></tr></table><br>" + mainTable.innerHTML; /*End Travel Time Table*/

/*Proximity Table*/
mainTable.innerHTML = "<br><table><tr><th>Central Coordinates</th><td>X:<input type='text' size='5' value='" + game_data.village.coord.split('|')[0] + "' id='centralX'></input> Y:<input type='text' size='5' value='" + game_data.village.coord.split('|')[1] + "' id='centralY'></td></tr><tr><th></th><td>Fields:<input type='text' size='5' value='25' id='maxFields'></input><input type='button' value='GO!' onClick='javascript: byFields(); void(0);'></input></td></tr></table><br>" + mainTable.innerHTML; /*End Proximity Table*/

/*Zone Table*/
mainTable.innerHTML = "<br><br><table><tr><th>Select Target Zone (Lowest)</th><td>X:<input type='text' size='5' value='000' id='lowestX'></input> Y:<input type='text' size='5' value='000' id='lowestY'></input></td></tr><tr><th>Select Target Zone (Highest)</th><td>X:<input type='text' size='5' value='999' id='highestX'></input> Y:<input type='text' size='5' value='999' id='highestY'></input></td></tr><tr><th>Select By Continent</th><td>K<input type='text' size='4' value='55' id='inputK'></input><input type='button' value='Submit K' onClick='javascript: selectByK(); void(0);'></input></td></tr><tr><th></th><td><input type='button' value='Submit Zone' onClick='javascript: selectZone(); void(0);'></input></td></tr></table><br>" + mainTable.innerHTML; /*End Zone Table*/

/*Selection Mode Table*/
mainTable.innerHTML = "<br><br><table><tr><th>Selection Mode</th><td>Add:<input type='radio' name='selectionFormat' value='Add' id='addRadBut' /><br>Remove:<input type='radio' name='selectionFormat' value='Remove' id='removeRadBut' /><br>Replace:<input type='radio' name='selectionFormat' value='Replace' id='replaceRadBut' /></td></tr></table><br>" + mainTable.innerHTML; /*End Selection Mode Table*/

mainTable.innerHTML = "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>" + mainTable.innerHTML;

selAll = document.getElementById("selectAllBox");
invAll = document.getElementById("invertListBox");
minX = document.getElementById("lowestX");
minY = document.getElementById("lowestY");
maxX = document.getElementById("highestX");
maxY = document.getElementById("highestY");
inpK = document.getElementById("inputK");
cenX = document.getElementById("centralX");
cenY = document.getElementById("centralY");
cenX1 = document.getElementById("centralX1");
cenY1 = document.getElementById("centralY1");
maxF = document.getElementById("maxFields");
maxH = document.getElementById("maxH");
maxM = document.getElementById("maxM");
maxS = document.getElementById("maxS");
TTB = document.getElementById("troopTypeBox");
pBox = document.getElementById("pointsBox");
sRad = document.getElementById("sRadBut");
bRad = document.getElementById("bRadBut");
targetPlayer = $.trim(mainTable.previousSibling.getElementsByTagName('th')[0].innerHTML.split("<")[0]);
listFormat = 'script format';
addRad = document.getElementById("addRadBut");
remRad = document.getElementById("removeRadBut");
repRad = document.getElementById("replaceRadBut");
txtBox = document.getElementById("textMatchBox");
exFormBox = document.getElementById('experimentalFormatBox');


repRad.checked = true;


function selectAll() {
if (selAll.checked == true) {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
box = document.getElementById("includeCoordsInputBox_" + i);
box.checked = true;
}
} else if (selAll.checked == false) {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
box = document.getElementById("includeCoordsInputBox_" + i);
box.checked = false;
}
}
}

function getDistance(a, b) {
var a = a.split("|");
var b = b.split("|");
var c = b[0] - a[0];
var d = b[1] - a[1];
return Math.sqrt(c * c + d * d);
}

function byPoints() {
minPoints = parseInt(document.getElementById('minPointsBox').value);
maxPoints = parseInt(document.getElementById('maxPointsBox').value);
for (i = 0; i < table.tBodies[0].rows.length; i++) {
cells = table.tBodies[0].rows.getElementsByTagName("td");
box = document.getElementById("includeCoordsInputBox_" + i);
if (repRad.checked == true) {
box.checked = false;
}
points = $(cells[2]).text().replace(".", "");
if ((points > minPoints) && (points < maxPoints)) {
doSelect();
}
}
} /* Returns specific unit type's speed value */

function speed(troop_type) {
return troop_xml.getElementsByTagName(troop_type)[0].getElementsByTagName("speed")[0].firstChild.nodeValue;
} /* Loads the xml data from the world server */

function fnGetConfig(conf, err) {
var oRequest = new XMLHttpRequest();
var sURL = "http://" + window.location.hostname + "/interface.php?func=get_" + conf;
oRequest.open("GET", sURL, 0);
oRequest.send(null);
if (oRequest.status == 200) return oRequest.responseXML;
alert("Error executing XMLHttpRequest call to get " + err + "!");
}
troop_xml = fnGetConfig("unit_info", "Troop Speed Data");

function byFields() {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
cells = table.tBodies[0].rows.getElementsByTagName("td");
box = document.getElementById("includeCoordsInputBox_" + i);
coords = cells[1].innerHTML;
if (repRad.checked == true) {
box.checked = false;
}
if ((getDistance(cenX.value + "|" + cenY.value, coords)) < maxF.value) {
doSelect();
}
}
}

function invertAll() {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
box = document.getElementById("includeCoordsInputBox_" + i);
if (box.checked == true) {
box.checked = false;
} else if (box.checked == false) {
box.checked = true;
}
}
}

function selectZone() {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
cells = table.tBodies[0].rows.getElementsByTagName("td");
box = document.getElementById("includeCoordsInputBox_" + i);
coords = cells[1].innerHTML.split("|");
if (repRad.checked == true) {
box.checked = false;
}
if ((parseInt(coords[0]) > minX.value) && (parseInt(coords[0]) < maxX.value) && (parseInt(coords[1]) > minY.value) && (parseInt(coords[1]) < maxY.value)) {
doSelect();
}
}
}


function byTravelTime() {
centralCoords = cenX1.value + "|" + cenY1.value;
seconds = Math.round(parseInt(maxH.value * 3600) + parseInt(maxM.value * 60) + parseInt(maxS.value));
troopType = TTB.value;
spd = Math.round(speed(troopType));
for (i = 0; i < table.tBodies[0].rows.length; i++) {
cells = table.tBodies[0].rows.getElementsByTagName("td");
coords = cells[1].innerHTML;
distance1 = getDistance(centralCoords, coords);
travelTime = spd * distance1 * 60;
box = document.getElementById("includeCoordsInputBox_" + i);
if (repRad.checked == true) {
box.checked = false;
}
if (seconds > travelTime) {
doSelect();
}
}
}

function selectByK() {
K = inpK.value;
if (K.length > 1) {
K = K.split("");
} else {
K = ('0' + K.value).split("");
}

minX1 = (parseInt(K[1]) * 100) - 1;
minY1 = (parseInt(K[0]) * 100) - 1;
maxX1 = (parseInt(K[1]) + 1) * 100;
maxY1 = (parseInt(K[0]) + 1) * 100;
for (i = 0; i < table.tBodies[0].rows.length; i++) {
cells = table.tBodies[0].rows.getElementsByTagName("td");
box = document.getElementById("includeCoordsInputBox_" + i);
coords = cells[1].innerHTML.split("|");
if (repRad.checked == true) {
box.checked = false;
}
if ((parseInt(coords[0]) > minX1) && (parseInt(coords[0]) < maxX1) && (parseInt(coords[1]) > minY1) && (parseInt(coords[1]) < maxY1)) {
doSelect();
}
}
}

function resetList() {
confirmReset = confirm("Are you sure you want to reset the values?");
if (confirmReset) {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
box = document.getElementById("includeCoordsInputBox_" + i);
box.checked = false;
}
minX.value = 000;
minY.value = 000;
maxX.value = 999;
maxY.value = 999;
}
}

function byText() {
matchText = txtBox.value.toLowerCase();
for (i = 0; i < table.tBodies[0].rows.length; i++) {
cells = table.tBodies[0].rows.getElementsByTagName("td");
box = document.getElementById("includeCoordsInputBox_" + i);
txt = $(cells[0]).text().toLowerCase();
if (repRad.checked == true) {
box.checked = false;
}
if (txt.match(matchText)) {
doSelect();
}
}
}

function doSelect() {
if ((addRad.checked == true) | (repRad.checked == true)) {
box.checked = true;
} else if (remRad.checked == true) {
box.checked = false;
} else {
alert("ERROR: Selection mode not set");
fail();
}
}

function outputList() {
kount = 0;
clist = '';
if (sRad.checked == true) {
listFormat = sRad.value;
}
if (bRad.checked == true) {
listFormat = bRad.value;
}
if (listFormat == "script format") {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
box = document.getElementById("includeCoordsInputBox_" + i);
if (box.checked == true) {
cells = table.tBodies[0].rows.getElementsByTagName("td");
clist += cells[1].innerHTML + " ";
}
}
} else if (listFormat == "bbcode format") {
for (i = 0; i < table.tBodies[0].rows.length; i++) {
box = document.getElementById("includeCoordsInputBox_" + i);
if (box.checked == true) {
kount = kount + 1;
cells = table.tBodies[0].rows.getElementsByTagName("td");
clist += "" + kount + ": " + targetPlayer + "\t-\tObjekt není k dispozici";
if (pBox.checked == true) {
clist += "\t - " + $(cells[2]).text() + "\n";
}
clist += "\n";
}
}
}
alert(clist);
}

function outputExperimentalList() {
kount = 0;
clist = '';
for (i = 0; i < table.tBodies[0].rows.length; i++) {
box = document.getElementById("includeCoordsInputBox_" + i);
if (box.checked == true) {
kount = kount + 1;
cells = table.tBodies[0].rows.getElementsByTagName("td");
villageLink = cells[0].getElementsByTagName('a')[0];
coords = $(cells[1]).text();
points = $(cells[2]).text();
points = points.replace(".", "");
clist += exFormBox.value.replace(/{COORDS}/gi, coords).replace(/{TARGET PLAYER}/gi, targetPlayer).replace(/{VILLAGE LINK}/gi, villageLink).replace(/{POINTS}/gi, points).replace(/{DV}/gi, "\t-\t").replace(/{NL}/gi, "\n").replace(/{COUNTER}/ig, kount);
}
}
alert(clist);
}

void (0);
[/spoil]
with new version of TW, check-box next to villages is missing, therefore it is not selecting any villages.
http://www.pixhost.org/show/3501/11558178_takselector-copy.jpg
ps: i would be grateful if this part of script could be preserved:
[spoil]
Code:
table2 = $("th:contains('Villages')");
if(document.URL.match('divokekmeny.cz')){table2 = $("th:contains('Vesnice')");}
table2 = table2[table2.length - 1].parentNode.parentNode;
[/spoil]
 

DeletedUser95497

Guest
can someone fix this 2 scripts please ? :(:(:(
this 2 also quit working :(
last atac :
Code:
javascript: (window.main || self).$.getScript('http://dl.dropbox.com/u/24469843/International/MapOverlay.js', function () {     var script = new MapAttackOverlay();     script.execute(); }); void(0);
Village evolution :
Code:
javascript:if(game_data.screen!='map'){document.location.replace('?screen=map');void(0)}function getDoc(){return document}$(document).ajaxStop(function(){TWMap.map.reload()});coords=[];for(row=0;row<TWMap.size[1];row++){for(col=0;col<TWMap.size[0];col++){coord=TWMap.map.coordByPixel(TWMap.map.pos[0]+(TWMap.tileSize[0]*col),TWMap.map.pos[1]+(TWMap.tileSize[1]*row));if(TWMap.villages[coord.join("")]){coords.push(coord[0]+'|'+coord[1])}}}url='http://www.twstats.com/scriptdispatch.php?script=mapmod&m='+game_data.market+'&s='+game_data.world+'&v='+game_data.version+'&coords='+coords.join(',');scr=$('<script type="text/javascript" />').attr('src',url);$(document).append(scr);void(0);
 

DeletedUser

Guest
With 8.3 Update, SRE for Periodic farm just stopped working aswell.

would appreciate if someone could fix it :$!
Try this
[spoil]
Code:
javascript:

var worldSpeed=1.75;
var resend={
	unit:'light',
	spy:0,
	minutes:150
};
var defaultBuildingLevel=20;

var script={
	id:'6A6C55B4-D459-4341-B81D-BF448104D376',
	name:'Mangina Farmer Script',
	version:1.00,
	minGameVersion:7.00,
	author:{
		name:'dalesmckay',
		email:'dalesmckay@gmail.com',
		url:'http://crosstrigger.com'
	},
	credit:'(Dedicated to <span style="color:blue;">Karmalot</span>)',
	runOnce:false
};

function fnInt(value){return parseInt(value||'0',10);}
function fnPrint(msg){$('body').append('<span>'+msg+'</span><br/>');}

function fnPrintVersion(){
	var authorURL=script.author.url?('<a href="'+script.author.url+'" target="_blank">'+script.author.name+'</a>'):script.author.name;
	
	fnPrint('');
	fnPrint('<span style="color:red;font-weight:bold;">Provide the following info when asking for help:</span><hr>');
	fnPrint('=========================');
	fnPrint(authorURL + '\'s ' + script.name + ': v' + script.version.toFixed(2) + (script.credit?('<br/>'+script.credit):''));
	fnPrint('=========================');
	/*fnPrint($.trim($('td.server_info').text().match(/\|\s*(.+)/)[1]));*/
	fnPrint('Account: '+win.game_data.player.name);
	fnPrint('Sitter : '+((fnInt(win.game_data.player.sitter_id)>0)?('yes - '+win.game_data.player.sitter_id):'no'));
	fnPrint('=========================');
	fnPrint('Version: '+win.game_data.version);
	fnPrint('World  : '+win.game_data.world);
	fnPrint('Screen : '+win.game_data.screen);
	fnPrint('Mode   : '+win.game_data.mode);
	fnPrint('URL    : '+win.location.href);
	fnPrint('Browser: '+navigator.userAgent);
	fnPrint('=========================');
	fnPrint('worldSpeed: '+worldSpeed);
	fnPrint('resend: '+JSON.stringify(resend));
	fnPrint('defaultBuildingLevel: '+defaultBuildingLevel);
	fnPrint('=========================');
	fnPrint('');
}

var win=(window.main||self),$=win.$;
fnPrintVersion();

if((win.game_data.screen=='place')&&!win.game_data.mode&&win.location.search.match(/dsmScript\=true/i)){
	var config={spear:0,sword:0,archer:0,axe:0,spy:1,light:0,marcher:0,heavy:0,ram:0,catapult:0,knight:0,snob:0};
	config.spy=(win.location.search.match(/spy\=(\d+)/i)||[0,0])[1];
	var unit=(win.location.search.match(/unit\=(\w+)/i)||[0,0])[1];
	var qty=(win.location.search.match(/qty\=(\d+)/i)||[0,0])[1];
	config[unit]=qty;

	$.each(config,function(i,e){
		$('input[name="'+i+'"]').val(Math.min(e,fnInt($('input[name="'+i+'"]').closest('tr').text().match(/\d+/))));
	});
}
else if((win.game_data.screen!='report')||!win.location.search.match(/view\=\d+/i)){
	var msg='This script must be run from a Report Detail Screen!';
	fnPrint(msg);
	alert(msg);
}
else{
	var buildingInfo={
		wood:{name:'Timber camp',level:defaultBuildingLevel},
		stone:{name:'Clay pit',level:defaultBuildingLevel},
		iron:{name:'Iron mine',level:defaultBuildingLevel}
	};

	var unitInfo={
		spear:{name:'Spear fighter',carry:25},
		sword:{name:'Swordsman',carry:15},
		axe:{name:'Axeman',carry:10},
		archer:{name:'Archer',carry:10},
		light:{name:'Light cavalry',carry:80},
		marcher:{name:'Mounted archer',carry:50},
		heavy:{name:'Heavy cavalry',carry:50}
	};

	function fnResourceProduction(lvl){return ((lvl==0)?5:Math.round(30*Math.pow(80,(lvl-1)/29)))*worldSpeed;}

	function fnExtractBuildings(){
		var buildings=undefined;
		var buildingSrc=$('#attack_spy tr:eq(1) td:first').html();
		if(buildingSrc){
			buildingSrc=buildingSrc.match(/\w+\s\w*\s*<b>\(\w+\s\d+\)/ig);
			if(buildingSrc){
				buildings={};
				$.each(buildingSrc,function(i,e){
					buildings[$.trim(e.match(/\w+\s*\w*\s*/i))]=fnInt(e.match(/\d+/));
				});
			}
		}
	
		return buildings;
	}

	var buildings=fnExtractBuildings();
	if(buildings){
		$.each(buildingInfo,function(i,e){
			buildingInfo[i].level=buildings[e.name];
		});
	}

	var hourlyResources=0;
	$.each(buildingInfo,function(i,e){
		hourlyResources+=fnResourceProduction(e.level);
	});

	fnPrint('Resources: '+hourlyResources*(resend.minutes/60));
	fnPrint('');

	$.each(unitInfo,function(i,e){
		unitInfo[i].qty=Math.round((hourlyResources*(resend.minutes/60))/e.carry);
		fnPrint('%%UNITID - (%%UNITDESC): %%QTY'.replace(/\%\%QTY/ig,unitInfo[i].qty).replace(/\%\%UNITID/ig,i).replace(/\%\%UNITDESC/ig,unitInfo[i].name));
	});

	var villageID=$('#attack_info_def td a:eq(0)').attr('href').match(/id\=(\d+)/i)[1];

	win.open(win.game_data.link_base_pure.replace(/screen\=\w*/ig,'screen=place&target='+villageID+'&dsmScript=true&spy='+resend.spy+'&unit='+resend.unit+'&qty='+unitInfo[resend.unit].qty));
}

void(0);
[/spoil]
 

DeletedUser

Guest
Try this
[spoil]
Code:
javascript:

var worldSpeed=1.75;
var resend={
	unit:'light',
	spy:0,
	minutes:150
};
var defaultBuildingLevel=20;

var script={
	id:'6A6C55B4-D459-4341-B81D-BF448104D376',
	name:'Mangina Farmer Script',
	version:1.00,
	minGameVersion:7.00,
	author:{
		name:'dalesmckay',
		email:'dalesmckay@gmail.com',
		url:'http://crosstrigger.com'
	},
	credit:'(Dedicated to <span style="color:blue;">Karmalot</span>)',
	runOnce:false
};

function fnInt(value){return parseInt(value||'0',10);}
function fnPrint(msg){$('body').append('<span>'+msg+'</span><br/>');}

function fnPrintVersion(){
	var authorURL=script.author.url?('<a href="'+script.author.url+'" target="_blank">'+script.author.name+'</a>'):script.author.name;
	
	fnPrint('');
	fnPrint('<span style="color:red;font-weight:bold;">Provide the following info when asking for help:</span><hr>');
	fnPrint('=========================');
	fnPrint(authorURL + '\'s ' + script.name + ': v' + script.version.toFixed(2) + (script.credit?('<br/>'+script.credit):''));
	fnPrint('=========================');
	/*fnPrint($.trim($('td.server_info').text().match(/\|\s*(.+)/)[1]));*/
	fnPrint('Account: '+win.game_data.player.name);
	fnPrint('Sitter : '+((fnInt(win.game_data.player.sitter_id)>0)?('yes - '+win.game_data.player.sitter_id):'no'));
	fnPrint('=========================');
	fnPrint('Version: '+win.game_data.version);
	fnPrint('World  : '+win.game_data.world);
	fnPrint('Screen : '+win.game_data.screen);
	fnPrint('Mode   : '+win.game_data.mode);
	fnPrint('URL    : '+win.location.href);
	fnPrint('Browser: '+navigator.userAgent);
	fnPrint('=========================');
	fnPrint('worldSpeed: '+worldSpeed);
	fnPrint('resend: '+JSON.stringify(resend));
	fnPrint('defaultBuildingLevel: '+defaultBuildingLevel);
	fnPrint('=========================');
	fnPrint('');
}

var win=(window.main||self),$=win.$;
fnPrintVersion();

if((win.game_data.screen=='place')&&!win.game_data.mode&&win.location.search.match(/dsmScript\=true/i)){
	var config={spear:0,sword:0,archer:0,axe:0,spy:1,light:0,marcher:0,heavy:0,ram:0,catapult:0,knight:0,snob:0};
	config.spy=(win.location.search.match(/spy\=(\d+)/i)||[0,0])[1];
	var unit=(win.location.search.match(/unit\=(\w+)/i)||[0,0])[1];
	var qty=(win.location.search.match(/qty\=(\d+)/i)||[0,0])[1];
	config[unit]=qty;

	$.each(config,function(i,e){
		$('input[name="'+i+'"]').val(Math.min(e,fnInt($('input[name="'+i+'"]').closest('tr').text().match(/\d+/))));
	});
}
else if((win.game_data.screen!='report')||!win.location.search.match(/view\=\d+/i)){
	var msg='This script must be run from a Report Detail Screen!';
	fnPrint(msg);
	alert(msg);
}
else{
	var buildingInfo={
		wood:{name:'Timber camp',level:defaultBuildingLevel},
		stone:{name:'Clay pit',level:defaultBuildingLevel},
		iron:{name:'Iron mine',level:defaultBuildingLevel}
	};

	var unitInfo={
		spear:{name:'Spear fighter',carry:25},
		sword:{name:'Swordsman',carry:15},
		axe:{name:'Axeman',carry:10},
		archer:{name:'Archer',carry:10},
		light:{name:'Light cavalry',carry:80},
		marcher:{name:'Mounted archer',carry:50},
		heavy:{name:'Heavy cavalry',carry:50}
	};

	function fnResourceProduction(lvl){return ((lvl==0)?5:Math.round(30*Math.pow(80,(lvl-1)/29)))*worldSpeed;}

	function fnExtractBuildings(){
		var buildings=undefined;
		var buildingSrc=$('#attack_spy tr:eq(1) td:first').html();
		if(buildingSrc){
			buildingSrc=buildingSrc.match(/\w+\s\w*\s*<b>\(\w+\s\d+\)/ig);
			if(buildingSrc){
				buildings={};
				$.each(buildingSrc,function(i,e){
					buildings[$.trim(e.match(/\w+\s*\w*\s*/i))]=fnInt(e.match(/\d+/));
				});
			}
		}
	
		return buildings;
	}

	var buildings=fnExtractBuildings();
	if(buildings){
		$.each(buildingInfo,function(i,e){
			buildingInfo[i].level=buildings[e.name];
		});
	}

	var hourlyResources=0;
	$.each(buildingInfo,function(i,e){
		hourlyResources+=fnResourceProduction(e.level);
	});

	fnPrint('Resources: '+hourlyResources*(resend.minutes/60));
	fnPrint('');

	$.each(unitInfo,function(i,e){
		unitInfo[i].qty=Math.round((hourlyResources*(resend.minutes/60))/e.carry);
		fnPrint('%%UNITID - (%%UNITDESC): %%QTY'.replace(/\%\%QTY/ig,unitInfo[i].qty).replace(/\%\%UNITID/ig,i).replace(/\%\%UNITDESC/ig,unitInfo[i].name));
	});

	var villageID=$('#attack_info_def td a:eq(0)').attr('href').match(/id\=(\d+)/i)[1];

	win.open(win.game_data.link_base_pure.replace(/screen\=\w*/ig,'screen=place&target='+villageID+'&dsmScript=true&spy='+resend.spy+'&unit='+resend.unit+'&qty='+unitInfo[resend.unit].qty));
}

void(0);
[/spoil]

Thanks a lot man, it works perfectly now...

a quick question :$!

this script it opens a new tab, if its pretty difficult to edit it, so it does everything in same tab? (just wondering as it would be easier to use xD)
 
Top