User Pass
Home Sign Up Contact Log In
Forum > Goal Line Blitz > Greasemonkey Scripts > Greasemonkey Scripts (original thread)
Page:
 
athrun340
offline
Link
 
wth am i doing wrong?? I cant get it to work..help?



window.setTimeout( function()
{
if(document.getElementById('player_id=256743')){
document.getElementById('player_id=256743').innerHTML = '<img src="http://pics1.frozenbear.com/i/picfu1/2008/06/03/13/1/7/7/177aa9117da306c6b01ea5456c68b6630_main.jpg">';
}
}
)
 
RandomBeast
offline
Link
 
leave out the playerid= and just use the number
 
DaRealest
offline
Link
 
Originally posted by RandomBeast
You should be somewhat familiar with Greasemonkey to do this, as you will in essence be creating your own script for your player.

Now before we get started, you'll need to find the player ID of who you want to track on the replay. You can do that by clicking on any of your players on your home page. You'll see their ID at the end of the URL: "player_id=265367" or something. Save that number.

You'll also need a 16x16 image you want to show up for your player.

I'm using just a colored red circle with my player's initial on it, but you can put anything really. Just make sure it is 16x16 so it fits with the others in the replay. It should have some transparency if you want to make it a circle. Upload it to a server somewhere and save that URL.

Now, in Firefox go to Tools>Greasemonkey>New User Script...

For name, enter the name of your player
Put anything for Namespace (I put GLB for GoalLineBlitz)
You can put any description. Something like "Custom icon on replay for player XYZ"
For the includes, remove anything currently there, and add "http://goallineblitz.com/game/replay.pl?pbp_id=*" (no quotes)

It may ask you to browse for a text editor if you don't have one associated - browse to notepad or something similar.

It will open up a text file with a few lines at the top. Underneath those, put the following code:

window.setTimeout( function()
{
if(document.getElementById('#######')){
document.getElementById('#######').innerHTML = '<img src="http://www.whatever.com/imageurl.png">';
}
}
)

Replace the ###### in the two places with your player user ID you saved earlier. Replace the URL with the path to your image. Save that file. Next time you watch a replay, your player will have a custom icon.


This works GREAT!!

Here are some of the images that I'm using for my players:

http://i40.photobucket.com/albums/e204/Da_Realest069/predator_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/avp1_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/findingnemo2_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/findingnemo3_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/findingnemo5_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/mortalkombat3_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/internet_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/mydocuments_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/superman_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/spiderman_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/autobots_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/decept_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/megatron_16.png

http://i40.photobucket.com/albums/e204/Da_Realest069/optimus_16.png
 
athrun340
offline
Link
 
yea nice script randombeast

btw im using this one

http://www.maploco.com/maps/dots/red-circle.png

transparent background .. works perfectly
 
manic
online
Link
 
You can include the image within the script also..

go to http://www.greywyvern.com/code/php/binary2base64
put the location of the image you want to use in the URI box and click submit query
copy the the results and use it as your image url instead of http://whatever

I tried posting the code snippet with the image data included but it screws up the forum formatting, but if you want to see the code with the red-circle.png from the post above look at http://www.fantasymvp.net/redcircle.txt
Last edited Jun 4, 2008 03:32:11
 
RandomBeast
offline
Link
 
Nice tip, manic.
 
TaintStick
offline
Link
 
Originally posted by athrun340
yea nice script randombeast

btw im using this one

http://www.maploco.com/maps/dots/red-circle.png

transparent background .. works perfectly


Another noob question...How did you change to background to transparent? Is it with the image editing software you use? I just use MSPaint, so probably why I can't figure it out. *faceslap* Any tips on different software to use?
Last edited Jun 4, 2008 07:24:41
 
Firenze
offline
Link
 
Brilliant script. I'm using a picture of a little dude.

http://dotnetslackers.com/dnsImages/user8_16x16.gif

Here's him in action (looks really cool);

http://i26.tinypic.com/15h02o5.png


Edit: Also knocked up a quick 16 x 16 stick man

http://i30.tinypic.com/nb18j.png
Last edited Jun 4, 2008 07:52:36
 
DaRealest
offline
Link
 
Originally posted by TaintStick
Originally posted by athrun340

yea nice script randombeast

btw im using this one

http://www.maploco.com/maps/dots/red-circle.png

transparent background .. works perfectly


Another noob question...How did you change to background to transparent? Is it with the image editing software you use? I just use MSPaint, so probably why I can't figure it out. *faceslap* Any tips on different software to use?


Yes, it's the software, such as GIMP or Photoshop.
 
RandomBeast
offline
Link
 
Paint.net is free and very powerful. http://www.getpaint.net/
 
Forest21
offline
Link
 
That's a great script RandomBeast. I actually made one based on that technique which can be used in conjuction with yours-

"Highlight Players"

Highlights a player on the replay screen by activating an icon to the left of the players name on the right sign of the screen. Will save the state of the player for other plays and games.

Example - http://img72.imageshack.us/img72/2777/highlightexampleee8.png
Script - (Removed due to reported bugs)
Last edited Jun 4, 2008 10:58:56
 
TaintStick
offline
Link
 
Originally posted by Forest21
That's a great script RandomBeast. I actually made one based on that technique which can be used in conjuction with yours-

"Highlight Players"

Highlights a player on the replay screen by activating an icon to the left of the players name on the right sign of the screen. Will save the state of the player for other plays and games.

Example - http://img72.imageshack.us/img72/2777/highlightexampleee8.png
Script - http://userscripts.org/scripts/show/27798


Very nice.
Last edited Jun 4, 2008 09:07:23
 
athrun340
offline
Link
 
Originally posted by Forest21
That's a great script RandomBeast. I actually made one based on that technique which can be used in conjuction with yours-

"Highlight Players"

Highlights a player on the replay screen by activating an icon to the left of the players name on the right sign of the screen. Will save the state of the player for other plays and games.

Example - http://img72.imageshack.us/img72/2777/highlightexampleee8.png
Script - http://userscripts.org/scripts/show/27798


the players on the replay stop moving when i installed the script
 
Forest21
offline
Link
 
Well that's not good. Did you refresh the page after install?
 
athrun340
offline
Link
 
Originally posted by Forest21
Well that's not good. Did you refresh the page after install?


yes
 
Page:
 


You are not logged in. Please log in if you want to post a reply.