All Broken Scripts

Asylum Escapee

Guest
I've tinkered with this a bit, but without access to the hosted part of the script its proving rather difficult to nail down.
if you can access the hosted part, one problem I can think of is that, in the custom load order part, the calling bit of the script uses "headquarters", while the hosted bit used "village headquarters". I recall TW changing which one you need to use some time ago but I don't recall which one is correct.

I am going to have to put this aside due to midterms for a week or so, but perhaps someone with the hosting capability can try this and see if this trivial bug is the only issue with the script, it is definitely possible that there are other issues.
 

Justifi3d

Guest
Yea I've the unhosted version and I changed along with the last update and it works fine...

Remind me on W75 Dave and I'll send it to you on Work computer atm
 

twenty-five

Guest
I've tinkered with this a bit, but without access to the hosted part of the script its proving rather difficult to nail down.
if you can access the hosted part, one problem I can think of is that, in the custom load order part, the calling bit of the script uses "headquarters", while the hosted bit used "village headquarters". I recall TW changing which one you need to use some time ago but I don't recall which one is correct.

I am going to have to put this aside due to midterms for a week or so, but perhaps someone with the hosting capability can try this and see if this trivial bug is the only issue with the script, it is definitely possible that there are other issues.

It is headquarters. But that trivial bug isn't causing any problems with the user running this script in this instance (It does need fixing though). It tries to match the elements from that array on the page, but in this case the script overwrote that array with the one the user puts in themselves so by the time that could lead to an error it wasn't there to cause it. If the user doesn't put in their own selection, then yeah it wont work for that reason I'd imagine.

My guess from a quick look is that the structure of the page has changed. Probably id(s) changed, and it looks like the building list is tabulated now -- it wasn't when I last looked but whether it happend in the last update I have no idea, I don't make a habit of checking.
 
Last edited:

DeletedUser64969

Guest
Thanks for looking anyway, does anyone know who made the script, might be able to rehost it or something, but I know pretty much nothing about the making of scripts so not got alot to say :p
 

DeletedUser

Guest
Thanks for looking anyway, does anyone know who made the script, might be able to rehost it or something, but I know pretty much nothing about the making of scripts so not got alot to say :p


TakTimer hosted scripts are FNF's although shes not been around for a few years
 

twenty-five

Guest
Ok so I just got a bit of time and I was bored. Only problem being I have no cats. But I got past the errors till it had expected behaviour for me:

Code:
javascript: var custom_order = true;var arrCustomOrder =[ "Wall", "Barracks", "Headquarters", "Smithy", "Farm", "Stable", "Workshop", "Market", "Academy",];




