Archive for glbscripts.myfreeforum.org Forum dedicated to Greasemonkey Scripts made for Goal Line Blitz online game.
 



       glbscripts.myfreeforum.org Forum Index -> Modified Scripts
Knut the Bruin

Usefull Update for the Player Position Notes Script

if you use that script and you dont have the playerid in your notes-array it will replace the position anyways with "undefined"

so - mainly on the player pages of other players - you will see "undefined <playername>" instead of "(OT) <playername>" - imho not usefull on player pages from players you dont own...

so i made the following changes to the source code:

replace
Code:
playername[i].innerHTML = playername[i].innerHTML.replace(matches[0].replace(re, "$3"),  notes[playerId]);

with
Code:
if(typeof(notes[playerId]) != "undefined"){
   playername[i].innerHTML = playername[i].innerHTML.replace(matches[0].replace(re, "$3"), notes[playerId]);
}

and replace
Code:
player_name.innerHTML = player_name.innerHTML.replace(matches[0].replace(re, "$1"),  notes[currentId]);

with
Code:
if(typeof(notes[currentId]) != "undefined"){
   player_name.innerHTML = player_name.innerHTML.replace(matches[0].replace(re, "$1"), notes[currentId]);
}


now the original glb position tag is only replaced if the script has found a valid custom tag for that player number.

i dont know if you find it usefull but ill enjoy any kind of reply

greets
Knut
Knut the Bruin

another short update...on the players profile page the custom note replaces everything except the last string...eg (OT) Firstname Lastname would become (custom note) Lastname - thats not a big deal as you can see the full name right below the glb main menue bar...but its something cosmetically too Smile

replace
Code:
var re = /(.+)\s(.+)/g;

with
Code:
var re = /(\(.+\))\s(.+)/g;


greets

       glbscripts.myfreeforum.org Forum Index -> Modified Scripts
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum