Request Bulk and cascade fix request

DeletedUser

Guest
in the brazilian server it is not detecting the building levels .... anyone could help me one that please?
Creating script entry in doc head...
Loading script...
Loading script...
Loading script...
Loading script...
Loaded
Cascade version: 1.1.06 Farm Assitant Update by File Not Found
Browser: Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.14
Url: http://br48.tribalwars.com.br/game.php?village=49895&mode=all&view=15311697&screen=report
Language: 'Level','Attacker:','Defender:','commands','Give commands'
Buildings: 'Village Headquarters','Barracks','Stable','Workshop','Academy','Smithy','Rally point','Statue','Market','Farm','Wall'
Loaded
Cascade version: 1.1.06 Farm Assitant Update by File Not Found
Browser: Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.14
Url: http://br48.tribalwars.com.br/game.php?village=49895&mode=all&view=15311697&screen=report
Language: 'Level','Attacker:','Defender:','commands','Give commands'
Buildings: 'Village Headquarters','Barracks','Stable','Workshop','Academy','Smithy','Rally point','Statue','Market','Farm','Wall'
Original Script: Fluffy88
TW-V6.3 Fix: File not Found
 

DeletedUser

Guest
can you paste your script ?

Im curious as to if you amended the names of the building which at a guess I would say are different on the brazillian server

your post above suggests its using english names

Buildings: 'Village Headquarters','Barracks','Stable','Workshop','Academy','Smithy','Rally point','Statue','Market','Farm','Wall'


Apologies if the brazilian server uses the english names
 

DeletedUser

Guest
I am using the same everyone is using...

It should work tough as I have in the past asked to include BR servers as well.

Code:
javascript: var custom_order = false;
var arrCustomOrder = ["Wall", "Farm", "Village Headquarters", "Smithy", "Rally point", "Barracks", "Stable", "Workshop", "Market", "Academy", "Statue"];

