glbscripts.myfreeforum.org Forum Index glbscripts.myfreeforum.org
Forum dedicated to Greasemonkey Scripts made for Goal Line Blitz online game.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   Join! (free) Join! (free)
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Usefull Update for the Player Position Notes Script

 
Post new topic   Reply to topic    glbscripts.myfreeforum.org Forum Index -> Modified Scripts
View previous topic :: View next topic  
Author Message
Knut the Bruin



Joined: 19 Jul 2008
Posts: 2

PostPosted: Sat Jul 19, 2008 12:19 pm    Post subject: Usefull Update for the Player Position Notes Script Reply with quote

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


Back to top
View user's profile Send private message MSN Messenger
Knut the Bruin



Joined: 19 Jul 2008
Posts: 2

PostPosted: Sun Jul 20, 2008 5:22 pm    Post subject: Reply with quote

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


Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    glbscripts.myfreeforum.org Forum Index -> Modified Scripts All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Create your own free forum | Buy a domain to use with your forum