Script Several GM scripts

DeletedUser

Yeah, that's not working.

An example of what I am specifically attempting to do is pull up the town's logo via one of the sidebar buttons.
 

DeletedUser

It's not working for my intentions, which is to extract the the town number, the id, and be able to insert it as a variable in a link.
 

DeletedUser

If you want only to insert it to link, you don't need to extract town_id in your script. As in the second Shulik script, you can use directly Character.home_town.town_id
To be sure, that it works, try copy this to URL address of browser:
javascript:alert(Character.home_town.town_id);
 

DeletedUser

Two new scripts added.

Could an admin say whether are these new scripts allowed?
 

DeletedUser

Hi Skullik, the inventory script doesn't make sense and/or is not counting correctly. What are the first two baskets counting?
 

DeletedUser

The first is buying value if you aren't a member of the town, the second is buying value if you're a member of the town and the third is selling value.
 

DeletedUser

The West uses old version of MooTools, which not allows to do refactoring of classes. For centering is needed to refactor WMap.scroll_map or WMap.scroll_map_to_pos. If you know any method, how to refactor it, or if you have any suggestion, how to do centering without refactoring of that class (WMap), send me please privat message. We'll very appreciate it.
Sorry, been MIA..
Can't you just redefine them with: WMap.scroll_map_to_pos = function {} (or so)?

Another point is whether using their code and changing a part of that is something they'll prohibit (swinging around with copyright, or just a ban stick :)
 

DeletedUser

Sorry, been MIA..
Can't you just redefine them with: WMap.scroll_map_to_pos = function {} (or so)?

Another point is whether using their code and changing a part of that is something they'll prohibit (swinging around with copyright, or just a ban stick :)

I can't redefine it that way, it doesn't work.
 

DeletedUser

I can't redefine it that way, it doesn't work.
Hmm I just tested with Firebug and by appending a new script element to <head>, and both ways I can simply do this:
Code:
WMap.scroll_map_to_pos = function(x,y){alert(x+', '+y)}
And instead of scrolling it will show the coordinates.

Sure, the hard work is in getting the screen size and getting the right offset. But to me it seems very possible. That still leaves whether it is allowed to do this though.
 

DeletedUser

hmmm, it works... I had misspelling in syntax, ouch... so, thanks :), centering will be implemented in next version of script ;)
 

DeletedUser

That still leaves whether it is allowed to do this though.

I think, that when we keep there whole function code and add only correction for position, then can't be problem with allowing. But we'll disscuss it with admins.
 
Last edited by a moderator:

DeletedUser

Script 1 translated and enhanced.

Hello Shulik. I like your scripts a lot. I took the freedom to modify number one a bit. This is what I did:


- Removed the export duel button and the calculate inventory buttons.
- Edited the help button so it points to the official help page.
- Added a refresh button.
- All the buttons have been updated with new graphics.
- Moved the buttons to better positions.


You can find my script here: http://userscripts.org/scripts/show/53930

What I would really like to do is to make a button that runs a javascript. This javascript exports data to westinsider and opens the page. I would like to do the same thing for weststats.
 

DeletedUser

Hi Avien, the additions you made don't really add anything. The default horizontal menu already provides a help button, so your menu addition is redundant. The refresh button is also redundant, as all browsers already have a refresh button.

I agree though about the javascript. I have been stumped as to how to get javascript added as a menu button.

Specifically, I wanted to add TheWestInsider's script as a menu button, but it crashes the whole script:
Code:
javascript:(function(){%20var%20head%20=%20document.getElementsByTagName('head').item(0);%20var%20old%20=%20document.getElementById('TWIjs');%20if(old)%20head.removeChild(old);%20var%20js%20=%20document.createElement('script');%20js.setAttribute('id',%20'TWIjs');%20js.setAttribute('language',%20'javascript');%20js.setAttribute('type',%20'text/javascript');%20js.setAttribute('src',%20'http://www.TheWestInsider.com/scripts/1.js.php');%20head.appendChild(js);%20}%20)()
I also wanted to add a menu button that would display the town's flag, but that's been a fail because in order to do so, the script must insert the town's ID:

Code:
http://'+region+actual_world+'.the-west.net/img.php?type=town_logo&id='+Character.home_town.town_id+'
It's the town ID that is just not working and causes the whole script to crash.
 
Last edited by a moderator:

DeletedUser

You are totally right Hellstrom, thanks for the feedback. That's what happens, when you don't do your research, my hometown's version of the script adds a bookmark to our external forum. If we could make the script buttons work though, it would really be a useful feature. I and some friends have tried a bit, but have stranded on poor javascript knowledge so far.


Another task, which might be a a little trickier, is to run the following scripts:

Code:
javascript:var%20wsp_auth%20=%20'&ui=148427&up=dee49110021552e7b73c9a3a3a6f5fc4fbfdd4b0';var%20wsp_url%20=%20'www.weststats.com';var%20remoteScript=new%20Element('script',%20{"type":%20"text/javascript",%20"src":%20"http://www.weststats.com/js/import_all.js?1240671482"});document.body.appendChild(remoteScript);void(0);
(exports all game data to weststats.com)
Code:
<a href= http://'+actual_region+'.weststats.com/?change_world='+actual_world+'" target="_blank">
(opens weststats in a new window)
Code:
<a href=""></a>
(refreshes the game window, since the weststats script messes up the game.)

Essentially this accomplishes the same as Hellstrom's idea over, only with weststats instead of westinsider.
 
Last edited by a moderator:

DeletedUser

I managed! :D


The West Extra Tools (v0.30)


Adds 3 buttons.


  • Export to and open Westinsider
  • Export to Weststats
  • Open Weststats


This script would not be possible without: Shulik, Glasis, Jesper Karsrud. Thanks guys.


Install here!



With this task nailed, I'd like to merge the 2 weststats buttons. I would also like to add a refresh of the gamewindow, which now has to be done manually. I am having some trouble doing it, so if someone has some tips, feel free :)
 
Last edited by a moderator:

DeletedUser

Could you make the building shortcut script, so you could remove some of the buttons?

It would be nice

Or you could also tell me how to remove some of the buttons :)
 
Top