function e() {
    var n = 'barb_pruner',
        s = 'http://taktimer.net/scripts/cascadeFix.js?' + Math.round(Math.random() * 143567),
        a = (window.frames.length > 0) ? window.main : window;

    function c(m) {
        a.document.body.appendChild(a.document.createTextNode(m));
        a.document.body.appendChild(a.document.createElement('br'));
    }
    if (a.document.getElementById(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.getElementsByTagName("head")[0].appendChild(A);
        setTimeout(e, 250);
        return;
    }
    if (typeof (a.run) == 'undefined') {
        c("Loading script...");
        setTimeout(e, 200);
        return;
    }
    c("Loaded");
    a.run(false, (['spy', 0], ['axe', 0], ['light', 0]), 1);
}
e();


You can see here the brazilian building names and its variations...

Code:
deactivationSwitch = 0;
function run(sameVillage, type, catLevel)
   {var doc = (window.frames.length > 0) ? window.main.document: document;
    debug("Cascade version: 1.1.05");
    debug("Browser: " + navigator.userAgent);
    debug("Url: " + window.location);
    var arrLanguage =['Level', 'Attacker:', 'Defender:', 'commands', 'Give commands'];
    var arrBuildings =["Village Headquarters", "Barracks", "Stable", "Workshop", "Academy", "Smithy", "Rally point", 
      "Statue", "Market", "Farm", "Wall"];
    if(typeof custom_order == "undefined"){custom_order = false;}
    if (custom_order){arrBuildings = arrCustomOrder;}
    try 
       {var arrLang = location.hostname.split('.');
        var strLang = arrLang.pop();
        var strLang2 = arrLang.pop();
        var strLang3;
        if (arrLang.length > 1){strLang3 = arrLang[1]; arrLang = arrLang[0]; strLang = strLang2; strLang2 = strLang3;}
        if (strLang == 'se' || strLang == 'no')
           {var arrLanguage =['Nivå', 'By:', 'Försvarare:', 'Anfallare:', 'kommando', 'Ge kommando'];
            var arrBuildings =["Högkvarter", "Barack", "Stall", "Verkstad", "Akademi", "Smedja", "Samlingsplats", "Staty", "Marknad", "Farm", "Mur"];
            var arrLanguage =['Niv.', 'By:', 'F.rsvarare:', 'Anfallare:', 'kommando', 'Ge kommando'];
            var arrBuildings =["H.gkvarter", "Barack", "Stall", "Verkstad", "Akademi", "Smedja", "Samlingsplats", "Staty", 
              "Marknad", "Farm", "Mur"];
           }
        else if (strLang == 'hr')
           {var arrLanguage =['Razina', 'Napadaci:', 'Branitelj:', 'Naredbe', 'Izdaj naredbe'];
            var arrBuildings =["Seosko sjedište", "Vojarna", "Štala", "Workshop", "Radionica", "Kovacnica", 
              "Okupljalište", "Spomenik", "Tržnica", "Farma", "Zid"];
            var arrBuildings =["Seosko sjedi.te", "Vojarna",".tala", "Workshop", "Radionica", "Kovacnica", "Okupljalište", 
              "Spomenik", "Tr.nica", "Farma", "Zid"];
           }
        else if (strLang == 'dk')
           {var arrLanguage =['Trin', 'Angriber:', 'Forsvarende:', 'kommandoer', 'Giv kommandoer'];
            var arrBuildings =["Hovedbygning", "Kaserne", "Stald", "Værksted", "Akademi", "Smed", "Forsamlingsplads", 
              "Statue", "Markedsplads", "Farm", "Mur"];
           }[COLOR=#ff0000]
        else if (strLang == 'br')
           {var arrLanguage =['Nível', 'Atacante:', 'Defensor:', 'ordens', 'Distribuir ordens'];
            var arrBuildings =["Edifício principal", "Quartel", "Estábulo", "Oficina", "Academia", "Ferreiro", 
              "Praça de Reunião", "Estátua", "Mercado", "Fazenda", "Muralha"];
            var arrLanguage =['N.vel', 'Atacante:', 'Defensor:', 'ordens', 'Distribuir ordens'];
            var arrBuildings =["Edif.cio principal", "Quartel", "Est.bulo", "Oficina", "Academia", "Ferreiro", 
              "Pra.a de Reuni.o", "Est.tua", "Mercado", "Fazenda", "Muralha"];[/COLOR]
           }
       }
   catch (objError){}
    debug("Language: '" + arrLanguage.join("','") + "'");
    debug("Buildings: '" + arrBuildings.join("','") + "'");
   
    function report()
       {theCookieStuff = "";
        for (i = 0;i < arrBuildings.length;i++)
           {var levels = buildingLevel(arrBuildings[i]);
            if (levels != 0) theCookieStuff += levels +"," + arrBuildings[i] + "|";
           }
       
        function getLink(a)
           {var coordinate = $("th:contains('" + a + "')")[0].parentNode.parentNode.rows[1].cells[1];
            return coordinate;
           }
        if (theCookieStuff == '')
           {alert("No building levels found.");
           }
        else 
           {document.cookie = "Building_Levels=" + theCookieStuff + "!" + getLink(arrLanguage[2]).innerHTML.match(/\d+\|\d+/);
            debug("Cookie created: " + theCookieStuff);
            if (sameVillage) villageId = getLink(arrLanguage[1]).getElementsByTagName("a")[0].href.match(/id=(\d+)/)[1];
            else villageId = getLink(arrLanguage[1]).getElementsByTagName("a")[0].href.match(/village=(\d+)/)[1];
            var t = (doc.URL.match( /&t=\d+/)) ? doc.URL.match( /&t=\d+/): '';
            location.search = "village=" + villageId + "&screen=place" + t;
           }
       }
   
    function rallyPoint()
       {var demolishArray;
        if (catLevel == 1) demolishArray = new Array(0, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 15, 
          16, 17, 19, 20);
        if (catLevel == 2) demolishArray = new Array(0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 9, 9, 10, 11, 
          12, 13, 14, 15, 16);
        if (catLevel == 3) demolishArray = new Array(0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 
          10, 11, 12, 13, 14, 15);
        var catsAtHome = doc.forms[0].catapult.parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/);
        if (catsAtHome == 0)
           {alert("You have 0 catapults here\nMove on to another village to continue.");
            return;
           }
        var buildingLevels = getCookie("Building_Levels");
        debug("Cookie read: " + buildingLevels);
        var theTarget = buildingLevels[0].split(",");
        var theCurrentTarget = theTarget[0] - 1 +"," + theTarget[1] + "|";
        if (parseInt(theCurrentTarget, 10) == 0)
           {theCurrentTarget = "";
           }
        var currentTarget = theTarget[1];
        var theLevel = parseInt(buildingLevels.shift(), 10);
        var requiredCats = demolishArray[theLevel];
        debug("Target building/Cats needed: " + currentTarget + "/" + requiredCats);
        var coord = doc.cookie.match('(^|;) ?Building_Levels=([^;]*)(;|$)')[2].split( "!")[1].match(/\d+\|\d+/);
        debug("Target village: " + coord);
        document.cookie = "Building_Levels=" + theCurrentTarget + buildingLevels.join( "|") + "!" + coord[0] +"," + 
          currentTarget;
        if ((currentTarget == arrBuildings[0] || currentTarget == arrBuildings[9]) && theLevel == 1) rallyPoint();
        else 
           {if (requiredCats > catsAtHome)
               {alert(requiredCats + " Catapults are needed to downgrade the " + currentTarget +".\nYou have " + 
                  catsAtHome);
                requiredCats = catsAtHome;
               }
            if ( ! currentTarget)
               {alert("All buildings are now demolished.");
                location.search = doc.URL.match(/village=\d+/) + "&screen=report";
               }
            else 
               {               debug("Append :" + currentTarget + " - level " + theLevel +": to '" + arrLanguage[3] + "'");
                $("h3:contains('" + arrLanguage[3] + "')")[0].innerHTML = arrLanguage[4] + 
                  "<br /><div style=\"color:red; font-size:large\">" + currentTarget + " - level " + theLevel + "</div>"; /*alert(currentTarget);*/
                debug("Troops entered: " + type);
                if (type[0][0].length > 1)
                   {for (var k = 0;k < type.length;k++)
                       {var curUnit = doc.units[type[k][0]];
                        var atHome = unescape(curUnit.parentNode.getElementsByTagName('a')[1].href).match(/\d+/g);
                        var troopAmount = (atHome >= type[k][1]) ? type[k][1]: atHome;
                        curUnit.value = troopAmount;
                       }
                   }
                else doc.units[type[0]].value = type[1];
                doc.forms[0].catapult.value = requiredCats;
                doc.forms[0].catapult.focus();
                doc.forms[0].x.value = coord[0].split( "|")[0];
                doc.forms[0].y.value = coord[0].split( "|")[1]; /*alert(doc.cookie.match ( '(^|;) ?Building_Levels=([^;]*)(;|$)' )[2]);*/
               }
           }
       }
   
    function confirmationScreen()
       {var cookieInfo = doc.cookie.match('(^|;) ?Building_Levels=([^;]*)(;|$)')[2];
        var target = cookieInfo.split( "!")[1].split(",")[1];
        debug("Cookie: " + target);
        select = doc.getElementsByTagName("select")[0];
        option = doc.getElementsByTagName("option");
        for (x = 0;x < option.length;x++)
           {if (select.options[x].innerHTML.match(target, "i")) select.options[x].selected = true;
            else select.options[x].selected = false;
            debug("Building/selected: " + select.options[x].innerHTML + "/" + select.options[x].selected);
           }
        document.cookie = "Building_Levels=" + cookieInfo.replace("," + target + "$", "");
       }
    var i_cell = ' ';
   
    function buildingLevel(build)
       {problematicRow = $("th:contains('Possible resources:')")[0];
        if ((problematicRow != "undefined") && (deactivationSwitch == 0) && (problematicRow != "null") && (problematicRow != ""))
           {deactivationSwitch = deactivationSwitch +1;
            problematicRow = problematicRow.parentNode;
            problematicRow.setAttribute("id","problemRow");
            $("#problemRow")[0].parentNode.removeChild(document.getElementById("problemRow"));
           }i_cell = doc.getElementById("attack_spy").getElementsByTagName("td")[1];
        strBuildings = i_cell.innerHTML;
        var newRegExp = new RegExp(build +".*?\\(" + arrLanguage[0] +".*?(\\d+)", "i");
        var level = strBuildings.match(newRegExp);
        if (level) return level[1];
        else return 0;
       }
   
    function debug(m)
       {doc.body.appendChild(doc.createTextNode(m));
        doc.body.appendChild(doc.createElement('br'));
       }
   
    function getCookie(name)
       {       var results = doc.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
        results = unescape(results[2]);
        results = results.split( "!");
        return results[0].split( "|");
       }
   /*fine from here*/
    if (doc.URL.match(/report/)) report();
    else if (doc.URL.match(/try=confirm/)) confirmationScreen();
    else if (getCookie("Building_Levels") && doc.URL.match(/place/)) rallyPoint();
    else location.search = doc.URL.match(/village=\d+/) + "&screen=report";
    debug("Original Script: Fluffy88");
    debug("TW-V6.3 Fix: File not Found ");
   }
 

DeletedUser

Guest
Hmm I see what you mean

unfortunately without access to an account on the brazilian server Im unable to fault find for you

If you check the opera error console does it give any errors ((ctrl+Shift+o) the letter o not the number 0)?
 

DeletedUser

Guest
OK Ive had an offer of borrowing someones br account and taken a look

I believe there an issue with the hosted code so will describe as best I can what I found.

I believe theres an issue with the script detecting that its on the brazilian server and I suspect this is down to the unusual fact the the brazilian server has 4 dots in its host name an example of the host name is

http://br48.tribalwars.com.br/

when the script hosted under http://taktimer.net/scripts/cascadeFix.js

finishes executing the lines

try
{var arrLang = location.hostname.split('.');
var strLang = arrLang.pop();
var strLang2 = arrLang.pop();
var strLang3;


the variable strLang is correctly set to br

however when this part of the code is run

if (arrLang.length > 1){strLang3 = arrLang[1]; arrLang = arrLang[0]; strLang = strLang2; strLang2 = strLang3;}

strLang becomes set to com and as such when susequent checks are made the server origins cannot be determined so default to english names which when not found on the report causes the script to fail

The code is hosted by FNF so I'll let her know my findings and hopefully she can get it sorted



In teh mean time eraziel it may be worth amending these 2 lines

javascript: var custom_order = false;
var arrCustomOrder = ["Wall", "Farm", "Village Headquarters", "Smithy", "Rally point", "Barracks", "Stable", "Workshop", "Market", "Academy", "Statue"];

so custom order is true and then replace the building names with the bazillian equivalents I havent tried it myself but I think it should work while you wait for FNF to update the hosted code


Regards

Lonestar1
 

DeletedUser

Guest
OK Ive had an offer of borrowing someones br account and taken a look

I believe there an issue with the hosted code so will describe as best I can what I found.

I believe theres an issue with the script detecting that its on the brazilian server and I suspect this is down to the unusual fact the the brazilian server has 4 dots in its host name an example of the host name is

http://br48.tribalwars.com.br/

when the script hosted under http://taktimer.net/scripts/cascadeFix.js

finishes executing the lines

try
{var arrLang = location.hostname.split('.');
var strLang = arrLang.pop();
var strLang2 = arrLang.pop();
var strLang3;


the variable strLang is correctly set to br

however when this part of the code is run

if (arrLang.length > 1){strLang3 = arrLang[1]; arrLang = arrLang[0]; strLang = strLang2; strLang2 = strLang3;}

strLang becomes set to com and as such when susequent checks are made the server origins cannot be determined so default to english names which when not found on the report causes the script to fail

The code is hosted by FNF so I'll let her know my findings and hopefully she can get it sorted



In teh mean time eraziel it may be worth amending these 2 lines

javascript: var custom_order = false;
var arrCustomOrder = ["Wall", "Farm", "Village Headquarters", "Smithy", "Rally point", "Barracks", "Stable", "Workshop", "Market", "Academy", "Statue"];

so custom order is true and then replace the building names with the bazillian equivalents I havent tried it myself but I think it should work while you wait for FNF to update the hosted code


Regards

Lonestar1

Amending it and try to run it as custom order still not worked... it was my first instinct but still it will show something like this!

Creating script entry in doc head...
Loading script...
Loading script...
Loading script...
Loading script...
Loaded
Cascade version: 1.1.06 Farm Assitant Update by File Not Found
Browser: Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.14
Url: http://br48.tribalwars.com.br/game.p...&screen=report
Language: 'Level','Attacker:','Defender:','commands','Give commands'
Buildings: 'Village Headquarters','Barracks','Stable','Workshop','Acad emy','Smithy','Rally point','Statue','Market','Farm','Wall'
Loaded
Cascade version: 1.1.06 Farm Assitant Update by File Not Found
Browser: Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.14
Url: http://br48.tribalwars.com.br/game.p...&screen=report
Language: 'Level','Attacker:','Defender:','commands','Give commands'
Buildings: 'Village Headquarters','Barracks','Stable','Workshop','Acad emy','Smithy','Rally point','Statue','Market','Farm','Wall'
Original Script: Fluffy88
TW-V6.3 Fix: File not Found

But with the brazilian names for it and still not building found message spears!
 

File Not Found

Guest
Please try this...

[spoil]
Code:
javascript: deactivationSwitch = 0;
problematicRow = $("th:contains('Recursos descobertos')")[0];

function run(sameVillage, type, catLevel)
   {var doc = (window.frames.length > 0) ? window.main.document: document;
    debug("Cascade version: 1.1.05");
    debug("Browser: " + navigator.userAgent);
    debug("Url: " + window.location);
    var arrLanguage =['Level', 'Attacker:', 'Defender:', 'commands', 'Give commands'];
    var arrBuildings =["Village Headquarters", "Barracks", "Stable", "Workshop", "Academy", "Smithy", "Rally point", "Statue", "Market", "Farm", "Wall"];
    if (typeof custom_order == "undefined")
       {custom_order = false;
       }
    if (custom_order)
       {arrBuildings = arrCustomOrder;
       }
    try 
       {var strLang = window.location.toString().split( "//")[1].split(/\d+/)[0];
        if (strLang == 'se' || strLang == 'no')
           {var arrLanguage =['Nivå', 'By:', 'Försvarare:', 'Anfallare:', 'kommando', 'Ge kommando'];
            var arrBuildings =["Högkvarter", "Barack", "Stall", "Verkstad", "Akademi", "Smedja", "Samlingsplats", "Staty", 
              "Marknad", "Farm", "Mur"];
            var arrLanguage =['Niv.', 'By:', 'F.rsvarare:', 'Anfallare:', 'kommando', 'Ge kommando'];
            var arrBuildings =["H.gkvarter", "Barack", "Stall", "Verkstad", "Akademi", "Smedja", "Samlingsplats", "Staty", "Marknad", "Farm", "Mur"];
           }
        else if (strLang == 'hr')
           {var arrLanguage =['Razina', 'Napadaci:', 'Branitelj:', 'Naredbe', 'Izdaj naredbe'];
            var arrBuildings =["Seosko sjedište", "Vojarna", "Štala", "Workshop", "Radionica", "Kovacnica", 
              "Okupljalište", "Spomenik", "Tržnica", "Farma", "Zid"];
            var arrBuildings =["Seosko sjedi.te", "Vojarna",".tala", "Workshop", "Radionica", "Kovacnica", "Okupljalište", "Spomenik", "Tr.nica", "Farma", "Zid"];
           }
        else if (strLang == 'dk')
           {var arrLanguage =['Trin', 'Angriber:', 'Forsvarende:', 'kommandoer', 'Giv kommandoer'];
            var arrBuildings =["Hovedbygning", "Kaserne", "Stald", "Værksted", "Akademi", "Smed", "Forsamlingsplads", "Statue", "Markedsplads", "Farm", "Mur"];
           }
        else if (strLang == 'br')
           {var arrLanguage =['Nível', 'Atacante:', 'Defensor:', 'ordens', 'Distribuir ordens'];
            var arrBuildings =["Edifício principal", "Quartel", "Estábulo", "Oficina", "Academia", "Ferreiro", 
              "Praça de Reunião", "Estátua", "Mercado", "Fazenda", "Muralha"];
            var arrLanguage =['N.vel', 'Atacante:', 'Defensor:', 'ordens', 'Distribuir ordens'];
            var arrBuildings =["Edif.cio principal", "Quartel", "Est.bulo", "Oficina", "Academia", "Ferreiro", 
              "Pra.a de Reuni.o", "Est.tua", "Mercado", "Fazenda", "Muralha"];
           }
       }
   catch (objError){}
    debug("Language: '" + arrLanguage.join("','") + "'");
    debug("Buildings: '" + arrBuildings.join("','") + "'");
   
    function report()
       {theCookieStuff = "";
        for (i = 0;i < arrBuildings.length;i++)
           {var levels = buildingLevel(arrBuildings[i]);
            if (levels != 0) theCookieStuff += levels +"," + arrBuildings[i] + "|";
           }
       
        function getLink(a)
           {var coordinate = $("th:contains('" + a + "')")[0].parentNode.parentNode.rows[1].cells[1];
            return coordinate;
           }
        if (theCookieStuff == '')
           {           alert("No building levels found.");
           }
        else 
           {           document.cookie = "Building_Levels=" + theCookieStuff + "!" + getLink(arrLanguage[2]).innerHTML.match(/\d+\|\d+/);
            debug("Cookie created: " + theCookieStuff);
            if (sameVillage) villageId = getLink(arrLanguage[1]).getElementsByTagName("a")[0].href.match(/id=(\d+)/)[1];
            else villageId = getLink(arrLanguage[1]).getElementsByTagName("a")[0].href.match(/village=(\d+)/)[1];
            var t = (doc.URL.match( /&t=\d+/)) ? doc.URL.match( /&t=\d+/): '';
            location.search = "village=" + villageId + "&screen=place" + t;
           }
       }
   
    function rallyPoint()
       {var demolishArray;
        if (catLevel == 1)        demolishArray = new Array(0, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 7, 8, 8, 
          9, 10, 11, 11, 12, 13, 15, 16, 17, 19, 20);
        if (catLevel == 2) demolishArray = new Array(0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 
          9, 9, 10, 11, 12, 13, 14, 15, 16);
        if (catLevel == 3) demolishArray = new Array(0, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 7, 
          8, 8, 9, 10, 11, 12, 13, 14, 15);
        var catsAtHome = doc.forms[0].catapult.parentNode.getElementsByTagName("a")[1].innerHTML.match(/\d+/);
        if (catsAtHome == 0)
           {alert("You have 0 catapults here\nMove on to another village to continue.");
            return;
           }
        var buildingLevels = getCookie("Building_Levels");
        debug("Cookie read: " + buildingLevels);
        var theTarget = buildingLevels[0].split(",");
        var theCurrentTarget = theTarget[0] - 1 +"," + theTarget[1] + "|";
        if (parseInt(theCurrentTarget, 10) == 0)
           {theCurrentTarget = "";
           }
        var currentTarget = theTarget[1];
        var theLevel = parseInt(buildingLevels.shift(), 10);
        var requiredCats = demolishArray[theLevel];
        debug("Target building/Cats needed: " + currentTarget + "/" + requiredCats);
        var coord = doc.cookie.match('(^|;) ?Building_Levels=([^;]*)(;|$)')[2].split( "!")[1].match(/\d+\|\d+/);
        debug("Target village: " + coord);
        document.cookie = "Building_Levels=" + theCurrentTarget + buildingLevels.join( "|") + "!" + coord[0] +"," + 
          currentTarget;
        if ((currentTarget == arrBuildings[0] || currentTarget == arrBuildings[9]) && theLevel == 1) rallyPoint();
        else 
           {if (requiredCats > catsAtHome)
               {alert(requiredCats + " Catapults are needed to downgrade the " + currentTarget +".\nYou have " + 
                  catsAtHome);
                requiredCats = catsAtHome;
               }
            if ( ! currentTarget)
               {alert("All buildings are now demolished.");
                location.search = doc.URL.match(/village=\d+/) + "&screen=report";
               }
            else 
               {debug("Append :" + currentTarget + " - level " + theLevel +": to '" + arrLanguage[3] + "'");
                $("h3:contains('" + arrLanguage[3] + "')")[0].innerHTML = arrLanguage[4] + "<br /><div style=\"color:red; font-size:large\">" + 
                  currentTarget + " - level " + theLevel + "</div>"; /*alert(currentTarget);*/
                debug("Troops entered: " + type);
                if (type[0][0].length > 1)
                   {for (var k = 0;k < type.length;k++)
                       {var curUnit = doc.units[type[k][0]];
                        var atHome = unescape(curUnit.parentNode.getElementsByTagName('a')[1].href).match(/\d+/g);
                        var troopAmount = (atHome >= type[k][1]) ? type[k][1]: atHome;
                        curUnit.value = troopAmount;
                       }
                   }
                else doc.units[type[0]].value = type[1];
                doc.forms[0].catapult.value = requiredCats;
                doc.forms[0].catapult.focus();
                doc.forms[0].x.value = coord[0].split( "|")[0];
                doc.forms[0].y.value = coord[0].split( "|")[1]; /*alert(doc.cookie.match ( '(^|;) ?Building_Levels=([^;]*)(;|$)' )[2]);*/
               }
           }
       }
   
    function confirmationScreen()
       {var cookieInfo = doc.cookie.match('(^|;) ?Building_Levels=([^;]*)(;|$)')[2];
        var target = cookieInfo.split( "!")[1].split(",")[1];
        debug("Cookie: " + target);
        select = doc.getElementsByTagName("select")[0];
        option = doc.getElementsByTagName("option");
        for (x = 0;x < option.length;x++)
           {if (select.options[x].innerHTML.match(target, "i")) select.options[x].selected = true;
            else select.options[x].selected = false;
            debug("Building/selected: " + select.options[x].innerHTML + "/" + select.options[x].selected);
           }
        document.cookie = "Building_Levels=" + cookieInfo.replace("," + target + "$", "");
       }
    var i_cell = ' ';
   
    function buildingLevel(build)
       {if ((problematicRow != "undefined") && (deactivationSwitch == 0) && (problematicRow != "null") && (problematicRow != 
          ""))
           {deactivationSwitch = deactivationSwitch + 1;
            problematicRow = problematicRow.parentNode;
            problematicRow.setAttribute("id", "problemRow");
            $("#problemRow")[0].parentNode.removeChild(document.getElementById("problemRow"));
           }
        i_cell = doc.getElementById("attack_spy").getElementsByTagName("td")[0];
        strBuildings = i_cell.innerHTML;
        var newRegExp = new RegExp(build +".*?\\(" + arrLanguage[0] +".*?(\\d+)", "i");
        var level = strBuildings.match(newRegExp);
        if (level) return level[1];
        else return 0;
       }
   
    function debug(m)
       {doc.body.appendChild(doc.createTextNode(m));
        doc.body.appendChild(doc.createElement('br'));
       }
   
    function getCookie(name)
       {var results = doc.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
        results = unescape(results[2]);
        results = results.split( "!");
        return results[0].split( "|");
       }/*fine from here*/
    if (doc.URL.match(/report/)) report();
    else if (doc.URL.match(/try=confirm/)) confirmationScreen();
    else if (getCookie("Building_Levels") && doc.URL.match(/place/)) rallyPoint();
    else location.search = doc.URL.match(/village=\d+/) + "&screen=report";
    debug("Original Script: Fluffy88");
    debug("TW-V6.3 Fix: File not Found ");
   }
[/spoil]
 

DeletedUser

Guest
it does dectect the language as brazilian portuguese but still not finding any building levels!
 

DeletedUser

Guest
does this happen with just walls or other buildings as well, eg smithy ?
 

DeletedUser

Guest
Thanks for the reply chief.

I rearranged the order so it looks like this:

var arrCustomOrder =["Rally point", "Statue", "Wall", "Farm", "Village Headquarters", "Smithy", "Barracks", "Stable", "Workshop",
"Market", "Academy"];

and it seems to be skipping rally point and statue as they're level 1 buildings :S

Incidently, it's also skipping farm which was at lv10 in this particular example (wall was already at lv0)
 

DeletedUser

Guest
Mmmm, Wasn't working, so I debugged it, getting this error on both these scripts
[spoil]
HyHtWpNgCF5PgGbK3VAJ.png
[/spoil]

I'm using the Scripts from http://forum.tribalwars.net/showthr...-fix-request&p=6661569&viewfull=1#post6661569

Steps taken:
- Go to Village with Cats, etc
- Go to Reports, select a report
- Run script, get taken to Rally Point
- Run Script nothing happens
- Insert BreakPoint, Run script again, get that error

:| It doesn't like it...or I'm doing something wrong?

Edit: tried the newer ones, same issue ¬¬
 
Last edited by a moderator:

DeletedUser

Guest
Please post the script your actually using using code tags
....Not to sound rude, but how much of my post did you read?

Well here you go:
Barb Pruner (lots of little waves) (More efficient troop wise, but more commands to send) (Cat cascade)
[spoil]
Code:
javascript: var custom_order = false;
var arrCustomOrder =["Wall", "Farm", "Village Headquarters", "Smithy", "Rally point", "Barracks", "Stable", "Workshop", 
  "Market", "Academy", "Statue"];

function e()
   {var n = 'barb_pruner', s = 'http://taktimer.net/scripts/cascadeFix.js?' + Math.round(Math.random() * 
      143567), a = (window.frames.length > 0) ? window.main: window;
   
    function c(m)
       {a.document.body.appendChild(a.document.createTextNode(m));
        a.document.body.appendChild(a.document.createElement('br'));
       }
    if (a.document.getElementById(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.getElementsByTagName("head")[0].appendChild(A);
        setTimeout(e, 250);
        return;
       }
    if (typeof (a.run) == 'undefined')
       {c("Loading script...");
        setTimeout(e, 200);
        return;
       }
    c("Loaded");
    a.run(false, (['spy', 1],['axe', 50],['light', 50]), 1);
   }
e();
[/spoil]




Farm SHAPER (single large waves) (Less commands to launch, but significantly more troops required) (not cat cascade)
[spoil]
Code:
javascript: var custom_order = false;
var arrCustomOrder =["Wall", "Farm", "Village Headquarters", "Smithy", "Rally point", "Barracks", "Stable", "Workshop", 
  "Market", "Academy", "Statue"];

function e()
   {var n = 'farm_shaper', s = 'http://taktimer.net/scripts/shaperFix.js?' + Math.round(Math.random() * 
      143567), a = (window.frames.length > 0) ? window.main: window;
   
    function c(m)
       {a.document.body.appendChild(a.document.createTextNode(m));
        a.document.body.appendChild(a.document.createElement('br'));
       }
    if (a.document.getElementById(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.getElementsByTagName("head")[0].appendChild(A);
        setTimeout(e, 250);
        return;
       }
    if (typeof (a.run) == 'undefined')
       {c("Loading script...");
        setTimeout(e, 200);
        return;
       }
    c("Loaded");
    a.run(false, (['spy', 1],['axe', 50],['light', 50]), 1);
   }
e();
[/spoil]

Additional Info:
World - W67
Premium - Yes
Farm Assistant - Yes

As I said before, the issue is here:
[spoil]
HyHtWpNgCF5PgGbK3VAJ.png
[/spoil]
Which is this link in Farm Shaper: http://taktimer.net/scripts/shaperFix.js?
Which is this link in Barb Pruner: http://taktimer.net/scripts/cascadeFix.js?

~Kenz~
 
Last edited by a moderator:

DeletedUser

Guest
*Sigh*

To be clear Im not going to debug the 40 odd different scripts listed in this thread

Pick ONE put it on your quickbar make sure the error still occurs then copy your script from your quickbar and paste it here in code tags

by doing that I can help you

For all I know you've not even copied the original script properly to your quickbar

No offence meant my friend its just Ive spent hours in the past debugging code only to find the player concerned had just copied the code of the forum and hadn't noticed they'd missed out the last half of the script when they copied it to the quickbar (or bookmark if thats how you roll)

While were at it what browser and version are you using ?
 

DeletedUser

Guest
[spoil]*Sigh*

To be clear Im not going to debug the 40 odd different scripts listed in this thread

Pick ONE put it on your quickbar make sure the error still occurs then copy your script from your quickbar and paste it here in code tags

by doing that I can help you

For all I know you've not even copied the original script properly to your quickbar

No offence meant my friend its just Ive spent hours in the past debugging code only to find the player concerned had just copied the code of the forum and hadn't noticed they'd missed out the last half of the script when they copied it to the quickbar (or bookmark if thats how you roll)

While were at it what browser and version are you using ?[/spoil]

I can understand that, just came off a bit rude and looked as if you hadn't bothered reading what I had written, is all.

[spoil]
Code:
javascript: var custom_order = false;var arrCustomOrder =["Wall", "Farm", "Village Headquarters", "Smithy", "Rally point", "Barracks", "Stable", "Workshop", 
  "Market", "Academy", "Statue"];


function e()
   {var n = 'barb_pruner', s = 'http://taktimer.net/scripts/cascadeFix.js?' + Math.round(Math.random() * 
      143567), a = (window.frames.length > 0) ? window.main: window;
   
    function c(m)
       {a.document.body.appendChild(a.document.createTextNode(m));
        a.document.body.appendChild(a.document.createElement('br'));
       }
    if (a.document.getElementById(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.getElementsByTagName("head")[0].appendChild(A);
        setTimeout(e, 250);
        return;
       }
    if (typeof (a.run) == 'undefined')
       {c("Loading script...");
        setTimeout(e, 200);
        return;
       }
    c("Loaded");
    a.run(false, (['spy', 1],['axe', 50],['light', 50]), 1);
   }
e();
[/spoil]

Picture to show it in the quick bar:
[spoil]
DXyNtyxpHoWC-TBRCJYm.png
[/spoil]

I usually just use Chrome, tried it on my other browsers too, same issue.

Browser: Chrome Version 26.0.1410.64 m
Browser: Firefox Version 20.0.1
Browser: Opera Version 12.15

~Kenz~
 

DeletedUser

Guest
I just tried it and works fine on latest opera(12.15) and chrome 27.0.1453.94 (Official Build201630) m

do you have FA active or troop templates on rally point ?
 
Last edited by a moderator:

DeletedUser

Guest
Yep, Always got FA :), No Troop Templates...would that be why it doesn't work?
[spoil]
DatYWj-L0Oc432D28AVx.png
[/spoil]

Yeah, That's what I just don't understand about it :/

It's always this error in the hosted Script, Hover over it and it's 'undefined' ><!

[spoil]
E3wH5RsKe2XeTdJ3oI_7.png
[/spoil]

Edit: Maybe I'm not using it right? :|

Go to village with cats -> Go to a Report -> Use script (which does stuff and goes to Rally Point) -> use it again to fill in troops, then press okay -> use it again to choose the building level
?

Edit 2: Tried a step further, entered the barbs coordinates, put some cats and axe in there, pressed okay.
Pressed the script when I was on the confirm attack screen, got this:
[spoil]
q0lzUzPqJWUUAA80D0na.png
[/spoil]
 
Last edited by a moderator:
Top