Travian: Personal NAP Links v0.2 (pre release)

Last update on May 23, 2008

UNDER DEVELOPMENT: Provides links to your Personal NAP friends from your Player Description page, works like the Alliance page NAPs and Confederacies links.

Description

This script is still UNDER DEVELOPMENT and is as yet incomplete. This is my first attempt at writing a GreaseMonkey Script, so please be patient with me.

The goal of this project is to turn usernames that are listed as Personal NAP friends on your Player Description page into clickable links, just like the NAP and Confederacy links on the Alliance page, so that you can quickly link to your Personal NAP friends' profile.

Providing links between two friends profiles, what a novel idea! I wonder where I got this from. :-)

How it will work

  • Identify the beginning and end of a players name on the page, using a fixed demarcation character.
  • Generate the URL required to display the player's page.
  • Display the players name as a link.

Future enhancements

  • Make the demarcation character user definable.
  • Automatically insert the player's Alliance (with a link).
  • Automatically insert the player's current rank.

History

Bugs and incompatibilities

  • I foresee a problem with the demarcation character, if the Player Description page makes extensive use of ANSII Graphics, which may also contain the same demarcation character. The initial release version (v1.0) will have a fixed demarcation character of • (the bullet mark). Future releases will allow the user to customize which demarcation character they use, to overcome this issue.

Credits

  • Facebook, Bebo, MySpace, etc (for the idea), QP, dbKiller (for code snippets).




You could comment on this script if you were logged in.

9 comments Feed-icon

1 point
login to vote
Foxyhearts user
Posted Jun 17, 2008

A demarcation character can be anything that you choose to identify the limits of something. 
      For instance, I use the big round dot • as a demarcation character in my Player Profile, 
      so my profile contains a list of my friends, like this...
      
      •dbKiller•
      •FranMod•
      •WiCiO•
      •Zezuma•
      •Risi•
      •ChuckyBoy•
      

Uhm, you didn't specify any variable to define the demarcation character.

...and when the script finds the dot character, it then starts 
      loading everything after the dot character into a variable, until it 
      finds another occurance of the dot character. Then the script will 
      turn the name captured by the variable into a clickable link. Those 
      who have my script running will see a list of links, while those who 
      don't have the script running will just see names within big round dots, like above.

No it won't. The magic part of your script meant to transform the stuff in between the demarcation characters into a link looks like this:

 function transformPageProfile()
      {
      
      }

So beside the impressive copy and paste work of other scriptwriters, this script is not working at all. Get it to work and I testdrive it for you. Unless you wanted someone else to get your idea working - which could explain the posting of this momentarily worthless script at this moment.

1 point
login to vote
Zilogix script's author
Posted Jun 7, 2008

Yes, "waiting" is the operative word, sorry. I still haven't gotten around to finishing this script. It will not work as yet. I have listed it as "UNDER DEVELOPMENT" for a very good reason :-)

As an Alliance leader, and with a huge victory having just happened, I'm busy sorting out pledges from our former enemies, who are seeking mercy and assylum, and also arranging defenses against some who have decided to delete from the server that I'm playing on, and who are going out with a zerg rush. This is taking up a lot of my online time right now, sorting out the aftermath of our decisive victory, and I haven't had much time to work on this script. I do apologize, and will get it finished soon.

1 point
login to vote
Posted Jun 4, 2008

<<waiting>

1 point
login to vote
Posted Jun 2, 2008

Hi,
I tried adding the big dot at the beginning of the players name and at the end of the players name, but nothing happened!!
I list my friends name on my profile, surrounding their names with big dot, but nothing happened. It show the same big dot in the profile!!

1 point
login to vote
Posted Jun 1, 2008

ِahaa, I got it now,
Wow, it would be great,
I will try it now and see
brb

1 point
login to vote
Zilogix script's author
Posted May 30, 2008

Sure! A demarcation character can be anything that you choose to identify the limits of something. For instance, I use the big round dot • as a demarcation character in my Player Profile, so my profile contains a list of my friends, like this...

•dbKiller•
•FranMod•
•WiCiO•
•Zezuma•
•Risi•
•ChuckyBoy•

...and when the script finds the dot character, it then starts loading everything after the dot character into a variable, until it finds another occurance of the dot character. Then the script will turn the name captured by the variable into a clickable link. Those who have my script running will see a list of links, while those who don't have the script running will just see names within big round dots, like above.

1 point
login to vote
Posted May 25, 2008

hey,
would you tell me what do you mean by ( Demarcation character )
??
write it down for me.

1 point
login to vote
Zilogix script's author
Posted May 23, 2008

Hey, I am honored to have you leave the first comment on my very first attempt at writing a script! I love your work, and as you can see, I have already copied some of your code.

You are correct, people will need to use a format. All that I am suggesting is a demarcation character at the start and end of a player's name. Currently, on my own Player Description page I use the • (the bullet mark) before and after my Personal NAP friends names, and that is where I got the idea for this script. If I can search for that character, then copy the following characters until I next reach the demarcation character, then I will be able to fill a variable with a player name. Once I have that, then, as you say, I can search for the userid using code that already exists out there, and turn the name into a URL.

I'm a complete novice at GreaseMonkey scripting, so I appreciate any advice or tips you can give!

1 point
login to vote
QP scriptwright
Posted May 23, 2008

Hi,
I still am unsure about a couple of things on your script... I think you'll need people to edit their profiles to a specific format that this script then recognizes...

Then you can either make people insert also the userid OR search it in the statistics. If you go with this last option I would suggest you save the userid, playerName pair so you don't need to ask the server again the next time you go to your profile.

Well anyway... go luck with the script... I'm adding a couple of diplomacy stuff also on mine - but not personal diplomacy.

You could comment on this script if you were logged in.