Needs Feedback: [To the developers] Wait for page load

DeletedUser1760

Guest
Hello.

I'm from Tribal Wars Brazilian and I develop scripts there...

Today I had a problem: I've made a script to filter the villages that have a pre-configured troops, but, when I executed the script, many villages were not filtered.

Why? The answer is short: because the page has not been fully loaded.

In JQuery we have this function:

Code:
$(document).ready(function(){
...
});

So, I need to put the whole script into this function... But I have many scripts and doing this would be too boring.

This is a big problem to the people who have many villages...

Developers, can you add a function to wait the page be fully loaded BEFORE executing all scripts in the Quick Access Toolbar?
 

DeletedUser1760

Guest
Well... This topic wont get feedback because almost no one knows understand this topic, only who knows how to make scripts...
 

fp0815

Staemme in my heart <3
Reaction score
19
Maybe you got no feedback yet, because this idea is directed only to scripters, but maybe also (and this is my favorite) most beta players don't like it, when players just register to post ideas without playing beta, hoping that their ideas are forwarded faster here. ^^

But anyway: TW is not responsible for the scripts. TW just supplies you with the basic functionality. So, if you need basic things for your scripts and you are just too lazy to include it or to modify them subsequently... not a problem of TW. ;)

And in your example with the villages: just wait until your browser has finished loading. The status bar shows it. :p
 

DeletedUser1760

Guest
Maybe you got no feedback yet, because this idea is directed only to scripters, but maybe also (and this is my favorite) most beta players don't like it, when players just register to post ideas without playing beta, hoping that their ideas are forwarded faster here. ^^

But anyway: TW is not responsible for the scripts. TW just supplies you with the basic functionality. So, if you need basic things for your scripts and you are just too lazy to include it or to modify them subsequently... not a problem of TW. ;)

And in your example with the villages: just wait until your browser has finished loading. The status bar shows it. :p

Lazy? This problem is not mine.

This problem is to all scripts in all Tribal Wars servers.

All scripts that don't use a function to wait for page being load can have problems. And all scripts that I saw don't use this function, so, they all can have problem.

My suggestion is not only for me. If you don't understand of scripts, please don't post here.

Editing:

I don't play beta because to see this problem you need to use a premium account.

And I can't pay a premium account for this server because I'm not from here and I don't want to waste money here just to see it.

I know that this problem occurs to all server and there is no reason to me play in this server.
 
Last edited by a moderator:

fp0815

Staemme in my heart <3
Reaction score
19
I checked some scripts on .NET for it and they have added the jQuery ready function to their scripts if this is necessary. So, I don't see any sense in adding something from the developers side, because scripters made a 'mistake' on their script design, means forgetting to implement this function.

Btw... premium is spend for free on Beta once a month for a period of 14 days. You don't need to 'waste' money for it. :)
 
Last edited:

DeletedUser

Guest
As Chisum stated, we offer 14 days' free premium every month so that users can test premium features for free. We also sell premium at a much reduced price. As for the Script, you would be surprised how many users of the forum understand at least the basic concepts of programming and can thus understand what a script is meant to do.

Regarding the idea:

There are some scripts which can be run easily, without problems, before the page has fully loaded. For example, if someone is on a slow connection, trying to use a mass-recruit script, they might not want to have to wait for everything to load before being able to use a script. Hard-wiring something like this to enforce a delay would cause as many problems for users as it would fix. It is not too much trouble for a script-writer to add three lines to their script. It is impossible for a user to execute a script before the page has fully loaded if this is hard-coded.
 

DeletedUser

Guest
@Przyr: Why don't you put your whole scripts into a function? That way you can decide wheter to call it onLoad or earlier later on!

Or use objects with methods, like
Code:
var myScript = {
loaded: function() {
alert("Here is what your script does upon initialization.");
}
};

$("document").ready(myScript.loaded);
I haven't tried it, it might contain mistakes / errors.
 
Last edited by a moderator:

DeletedUser1760

Guest
@robertschwarzl: I put my whole script into a function.

That's what I do:

$(document).ready(function() {
<all script here>
});


@Petnquaranlor: I understand you, but, there's no problem to put this function into the server side. It would be better because some people don't put it into their scripts and it may generate problems if the player has many villages... I know that is a obligation of us script-writers. But, what about the people that is entering now in the world of script-making? What about the other servers? I play in the Brazilian server of Tribal Wars, and the people who make scripts there, they DON'T put this function, I'm the only person who does this...

It would be nice if we had this in the next version... That's a simple function that can fix many possible errors.

Let me give 1 more example: I was making a script that rename the villages in a sequence, and my page was not fully loaded (not all villages were displayed), then, I executed the script and it did rename a village out of the sequence...

E.g.: my villages were in this sequence:
[00001.A]
[00001.B]
...
[00200.Z]

But some villages were not displayed yet, then, the script did rename the village that is out of the sequence to a name that a village already contains (like [00200.B]).


Thank you guys for replying.
 
Last edited by a moderator:

DeletedUser

Guest
Yes, what I meant was putting the whole script into a function before even THINKING about wheter it needs the page fully loaded or writing any code. You can THEN decide if you want to call the function immediately or after the "full load"^^

// but that's as much work as with your version for so many scripts, you're right.
 
Top