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

docileone

Guest
This script cannot be ran

A script in your Quick Bar attempted to load another script over an insecure connection.
As part of the security model of your web browser, scripts can only be loaded from URLs starting with https://
The URL that could not be loaded was: http://www.extremetw.com/rix/mb.js

i'm getting the same! please post new script here, tears & sad face will continue until then!
 

DeletedUser

Guest
Think it depends which world you use it on.

Works for me on w78, however doesn't on w80 and nor does any other script that requires the new https security from the new update.
 

docileone

Guest
if anyone finds a balance script that works on world 80, i would really appreciate it loads!
 

DeletedUser

Guest
Can't get it to post properly, but go on the .uk externals and it's the top script on the approved page.
 

docileone

Guest
i don't know how to get to .uk externals, do you have at least a partial link?
 

docileone

Guest
i've looked at what was available and tried several out, none worked :(
 

DeletedUser

Guest
In retrospect it might have been a good idea to notify people of this change well ahead of time so we could have had the replacement scripts in place in time for the change. All it takes is a bit of forward planning. Now we're left waiting for them to be updated, I could really do with a working resource balancer script.
 

DeletedUser

Guest
In retrospect it might have been a good idea to notify people of this change well ahead of time so we could have had the replacement scripts in place in time for the change. All it takes is a bit of forward planning. Now we're left waiting for them to be updated, I could really do with a working resource balancer script.

There was notice given about this.


https://forum.tribalwars.net/showthread.php?274755-Update-to-version-8-34
https://forum.tribalwars.net/showthread.php?275079-Update-to-version-8-34-1
and
https://forum.tribalwars.net/showthread.php?275331-Update-to-version-8-35


The resource balancer mentioned above should work.
 

DeletedUser47445

Guest
The resource balancer in the UK forums works. And I'm fairly certain its legal, it is hosted by innogames.
 

DeletedUser100206

Guest
The following script is now working. I had to explain to mods on UK how to fix it and they did it, finally.


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='https://media.innogamescdn.com/com_DS_UK/Scripts/ExtremeTw_ResourceBalancer_launcher.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()}
 

DeletedUser

Guest
While on the subject of resource scripts.... has anyone got a working incoming hauls script please?
 

DeletedUser54677

Guest
The following script is now working. I had to explain to mods on UK how to fix it and they did it, finally.


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='https://media.innogamescdn.com/com_DS_UK/Scripts/ExtremeTw_ResourceBalancer_launcher.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()}

By the gods how I've missed this script. :|

Thanks, mate.
 

DeletedUser114251

Guest
I have tried all the resource balance scripts in this forum chat in world 80 and they still do not work
 

DeletedUser105769

Guest
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()}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()}

Works for me, if not check if there's a lock on url bar.
 
Last edited by a moderator:

DeletedUser118477

Guest
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()}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()}

Works for me, if not check if there's a lock on url bar.

it still doesn't work for me.

there's a lock at the URL bar.

any suggestion?
 

DeletedUser105769

Guest
Click on the lock, allow it, it will reload page, click script again, it will show lock again..click till it opens resource balancer page.
 
Top