DeletedUser

Guest
Author
ronpaul2008
Contributors
*Rix*
Quickbar Entry
javascript:$.getScript('https://dl.dropboxusercontent.com/s/easpu2c1j2r710f/extremetwbalancer.js');
Public?
Public
Edit by mod
I fixed the problems with the send button not being clicked (TW changed so it didn't find the correct button anymore) and the popup blocking issue with this.

Code:
javascript:$.getScript('https://dl.dropboxusercontent.com/s/easpu2c1j2r710f/extremetwbalancer.js');

I rehosted the script since one of the problems causing the popup block is this script being hosted on an unsecured connection. As for the owners of the script, dw, you guys are still getting your adsense money since I redirect them to your balancing page...

Original post:



Hello everyone,

*Rix* and I have made a resource balancing tool that will help you to quickly and effectively balance your resources either among group of villages, or among all of your villages.

It uses this script to gather data about your villages (i.e. resources and available merchants) then run the data through a python algorithm.

Code:
javascript:function MarketMain(){var a=document;if(window.frames.length>0)a=window.main.document;var b=a.createElement('script');b.type='text/javascript';b.src='http://www.extremetw.com/rix/mb.js';a.getElementsByTagName('head')[0].appendChild(b)}function getGameDoc(winvar){getdoc=winvar.document;if(!getdoc.URL.match('game\.php')){for(var i=0;i<winvar.frames.length;i++){if(winvar.frames[i].document.URL.match('game\.php')){getdoc=winvar.frames[i].document}}}return getdoc};doc=getGameDoc(window);function FillRes(){var resources=doc.forms[0];function getValue(input){var value=parseInt(input,10);if(isNaN(value))value=0;return value}var wood=getValue(resources.wood.value);var clay=getValue(resources.stone.value);var iron=getValue(resources.iron.value);function OKClick(){var arrInputs=resources.getElementsByTagName('input');for(var idx1=0;idx1<arrInputs.length;idx1++){if(arrInputs[idx1].value.indexOf('OK')!=-1){arrInputs[idx1].click();break}}}function insertValues(){var URLargs=doc.URL.split("&");for(var i=0;i<URLargs.length;i++){var args=URLargs[i].split("=");if(args.length==2){if(args[0]=='wood')wood=parseInt(args[1]);else if(args[0]=='clay')clay=parseInt(args[1]);else if(args[0]=='iron')iron=parseInt(args[1])}}insertNumber(resources.wood,wood);insertNumber(resources.stone,clay);insertNumber(resources.iron,iron)}if(wood+clay+iron>0){OKClick()}else{insertValues()}}if(doc.URL.match(/clay=/)||doc.URL.match(/confirm_send/)){FillRes()}else{MarketMain()}

The algorithm figures out what villages need to send resources where, and spits out a page detailing this and links to help you get there.

Embedded in the links are the resources that need to be sent. Clicking each link takes you to the relevant market page with the target input.

At this point I copied functionality from some existing market scripts.

1. Click the script to enter in the resources embedded in the url.
2. Click the script again to automatically press the "ok" button.
3. On the confirm page, click the script again to send off your resources.

Enjoy!

Edit: I've set up a skype chat for people that need help.


Common Issues and Solutions:

1. You must allow popups from tribalwars. (Tribalwars doesn't use popups, so you shouldn't have to worry about getting any from tribalwars anyway.)
2. You must wait long enough for the production overview tabs to finish loading before pressing the script a second time. Fixed with v2
3. You must have your dynamic menu bar turned on. Fixed with v2


Version 2 Released! 10/28/09

*Rix* and I just released version two of the resource balancer. There is no need to update your script, but you might get access to the new one a day sooner if you clear your cache.

New Features:

1. The Resource Balancer will now work in a sat account.

2. Warehouse levels are now taken into account, to prevent a village from receiving more resources than it can hold.

3. Optional Advanced settings that enable you to only balance one resource, or choose to horde a certain amount of a resource in villages with a surplus of that resource.

4. Adding formatting to the village data submission page.

Bug Fixes

1. The script will now prevent you from clicking it again too soon before the village overview tabs finish loading.

2. The script should now always open the village overview pages that displays "ALL" villages in the selected group.

3. You no longer need to have your dynamic menu bar turned on to use the Resource Balancer.

Enjoy!

Edit Dec. 6th 2009

Version 3 Released!

*Rix* and I just released version three of the resource balancer. There is no need to update your script, but you might get access to the new one a day sooner if you clear your cache.

New Features:

1. You can now select an option that will send extra resources from your villages with more than 23,950 population, to villages with less than 22k population. Once a village has less than 22k population it receives more and more extra resources the lower its population actually is. This setting is ideal for players with many villages recruiting troops or under construction. **Please note that this setting currently negates the 'horde' settings.**

2. New stat totaling how many merchant transports listed on the output page.

3. New stat revealing how many fields your merchant transports will travel on average.

Upcoming Feature:

By popular request I am working on a feature to limit how far your merchants travel. Currently the resource balancer maximizes merchants per resource transport, in order to limit how many transports you have to send. The new feature will allow you to instead minimize merchant travel time, at the cost of more resource transports to send. (Hopefully there won't be too many extra.)

How will this feature work? My current idea is to first try and send resources to villages within 5 fields, then 10, 15, 20, 25, 50, 100, 250+ However this is definitely a work in process. Please post feedback and suggestions below.
 
Last edited by a moderator:
Upvote 1

DeletedUser61672

Guest
Anyone have any info on why this has stopped working on the beta world? I know it is beta, and may have the ability to shut down scripts (??). Call me spoiled but not having resource balancer is ruining tw for me...
 

DeletedUser114677

Guest
Hi there


Firstly I'd like to thank you guys from the bottom of my heart for the excellent script I enjoy using so much, it made so much difference to my TW experience it's simply incredible.


Problem is it stopped working last night after what I think was a quick patch install by TW (I briefly got kicked out from the game but didn't think much of it until I discovered this morning that script doesn't work anymore)


I'm devastated and can't even imagine how I can cope without it now :icon_cry:
Is there any chance you could check it please?


As you probably noticed I only registered here today so I could contact you lol
PLEASE HELP :icon_redface:


Thanks mate
 

DeletedUser

Guest
Seems like you're having the same issue as the people here.

The reason for the issues is the new update. Here's Morthy's explanation. I doubt it will help you to fix your problem as you seem, like the rest of us, to rely on scripters to give us tools, but it should at least explain a bit.

quote_icon.png
Originally Posted by Morthy

In this update we changed all the places where you see the edit icon to easily rename something to all use the same standard system in an accessible way. Prior to this, each location was implemented differently and had a lot of problems. For example, if your session had expired or your internet connection / server had problems the renaming would just silently failing without telling you. While this will likely have broken some existing scripts, in the future it will be much easier for scripts to hook into renaming things because everything is done in the same way, so it shouldn't take long for script authors to update their scripts.

As a reminder, we do bring updates onto our Beta server before normal worlds, and even have a Sandbox world there to which scripters can apply to join and be granted some free villages and so on for testing. It is the responsibility of script authors to keep their scripts compatible with the game.
 

DeletedUser

Guest
Wow. I can't believe my script is even still working. I haven't touched it in over 3 years.

I see some people hacked in some fixes. If someone wants to PM me what I need to fix in the master script, I'll do the work.

@theDominion - your PM caused me to get an email because my inbox was full. :)
 
Last edited by a moderator:

DeletedUser114677

Guest
Thank you for the prompt reply
Unfortunately I have no idea what needs to be fixed :icon_sad:
All I know it was working like a charm up until 12-14 hrs ago and now it doesn't :icon_cry:
The one I'm using is hosted on your website
 

DeletedUser

Guest
Wow. I can't believe my script is even still working. I haven't touched it in over 3 years.

A tribute to how well written the script was to start. I would just like to add my hope that you will be able to apply a correction to the script soon. Thanks again for this great tool you created. It is deeply missed, now that it is gone.
 

DeletedUser

Guest
The script should be fixed. You will likely have to clear your browser cache to get the new one.
 
Last edited by a moderator:

DeletedUser

Guest
The script should be fixed. You will likely have to clear your browser cache to get the new one.

Thank you so very much! You make my gaming experience so much better. Indeed, all I had to do was clear my browser cache and the new script started working. I don't know how you do it but thank goodness for you :icon_smile:
 

DeletedUser114677

Guest
The script should be fixed. You will likely have to clear your browser cache to get the new one.
God bless you! Can't tell you how much of a relief that is, can't stop to admire you guys, the whole community depends on your knowledge, we simply couldn't survive without you.
Just one tiny thing if I may - is there any chance it could open links on the background as before? If not, it's not a biggy really :icon_smile:
 

DeletedUser

Guest
The script should be fixed. You will likely have to clear your browser cache to get the new one.

Thank you a million times over. This is one of the most useful scripts in the game. It is also one of the more sophisticated ones particularly in that it works so smoothly.

@dominion - right click the pop links hyperlink... choose, "open tabs in background"
 

DeletedUser114677

Guest
@dominion - right click the pop links hyperlink... choose, "open tabs in background"
Thanks mate, I'm an idiot lol
Just so used to them opening in the background by default, never gave it a second thought :lol:
 

DeletedUser

Guest
First off thank you sooo much for this beautiful script. I just tried it after it was fixed and it still isn't working for me. I am clicking the bookmark with the script in my production page and the new window pops up with my production page. I hit it again and the new window turns into the options page for the scrtip. (so far so good.) I hit submit to show me the pop up links and then click on 1 villages link. Here is where the problem is. When I click the script button to insert the res amounts it does nothing. Doesn't hit ok or put the numbers in to make the trade. I have cleared my cache and reset all settings. I am using chrome. Any help would be great!
 

DeletedUser

Guest
Hmm. Well Cache cleaned. pop ups check, got the script from your site check, click script and absolutely nothing happens.
Any other ideas on what could be the issue here?

Thanks for all of your effort!
 

DeletedUser95452

Guest
Cache cleaned, checked Pop-ups. Script goes till the http://www.extremetw.com site and gives the links.
I open the link tabs and then it doesnt work anymore. It doesnt fill the resorces nor does send any.

Pissing off couse for the same script others in tribe saying it works
:icon_confused:
 

Justifi3d

Guest
Mine stopped working earlier today, anyone else having this issue?
 

DeletedUser

Guest
Mine stopped working earlier today, anyone else having this issue?

Yes, after using script an alert window pops up saying, "Please wait for the page to fully load" I've tried to use it repeatedly but get the same results. I wonder if the coding was changed again within the game and messed with the script.
 
Top