Adblock breaks this site

I don't know what this code's for

Discussion in 'Web Programming' started by Deacon Frost, Feb 7, 2007.

  1. Deacon Frost

    Deacon Frost Grand Master
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57
    I don't know what this code's for

    Code:
    <?php
    //$server="69.22.158.241";
    function shorten($y) {
            switch($y) {
                    case "Overall": return "Over";
                    case "Attack": return "Att";
                    case "Defence": return "Def";
                    case "Strength": return "Str";
                    case "Hitpoints": return "HP";
                    case "Ranged": return "Range";
                    case "Prayer": return "Pray";
                    case "Magic": return "Mage";
                    case "Cooking": return "Cook";
                    case "Woodcutting": return "Woodcut";
                    case "Fletching": return "Fletch";
                    case "Fishing": return "Fish";
                    case "Firemaking": return "Fire";
                    case "Crafting": return "Craft";
                    case "Smithing": return "Smith";
                    case "Mining": return "Mining";
                    case "Herblore": return "Herb";
                    case "Agility": return "Agil";
                    case "Thieving": return "Thieve";
                    case "Slayer": return "Slayer";
                    case "Farming": return "Farm";
                    case "Runecraft": return "Rune";
                    case "Construction": return "Const";
    
            }
    }
    $server="hiscore.runescape.com";
    $type=$_GET['type'];
    $name=$_GET['name'];
    $regex="/<td align=\"left\"><a href=\"(.+?)\">\n([A-Za-z0-9]+?)\n<\/a><\/td>\n<td align=\"right\">([0-9,]+?)<\/td>\n<td align=\"right\">([0-9,]+?)<\/td>\n<td align=\"right\">([0-9,]+?)<\/td>\n<\/tr>/i";
    $data="";
            $socket=fsockopen("64.90.181.252", 80, $errno, $errstr, 30);
            if (!$socket) {
                    die("Sorry, an error occured: $errno [ $errstr ]");
            }
            else {
                    $out = "GET /hiscorepersonal.ws?user1=$name HTTP/1.0\r\n";
                    $out .= "Host: hiscore.runescape.com\r\n";
                    $out .= "Connection: Close\r\n\r\n";
                    fwrite($socket,$out);
                    while (!feof($socket)) {
                            $data.=fgets($socket,4096);
                    }
                    fclose($socket);
                    //flush out some shit
                    //unset($out); unset($socket); unset($server); unset($type); unset($name);
                    //parse the output
                    preg_match_all($regex,$data,$m);
            $c=0;
            if ($type=="level") {
                    foreach ($m[2] as $statname => $x) {
                            if ($c!=0) {
                            echo " | ";
                            }
                            $c++;
                            echo $x. ": " . $m[4][$statname];
                    }
            }
            if ($type=="exp") {
                    foreach ($m[2] as $statname => $x) {
                            if ($c!=0) {
                            echo " | ";
                            }
                            $c++;
                            echo $x. ": " . $m[5][$statname];
                    }
            }
            if ($type=="rank") {
                    foreach ($m[2] as $statname => $x) {
                            if ($c!=0) {
                            echo " | ";
                            }
                            $c++;
                            echo  $x. ": " . $m[3][$statname];
                    }
            }
    
            }
            //unset($m); unset($regex); unset($data);
    
    ?>
    












    i found that on http://de.pastebin.ca/292822, after I typed runescapes IP address in google
     
  2. Govind

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus
    I don't know what this code's for

    That looks like a PHP stat calculator.

    Moving to Other Languages...
     
  3. Deacon Frost

    Deacon Frost Grand Master
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57
    I don't know what this code's for

    ok.. so that means? I've heard of PHP, don't understand it at all.. but how is it effective?

    Thanks for the move BTW ;)
     
  4. coach thorpe

    coach thorpe Guru
    Banned

    Joined:
    Dec 21, 2005
    Posts:
    1,621
    Referrals:
    3
    Sythe Gold:
    0
    I don't know what this code's for

    Where did you get this, yes I believe it is a stat calc )_) can get you how much xp you need for a certain stat
     
  5. Deacon Frost

    Deacon Frost Grand Master
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57
    I don't know what this code's for

    Like I said, I pinged runescape... got the IP address, typed the ip address into google (simply for kicks) and that site popped up..

    really, how much EXP huh? I thought those weren't existant, so that means this probably doesn't work correct?

    And if it does.. will someone elightment me as to how, and what to do :p..

    At the site, however, they had the option to submit an edit for this code, so it looks to be put together by different people.
     
  6. Deacon Frost

    Deacon Frost Grand Master
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57
    I don't know what this code's for

    so anymore info as to what its for? and how to use it, and if its legit?
     
  7. Perfect Idol

    Perfect Idol Guest

    Referrals:
    1
    I don't know what this code's for

    It's a high score lookup script. It just returns a string of statistics (like attack, defense, and strength levels) on whatever user the site visitor is interested in. It's not very well coded, so I doubt it still works.
     
  8. pescados666

    pescados666 Forum Addict
    Do Not Trade

    Joined:
    Jan 21, 2007
    Posts:
    502
    Referrals:
    1
    Sythe Gold:
    0
    I don't know what this code's for

    looks like it gets the stats from runescape.
     
  9. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    I don't know what this code's for

    Thanks captain obvious, that's been stated already! What we do without your 1337 skillz?

    Anyways...

    Find a host that supports php, upload that scripts through whatever they support with a .php extension, and open it up in your browser, and that should work.
     
  10. T-Trader

    T-Trader Member

    Joined:
    Mar 15, 2007
    Posts:
    92
    Referrals:
    0
    Sythe Gold:
    0
    I don't know what this code's for

    Thanks for it man, it will save some time when I code my RuneScape website :)
     
< [PHP] IP Grabbing Script [SCRIPT] | Rate my Clan Site >


 
 
Adblock breaks this site