rs-highscores-verkrijgen

Gesponsorde koppelingen

PHP script bestanden

  1. rs-highscores-verkrijgen

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
<?php
/*
__++====Runescape Highscorescript 1.0====++__
This class gets every lvl 30+ stat from any player, it can check level, exp and place in highscores.
I also build in a function to check how much exp someone is from a certain level.

Getskill function($player,$skill,$mode)
$player = The runescape name of the player you want the stat from
$skill = The skill you want the stat from
$mode = 0 or empty to get level, 1 to get exp, 2 to get place in highscores

Expleft function
$currentexp = the current exp of the player
$goal = the lvl you want to calculate for how much exp it is from current amount of exp.

If you have any questions, mail me: t e u n e b o o n [@] g m a i l {dot} com
*/

class highscores {
    function
getskill($player,$skill,$mode) {
        $skills = array("Overall","Attack","Defence","Strenght","Hitpoints","Ranged","Prayer","Magic","Cooking","Woodcutting","Fletching","Fishing","Firemaking","Crafting","Smithing","Mining","Herblore","Agility","Thieving","Slayer","Farming","Runecrafting","Hunter","Construction");
        $link = "http://hiscore.runescape.com/index_lite.ws?player=".$player;
        $contents = nl2br(file_get_contents($link));
        $contents = str_replace('<br />',',',$contents);
        $contents = str_replace('-1','1000000+',$contents);
        $stats = explode(',',$contents);
        $nrskill = array_search($skill,$skills);
        if($nrskill !== FALSE) {
            switch ($mode) {
                case
0;
                    return $stats[($nrskill*3)+1];
                    break;
                case
1;
                    return $stats[($nrskill*3)+2];
                    break;
                case
2;
                    return $stats[$nrskill*3];
                    break;
                default;

                    return $stats[($nrskill*3)+1];
                    break;
            }
        }
else {
            return "Unknown skill";
        }
    }
    function
expleft($currentexp,$goal) {
        $a=0;
        for($b=1; $x<$goal; $b++) {
            $a += floor($b+300*pow(2, ($b/7)));
        }

        $expneeded = floor($a/4);
        $expleft = $expneeded-$currentexp;
        return $expleft;
    }
}

/*
Example:
$example = new highscores;
$exphunter = $example->getskill("zezima","Magic",1);
echo $example->expleft($exphunter,99);
*/

?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.