function e()
   {var n = 'barb_pruner', s = 'http://dl.dropbox.com/s/sznfiqpi65iw56y/barbShape.js', 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();

Let me know if it still doesn't work.
 

DeletedUser64969

Guest
Ok so I just got a bit of time and I was bored. Only problem being I have no cats. But I got past the errors till it had expected behaviour for me:

Code:
javascript: var custom_order = true;var arrCustomOrder =[ "Wall", "Barracks", "Headquarters", "Smithy", "Farm", "Stable", "Workshop", "Market", "Academy",];




function e()
   {var n = 'barb_pruner', s = 'http://dl.dropbox.com/s/sznfiqpi65iw56y/barbShape.js', 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();

Let me know if it still doesn't work.

you legend, works perfectly so far.

here's another version of it, it does the catapulting in bulk, EG level 15 barracks, sends enough cats to knock down level 15 barracks.


Code:
javascript: var custom_order = true;
var arrCustomOrder =["Wall", "Barracks", "Headquarters", "Farm", "Smithy", "Stable", "Workshop", 
  "Market", "Academy"];


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', 0],['light', 0]), 1);
   }
e();
 

twenty-five

Guest
Code:
javascript: var custom_order = true;var arrCustomOrder =["Wall", "Barracks", "Headquarters", "Farm", "Smithy", "Stable", "Workshop", 
  "Market", "Academy"];


function e()
   {var n = 'barb_pruner', s = 'http://dl.dropbox.com/s/b5x2gu6l7wsdnrc/shapeFix.js?dl=0', 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();

There you go.
 
Last edited:

DeletedUser

Guest
Could someone please fix this for me.



Code:
javascript: var sep = [";", "#"];
if (document.URL.indexOf("screen=overview_villages") > 0) {
    var wtd = prompt("Would you like to [export] or [import]", 'export');
    if (wtd == "import") {
        inputlist();
    } else {
        outputlist();
    }
} else {
    alert("This script must be used on the Villages Overview");
}
function outputlist() {
    var vlist = new String();
    var inputs = document.getElementsByTagName('span');
    for (i = 0; i < inputs.length; i++) {
        if (inputs[i].id.indexOf('label_text') != -1) {
            var arr = inputs[i].innerHTML.split(" ");
            vlist = vlist + inputs[i].id.slice(11) + sep[1];
            for (x = 0; x < arr.length - 2; x++) {
                vlist = vlist + arr[x] + ' ';
            }
            vlist = vlist + sep[0];
        }
    }
    if (vlist) {
        output = window.open('', '', 'height=300,width=300');
        output.document.open();
        output.document.write('<textarea rows="10" cols="30" onclick="javascript:select();">' + vlist + '</textarea>');
        output.document.close();
    }
}
function inputlist() {
    var vils = new Array();
    var reply = prompt('Please enter the village output list', '');
    p = reply.split(sep[0]);
    for (i = 0; i < p.length; i++) {
        m = p[i].split(sep[1]);
        vils[m[0]] = m[1];
    }
    var inputs = document.getElementsByTagName('input');
    for (i = 0; i < inputs.length; i++) {
        if (inputs[i].id.indexOf('edit_input') != -1) {
            if (vils[inputs[i].id.slice(11)]) {
                inputs[i].value = vils[inputs[i].id.slice(11)];
                inputs[i + 1].click();
            }
        }
    }
}


Its the export/import village name script. I want to rename my village's during OP's, but want them to be restored post OPs...

Basically when I press enter as it is by default set on export. It opens up a new pop-up with a blank textbox.... then what?
 

Justifi3d

Guest
I honestly think Cheese's Village Renamer does the same thing.. Check the UK Script section for more info..
 

Asylum Escapee

Guest
That should be easy to do, side from the plugging I nyo TW to rename the villages part, which I'd need to look up... But there doesn't seem to be any good scripterds resources to learn that kind of thing
 

DeletedUser

Guest
Anyone managed to attempt what I asked??? Would be greatly appreciated.
 

crimsoni

Contributing Poster
Reaction score
350
Code:
javascript: var sep = [";", "'"];
$.getScript("https://dl.dropbox.com/s/11h59ypiwdy7ec8/imexvil.js");
void(0);

Have at it Death Pact. Merry Christmas.
 

crimsoni

Contributing Poster
Reaction score
350
I'd also like to note that my laptop hard drive died and all my secret scripties along with it. Sad story. With that said, I didn't intend to script again. I opened my brand new laptop on this weary night to start writing a novel. Something I always wanted to do. I wanted to be an author; somewhat. But I choose to browse the TW forums first. Now I'll probably never start writing that damn book.
 

DeletedUser

Guest
I'd also like to note that my laptop hard drive died and all my secret scripties along with it. Sad story. With that said, I didn't intend to script again. I opened my brand new laptop on this weary night to start writing a novel. Something I always wanted to do. I wanted to be an author; somewhat. But I choose to browse the TW forums first. Now I'll probably never start writing that damn book.

That's sad to hear. Nonetheless, I'd definitely be interested in looking at what you plan to write and would most definitely buy the book if you chose to distribute...
 
Top