pabst
|
Yet another player highlight script.Since cheech1223 pointed out that I never actually posted this one:
No, it won't work with Firefox 2. Version 3 only:
http://userscripts.org/scripts/show/29460
The script highlights your own players when watching replays using a background color change. It assigns each player on your home page 1 of 8 colors so if they share a team, you can still tell them apart. If you have more than 8 players, maybe not. It also highlights your players' appearances on play-by-plays or league leaders lists (the text should appear in green).
Player ID's are loaded automatically from the home page and written into a cookie. The cookie updates every 6 hours or every time your GLB home page is loaded. So, there's no excess server traffic when watching replays.
|
cheech1223
|
thanks again pabst. Its awesome.
I still can't get this to work on the league leaders lists. The script says its active on that page, but my Kicker who is in the top 10 or whatever, doesn't get highlighted. Any clue? will it only work for QB's since Passing is the default list that shows up on the league pages?
*Also, sometimes the league page's address is not just league_id=*, but it is sometimes league_id=*&conference_id=0 (but i guess this is covered, since your script is "running" on this page). Well, it shows running with a checkmark within the greasemonkey icon.... but its not highlighting my player!
|
cheech1223
|
I know you said you fixed the request where on the replay pages, it also highlights the name of your player on the right (where it lists everyone who is on the field on that given play). Thats not working for me either. I disabled any other script i have on the replay page and thats not fixing it. Any suggestions?
Sorry for all the "this isn't working for me".... but honestly this is one of my favorite scripts so far!! (i hated not being able to tell which CB or WR was mine in a play.)
|
pabst
|
I added your kicker to my player list and it worked fine. He appeared on the league & conference leaders list, the play-by-play, and on the replays of kickoffs. He doesn't turn green on the box score, but that's only because I didn't write that part in. League leader or conference leader won't matter, and no, it's not just for passing. The way it's written, it will catch both conferences and all categories.
go to your GLB homepage and click the following in firefox:
tools->page info->security->View Cookies
Click on the "glb-greasemonkey: player list" cookie. The cookie's contents will be shown below and your players and player id numbers should be listed. Delete the cookie to force a reload.
Otherwise, try uninstalling your copy of the script and installing a new copy. Sometimes greasemonkey doesn't update the previous version when installing a new one.
|
coyote4848
|
My guys are all the same color in the play-by-play....how do I make them different colors?
|
pabst
|
| coyote4848 wrote: | | My guys are all the same color in the play-by-play....how do I make them different colors? |
My script uses 8 colors, and from the looks of it, you don't have enough players for all of them to have the same color. You have 9(?) players on 3 teams so at worst, only 2 should be sharing a color and they shouldn't even be on the same team.
There are a few player highlight scripts so, are you sure you're actually using mine?
|
NukeDukem
|
All my guys are the same color too. They are all green. They all have different numbers in the cookie though.
|
pabst
|
| NukeDukem wrote: | | All my guys are the same color too. They are all green. They all have different numbers in the cookie though. |
Maybe it's getting confused by another script. What other scripts are you guys running?
|
jkf296
|
I have 3 players. 2 are on the same team and they come up as green. This is the only script I am running on the page.
The other one is on a different team and also comes up as green.
The cookie seems to be intact and match the player IDs.
This even happens when I run pbr Game Scout along with it.
|
pabst
|
Nevermind. I'm an idiot. I thought you were talking about the replay.
Putting player colors on the play-by-play is a little trickier. The problem is:
I can't use black since all text is black
I can't use white since it may be on a white background
I can't use red because that is reserved for turnovers
I can't use blue because that is reserved for scoring plays
I only use 8 colors total and that's 4 of them right there. Only the replays have different colors. The play-by-play and leaders screens are green by design because I really don't have enough colors to do it without making the screens look like an acid trip.
|
jkf296
|
Aah! Thanks for the explanation.
I thought I was losing my mind.
|
coyote4848
|
Thank you. I thought I was losing my mind too....
|
cheech1223
|
pabst, sorry about my other complaints that it wasn't working on Replay pages. It is, I was just stupid not to have Firefox 3 yet.
It now highlights my players' names on the list of players on the field... Looks great. Hard to read the Yellow font though. Anyway to stick with green here, or just use a background highlight of yellow instead of changing the font to yellow?
I searched the script, and no where do I see where it says to make the font yellow, otherwise I would just change it to green myself.
|
pabst
|
| cheech1223 wrote: | pabst, sorry about my other complaints that it wasn't working on Replay pages. It is, I was just stupid not to have Firefox 3 yet.
It now highlights my players' names on the list of players on the field... Looks great. Hard to read the Yellow font though. Anyway to stick with green here, or just use a background highlight of yellow instead of changing the font to yellow?
I searched the script, and no where do I see where it says to make the font yellow, otherwise I would just change it to green myself. |
I didn't use green there because with multiple players, it's harder to tell who's who. The text colors are calculated by the getColor(idx) function @ line 34. It uses the idx variable as a binary number to calculate the color. If you'd like to make it modify the background color in the list instead, go to line 207 and change | Code: | l.setAttribute("style","color:"+color);
to
l.setAttribute("style","background-color:"+color); |
The line to play with the play-by-plays is 232. The other miscellaneous pages are at 247. For these two, a color hasn't been calculated yet, but you can half-ass it and calculate it from the p.id
| Code: | var color = getColor(parseFloat(p.id));
Then just change
"color:green;font-weight
to
"color:"+color+";font-weight
|
It should work, but there's no telling what color your players will have. All of them could have the same color. You'd have to rewrite the foreach-loop like the replay colors for-loop to try and prevent that.
|
cheech1223
|
| pabst wrote: |
| Code: | l.setAttribute("style","color:"+color);
to
l.setAttribute("style","background-color:"+color); |
|
I went ahead and did this. Works good enough for me. My problem the first time was I didn't understand how your coding worked. I have multiple players on a team, and my Guard (designated yellow) was usually the first listed player (that I own) in the Replay pages. Because of that, everyone on my team would have a Yellow font (which was very hard to read). But i didn't notice that if I waited for the defense to come on and my CB (designated black) to be in the play then all of my defensive players in the play would be in black font (only in the list of players, their color box in the actual replay stayed whatever their designated color was).
Once I changed your code to "change background color" instead of "change font color".... yellow background with maroon font is much easier on the eyes. Looks funny when it consistently changes (if my guard sits a play, player names are highlighted in either blue, magenta, or pink depending on which of my other offensive players are in and of those which is listed first). As long as I can easily see who is in the play i'm happy.
ALL GOOD... thanks for your help! I can actually watch Replays now and know whats going on and how my boys are doing!
|
pabst
|
| cheech1223 wrote: | | pabst wrote: |
| Code: | l.setAttribute("style","color:"+color);
to
l.setAttribute("style","background-color:"+color); |
|
I went ahead and did this. Works good enough for me. My problem the first time was I didn't understand how your coding worked. I have multiple players on a team, and my Guard (designated yellow) was usually the first listed player (that I own) in the Replay pages. Because of that, everyone on my team would have a Yellow font (which was very hard to read). But i didn't notice that if I waited for the defense to come on and my CB (designated black) to be in the play then all of my defensive players in the play would be in black font (only in the list of players, their color box in the actual replay stayed whatever their designated color was).
Once I changed your code to "change background color" instead of "change font color".... yellow background with maroon font is much easier on the eyes. Looks funny when it consistently changes (if my guard sits a play, player names are highlighted in either blue, magenta, or pink depending on which of my other offensive players are in and of those which is listed first). As long as I can easily see who is in the play i'm happy.
ALL GOOD... thanks for your help! I can actually watch Replays now and know whats going on and how my boys are doing! |
That's a bug in the script. Stupid me probably shouldn't have used copy/paste to write that loop. Redownload the script. The colors in the player list are supposed to be the same as the colors in the replay.
|
jkf296
|
I get a timeout error on the PBP and replay. Sometimes the colors show up and sometimes they don't. I changed the Include address to:
http://goallineblitz.com/game/replay.pl?* , so it should work every time.
If I go to my Home page in GLB and then refresh then for some reason the highlight usually comes back.
Any thoughts?
This, the YAC and the Pancake scripts are the only ones I run and this happens too if I only run the highlight script.
|
rlranger
|
this is a really cool script thanks....now i can tell which player is mine in the replays
|
pabst
|
| jkf296 wrote: | I get a timeout error on the PBP and replay. Sometimes the colors show up and sometimes they don't. I changed the Include address to:
http://goallineblitz.com/game/replay.pl?* , so it should work every time.
If I go to my Home page in GLB and then refresh then for some reason the highlight usually comes back.
Any thoughts?
This, the YAC and the Pancake scripts are the only ones I run and this happens too if I only run the highlight script. |
The only way I could see my script causing it is if the cookie expired and the script attempted to reload the home page to rewrite the cookie. If the site doesn't respond in time, the script should leave a message in the error log. Is the error listed there or is it something else? When you go to the home page it automatically updates the cookie which is why everything works again.
Also, the script was updated when the season started, so the include hack shouldn't be necessary.
|
micha47
|
Very helpful - thanks a lot !
|
pabst
|
| jkf296 wrote: | I get a timeout error on the PBP and replay. Sometimes the colors show up and sometimes they don't. I changed the Include address to:
http://goallineblitz.com/game/replay.pl?* , so it should work every time.
If I go to my Home page in GLB and then refresh then for some reason the highlight usually comes back.
Any thoughts?
This, the YAC and the Pancake scripts are the only ones I run and this happens too if I only run the highlight script. |
I spent some time playing around with the script, and I'm pretty sure I've figured out what's causing this. Redownload and it should work normally again.
|
|
|