runescape-level-lookup
Gesponsorde koppelingen
PHP script bestanden
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
error_reporting(E_ALL);
function GetRSstats($username,&$result)
{
# Return: Boolean
# And an empty array in your second parameter on failure, or filled with the skills on success.
# Please note; no support is given.
/*
###
### Made By Chessspider ( www.chessspider.nl - 2007© )
###
### Please leave this notice here. If you really want to make me happy, also put a link to my runescape world switcher:
### http://worldswitcher.chessspider.nl/
### on your website.
*/
# You might have to update these some day...
$arrSkills = array(
"Total",
"Attack",
"Defence",
"Strength",
"Hitpoints",
"Ranged",
"Prayer",
"Magic",
"Cooking",
"Woodcutting",
"Fletching",
"Fishing",
"Firemaking",
"Crafting",
"Smithing",
"Mining",
"Herblore",
"Agility",
"Thieving",
"Slayer",
"Farming",
"Runecraft",
"Hunter",
"Construction",
"Summoning"
); // Skills... Order DOES matter, it should always be the same order as the highscores page.
$sDomain = "http://hiscore.runescape.com/"; // With trailing /
$sPage = "index_lite.ws?player="; // Page to request
# You shouldnt have to change anything from here
$arrLevels = @file($sDomain.$sPage.urlencode($username),FILE_IGNORE_NEW_LINES); // Obtaining scores, surpressing possible warnings
$result = Array();
if($arrLevels === false || empty($username) || strlen($username) > 15)
return false;
$iLength = count($arrSkills);
for($i = 0;$i < $iLength;$i++)
{
$levels = explode(",",$arrLevels[$i]);
$arrStats[$arrSkills[$i]]["skill"] = $arrSkills[$i];
$arrStats[$arrSkills[$i]]["rank"] = $levels[0];
$arrStats[$arrSkills[$i]]["level"] = $levels[1];
$arrStats[$arrSkills[$i]]["exp"] = $levels[2];
}
$result = $arrStats;
return true;
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Stat lookup</title>
</head>
<body>
<?php
if(GetRSstats("ChessSpider",$stats))
{
echo "<table width=400>\n<tr><th>Skill</th><th>Rank</th><th>Level</th><th>XP</th></tr>\n";
foreach($stats as $values)
echo "<tr><td>".$values['skill']."</td><td>".$values['rank']."</td><td>".$values['level']."</td><td>".$values['exp']."</td></tr>\n";
echo "</table>\n";
}
else
{
echo "Username does not exist";
}
?>
</body>
</html>
error_reporting(E_ALL);
function GetRSstats($username,&$result)
{
# Return: Boolean
# And an empty array in your second parameter on failure, or filled with the skills on success.
# Please note; no support is given.
/*
###
### Made By Chessspider ( www.chessspider.nl - 2007© )
###
### Please leave this notice here. If you really want to make me happy, also put a link to my runescape world switcher:
### http://worldswitcher.chessspider.nl/
### on your website.
*/
# You might have to update these some day...
$arrSkills = array(
"Total",
"Attack",
"Defence",
"Strength",
"Hitpoints",
"Ranged",
"Prayer",
"Magic",
"Cooking",
"Woodcutting",
"Fletching",
"Fishing",
"Firemaking",
"Crafting",
"Smithing",
"Mining",
"Herblore",
"Agility",
"Thieving",
"Slayer",
"Farming",
"Runecraft",
"Hunter",
"Construction",
"Summoning"
); // Skills... Order DOES matter, it should always be the same order as the highscores page.
$sDomain = "http://hiscore.runescape.com/"; // With trailing /
$sPage = "index_lite.ws?player="; // Page to request
# You shouldnt have to change anything from here
$arrLevels = @file($sDomain.$sPage.urlencode($username),FILE_IGNORE_NEW_LINES); // Obtaining scores, surpressing possible warnings
$result = Array();
if($arrLevels === false || empty($username) || strlen($username) > 15)
return false;
$iLength = count($arrSkills);
for($i = 0;$i < $iLength;$i++)
{
$levels = explode(",",$arrLevels[$i]);
$arrStats[$arrSkills[$i]]["skill"] = $arrSkills[$i];
$arrStats[$arrSkills[$i]]["rank"] = $levels[0];
$arrStats[$arrSkills[$i]]["level"] = $levels[1];
$arrStats[$arrSkills[$i]]["exp"] = $levels[2];
}
$result = $arrStats;
return true;
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Stat lookup</title>
</head>
<body>
<?php
if(GetRSstats("ChessSpider",$stats))
{
echo "<table width=400>\n<tr><th>Skill</th><th>Rank</th><th>Level</th><th>XP</th></tr>\n";
foreach($stats as $values)
echo "<tr><td>".$values['skill']."</td><td>".$values['rank']."</td><td>".$values['level']."</td><td>".$values['exp']."</td></tr>\n";
echo "</table>\n";
}
else
{
echo "Username does not exist";
}
?>
</body>
</html>