• Log in or sign up for an account here: https://www.sythe.org/login

[PHP] Dynamic Signature Help

  • Thread starter Thread starter RuneOwn
  • Start date Start date
R

RuneOwn

Guest
Okay, ive been trying to make some dynamic signatures for runescape. Ive been using google and ive learnt how to make dynamic signatures. The only thing is i dont have a clue of how to get the data from the runescape highscores. A bit of a nudge in the correct direction would be great. Thanks

~RuneOwn
 
Learn sockets and open the webpage, use either regex or split the page into parts and there you have your information.
 
Well I dont know, if you still need this, but:

You first need to check if allow_url_fopen is enabled (it needs to be)

next you can use the fopen() function to open a url so something like
Code:
$stats = fopen("http://hiscore.runescape.com/hiscorepersonal.ws?user1="$username, r);
$stats2 = strip_tags($stats);
this strips the html/php tags the site may use. So now all you have is a bunch of text like Attack 15 Defense 25... blah blah
then you can split it into an array using str_split($stats2); and then look at the stats you want through the array...

you should probaby close the file too to save memory.... Hope this nudge helps, you can aim me if you need help.
 
What I personally would do is use regex. It'll give you more control than using a split. You can also use file_get_contents() to grab the source. I also replace the newlines in the source.

In case you don't feel like taking on regex - which only looks difficult, but is easy - this is the search string I use for the highscores:
/.*($skill)<\/a><\/td><td align=\"right\">([0-9,]*)<\/td><td align=\"right\">([0-9]*)<\/td><td align=\"right\">([0-9,]*).*/i

In conjunction with preg_replace, $1 is the skill, $2 is your rank, $3 is your level, and $4 is your exp.

Here is an example for you:
http://script-dump.freehostia.com/data.php?user=zezima
 
What I personally would do is use regex. It'll give you more control than using a split. You can also use file_get_contents() to grab the source. I also replace the newlines in the source.

In case you don't feel like taking on regex - which only looks difficult, but is easy - this is the search string I use for the highscores:
/.*($skill)<\/a><\/td><td align=\"right\">([0-9,]*)<\/td><td align=\"right\">([0-9]*)<\/td><td align=\"right\">([0-9,]*).*/i

In conjunction with preg_replace, $1 is the skill, $2 is your rank, $3 is your level, and $4 is your exp.

Here is an example for you:
http://script-dump.freehostia.com/data.php?user=zezima

hey i tired that and it didnt work can u help me?
 
Runescape Gamblingrunescape gambling
Back
Top