Free Games Forum
Free Games Games Forums Music Forums TV Forums

  Free Games Forum Home FORUM
HOME
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN
Rules & FAQ RULES / FAQ
REPORT SPAM

Free Games Forum: Game Technology: PHP Forum:
PHP source for hiscore lookup

 

 


Cruel__Machine
Senior Member


Apr 26, 2005, 10:48 AM

Post #1 of 11 (1142 views)
Shortcut
PHP source for hiscore lookup Can't Post

I like making code as compressed as possible. So don't expect lengthy commented code from me. If you have questions post them and I'll answer if I feel like it :P

BTW, the key of this code is in the parse function. Took me like 90 minutes to write lol (mostly because it was midnight :P). And, depending on the config of ur server, you may have to adjust some of the numbers in the function. The number that you'd have to change would prolly be the "- 7". Because it works on my webserver now (obviously), but I tested it on my personal apache server on my comp and it didn't display the correct two characters.


Code
<?php $handle = fopen("http://hiscore.runescape.com/aff/runescape/hiscorepersonal.cgi?username=".$_GET['name'],"r"); 
if($handle){
while (!feof($handle)) {
$contents .= fread($handle, 8192);}
fclose($handle);}
function parse($skill){
return substr(strstr($GLOBALS['contents'], '>'.$skill.'<'), strrpos(substr(strstr($GLOBALS['contents'], '>'.$skill.'<'), 1, 90), "</td><td align=") - 7, 2);}
echo parse(Attack).'|'.parse(Strength).'|'.parse(Defence).'|'.parse(Hitpoints).'|'.parse(Ranged).'|'.parse(Prayer).'|'.parse(Magic).'|'.parse(Cooking).'|'.parse(Woodcutting).'|'.parse(Fletching).'|'.parse(Fishing).'|'.parse(Firemaking).'|'.parse(Crafting).'|'.parse(Smithing).'|'.parse(Mining).'|'.parse(Herblore).'|'.parse(Agility).'|'.parse(Thieving).'|'.parse(Slayer).'|'.parse(Runecrafting);?>


Link for sample page: http://vtforce.com/test/htmlparse.php?name=zezima

(sorry for the stretching of the page, I couldn't fix :P)


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net

(This post was edited by Cruel__Machine on Apr 26, 2005, 10:51 AM)



coolgreen44
Senior Member

Apr 27, 2005, 11:49 AM

Post #2 of 11 (1125 views)
Shortcut
Re: [Cruel__Machine] PHP source for hiscore lookup [In reply to] Can't Post

99|99|99|99|99|97|99|99|99|99|99|99|99|99|99|99|99|99|90|99

thats what u get on the sample link


Cybernations


Cruel__Machine
Senior Member


Apr 27, 2005, 2:27 PM

Post #3 of 11 (1128 views)
Shortcut
Re: [Cruel__Machine] PHP source for hiscore lookup [In reply to] Can't Post

Yop, and if you change the name, the stats update accordingly.

Also try this link out:
http://vtforce.com/test/image/htmlparse2.php?name=zezima

change name to get a dynamic sig to render :)
Almost done with it...


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net

(This post was edited by Cruel__Machine on Apr 29, 2005, 12:09 PM)


coolgreen44
Senior Member

Apr 29, 2005, 9:45 AM

Post #4 of 11 (1124 views)
Shortcut
Re: [Cruel__Machine] PHP source for hiscore lookup [In reply to] Can't Post

oh i was confused i get it now its all good nvm


Cybernations


loco
Newbie

Dec 13, 2005, 5:31 AM

Post #5 of 11 (684 views)
Shortcut
Re: [Cruel__Machine] PHP source for hiscore lookup [In reply to] Can't Post

Any ideas how to get Combat level?


Cruel__Machine
Senior Member


Dec 13, 2005, 6:31 AM

Post #6 of 11 (682 views)
Shortcut
Re: [loco] PHP source for hiscore lookup [In reply to] Can't Post


In Reply To
Any ideas how to get Combat level?



You'd have to lookup the stats and calculate them accordingly. But it'd only work for ppl who are high combat levels. Since it's impossible to determine a low level since they are not in highscores... :roll:

BTW, here are the updated links for this old post:

http://cruels.net/hiscore.php?name=Zezima
http://cruels.net/hiscore.txt


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net


I_M_Dead1234
Senior Member


Dec 13, 2005, 1:41 PM

Post #7 of 11 (676 views)
Shortcut
Re: [Cruel__Machine] PHP source for hiscore lookup [In reply to] Can't Post

can you give me the PHP document, so I can put it on my site, I don't wanna hotlink to yours.



RuneScape:Neon Zidane1(my friend's)
Cleowin Resources-My schoolmate's new forum
My forum- 200+Members-Recuriting Mods,Join and PM me


Cruel__Machine
Senior Member


Dec 14, 2005, 1:23 PM

Post #8 of 11 (670 views)
Shortcut
Re: [I_M_Dead1234] PHP source for hiscore lookup [In reply to] Can't Post


In Reply To
can you give me the PHP document, so I can put it on my site, I don't wanna hotlink to yours.

^^The text docuemtn I posted above is the complete source.
Just change the file extension to .php


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net


I_M_Dead1234
Senior Member


Dec 14, 2005, 2:12 PM

Post #9 of 11 (668 views)
Shortcut
Re: [Cruel__Machine] PHP source for hiscore lookup [In reply to] Can't Post

Learning PHP hard?



RuneScape:Neon Zidane1(my friend's)
Cleowin Resources-My schoolmate's new forum
My forum- 200+Members-Recuriting Mods,Join and PM me


Cruel__Machine
Senior Member


Dec 15, 2005, 10:49 AM

Post #10 of 11 (661 views)
Shortcut
Re: [I_M_Dead1234] PHP source for hiscore lookup [In reply to] Can't Post

web languages are ub3r easy. ;)

But I only learn it so quickly because I already knew a handful of languages.


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net


I_M_Dead1234
Senior Member


Dec 15, 2005, 4:08 PM

Post #11 of 11 (657 views)
Shortcut
Re: [Cruel__Machine] PHP source for hiscore lookup [In reply to] Can't Post

Yep, web languages are easy. You can understand the basics of HTML easily, and it would only take a short wile to learn more...Javascript coding, C++, etc. are HARD!



RuneScape:Neon Zidane1(my friend's)
Cleowin Resources-My schoolmate's new forum
My forum- 200+Members-Recuriting Mods,Join and PM me

 
 
 


Search for (options) Web Design by Web Ideas - Page loaded in: 0.19 s on (CGI/1.1)