
mw54finest
|
Add Cash To HomePage Part IIby sirnotappearinginthisfilm
Adds player's cash to the home page dynamically.
This is a modification of http://userscripts.org/scripts/show/27967 which hard coded the player info, my script iterates through each player found on the home page and adds the cash for each player found to the respective player's section.
Tested on a page with 3 players, would be nice to have someone with a large amount of players test it out to see if it works correctly.
I also noticed that the background color for each player doesn't expand with the addition of this extra row of player data. GLB uses a background image for this and it seems that once it's size is initially defined by the page it cannot be changed (I tried!).
edit: I've made some changes to the code to allow some customization. At the top of the code you will see the following:
| Code: |
var displayLocation = { BelowEnergy:false, RightOfEnergy:false, BelowXP:true}; |
setting one of these to true will change the location of where the cash amount will display. Try setting one of them to true (with the others being false) to see the differences. While it is possible to set them all to true it would be better to have one to true and the others to false.
I personally like the dollar amount below the XP and have set that to be the default.
edit#2: some people use this in conjunction with other greasemonkey scripts, to allow those to work as well someone suggested adding a timeout to the script. The length of the timeout is set in a variable at the top of the script. By default the timeout is set to 0. If you need to have a timeout change the number on this line:
to the desired timeout. This number is the number of milliseconds. So to have the page wait 1 second it would be:
| Code: |
var timeout = 1000; |
http://userscripts.org/scripts/show/29108
|
mw54finest
|
BelowEnergy:true, RightOfEnergy:false, BelowXP:false
BelowEnergy:false, RightOfEnergy:false, BelowXP:true
BelowEnergy:false, RightOfEnergy:true, BelowXP:false
|
dlawilliams
|
It works as long as I don't sort the players with the sort feature
|
SNAITF
|
| dlawilliams wrote: | | It works as long as I don't sort the players with the sort feature |
That's what the timeout is for, by default it's set to 0. Try setting it to 1000 (1 second delay) and refresh the page, if that doesn't work, go to 2000, etc.
If you own a good number of players the sort takes time, modify the timeout to compensate for that.
|
|
|
|