GM Script for adding buttons

DeletedUser

Hello my lovely .net-community ;-)

Here is a little GM (greasemonkey) script for u which adds various buttons to the TW interface.

Description of features:
1. Adds 3 buttons (4 buttons in the german TW) to your interface.
1.1. A link to Weststats which will always choose the right language and the world from which u r clicking the link-
1.2. A link to TWTool which will also select the right world
1.3. A link to calculate the value of your inventory (inventory hast to be opened ones before trying to calculate)
1.4. In the german version a link to our lovely TWTimes (a newspaper)
2. Localised via the language of your browser

How to install:
1. U have to use Firefox
2. U have to install Greasemonkey, a Firefox addon which can be downloaded here
3. After installing Greasemonkey and restarting Firefox click here to install the script (actual version Beta 0.124)
4. Follow the instructions
5. Refresh your tab in which TW is startet and the script shoult add the 3 buttons.

Post any questions concerning my script here please but please try to use no colloquial, I am german and my english is not the best, like u see in my post here.

So have fun with the script.

Best regards Glasi

Actual version: Beta 0.125
Old versions: Beta 0.124
Beta 0.123

Changelog:
Beta 0.125:
- Fixed problem with greek browsers (according to user informations GM-scripts are not allowed in the-west.gr therefore it was excluded at the script)
Beta 0.124:
- Fixed problem with czech browsers.
 
Last edited by a moderator:

DeletedUser

Nice script very nice.


Any chans to make it work on .se aswell?




Edit.

Just checked it seams to work on wold 2 but not world 1
 
Last edited by a moderator:

DeletedUser

I saw your editing reason. So http://se1.tw.ignames.net/game.php# is the ingamelink? I Have to add this to the include function if so. Because I only know things like
Code:
http://localization+worldnumber.the-west.localization/game.php
 

DeletedUser

Ye i had to type it there as it wont let me in a normal message.
 

DeletedUser

I found a little bug:

I'm Czech and my Firefox 3 (and all the others browsers) returns language code "cs". But weststats need "cz".

Now, links look like http://cs.weststats.com and it return TWstats.

You can fix the bug easily, just add "if(locale=="cz"){var locale="cs";}"..


BTW: Nice work, just I think links to Weststats and TWtool (maybe TWtool isn't important for Czech, Slovak etc. West) should be on the right side.. On the left side is more buttons..
 

DeletedUser

Oh this is definitely cool and very useful! :)

I have given the info on the french forum, because it works very well on TW.FR

Thank you for this! :)
 

DeletedUser

hi! i have heard greasemonkey scpits are illegal. is this illegal or not? thank you!
 

DeletedUser

I found a little bug:

I'm Czech and my Firefox 3 (and all the others browsers) returns language code "cs". But weststats need "cz".

Now, links look like http://cs.weststats.com and it return TWstats.

You can fix the bug easily, just add "if(locale=="cz"){var locale="cs";}"..


BTW: Nice work, just I think links to Weststats and TWtool (maybe TWtool isn't important for Czech, Slovak etc. West) should be on the right side.. On the left side is more buttons..

Ok, I will fix this with the next version.

hi! i have heard greasemonkey scpits are illegal. is this illegal or not? thank you!

No they are ok as long as they are not integrating premium features or they do not help u to handle the game with less mouseclikcs than normal.
 

DeletedUser

but the script has a problem. when I clic the weststats button it opes a new tab but it wasa Tribal War stats instead of The West stats.
 

DeletedUser

but the script has a problem. when I clic the weststats button it opes a new tab but it wasa Tribal War stats instead of The West stats.

In which language is your browser? The localization of the script uses the browserlanguage and there is at the moment a problem with the czech version I will fix this like I said in teh next version.

Edit: The problem with czech browsers should be fixed with this version now: Beta 0.124
 
Last edited by a moderator:

DeletedUser

I have one idea:

If you add "AjaxWindow.show('inventory');" behind "javascript:" in the script what calculate the inventory worth, I wouldn't open inventory before calculating. And you can also close the inventory window..

The script would look like this:

inv_val.innerHTML = '<a style="background:url(http://f.imagehost.org/0681/invber.jpg) no-repeat" href="javascript:AjaxWindow.show(\'inventory\');var sell_value_equipped = 0, equipped = Wear.wear, inventory_value = 0, inventory = Bag.getInstance().items; if($defined(equipped.animal)) sell_value_equipped += equipped.animal.get_sell_price(); if($defined(equipped.body)) sell_value_equipped += equipped.body.get_sell_price(); if($defined(equipped.foot)) sell_value_equipped += equipped.foot.get_sell_price(); if($defined(equipped.head)) sell_value_equipped += equipped.head.get_sell_price(); if($defined(equipped.neck)) sell_value_equipped += equipped.neck.get_sell_price(); if($defined(equipped.right_arm)) sell_value_equipped += equipped.right_arm.get_sell_price(); if($defined(equipped.yield)) sell_value_equipped += equipped.yield.get_sell_price(); for(var p in inventory) {inventory_value += inventory[p].get_sell_price() * inventory[p].get_count_value();} alert("Inventory items value: " + inventory_value + "$\nEquipped items value: " + sell_value_equipped + "$\nTotal value: " + (sell_value_equipped + inventory_value) + "$"); setTimeout(\'AjaxWindow.close(\\\'inventory\\\')\', 0); end();"></a>';

I tested it on Firefox 3.0.10, I don't know whether it works in another versions...

The changed parts are red.
 
Last edited by a moderator:
Top