I don't know what this code's for

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

I don't know what this code's for
  1. Unread #1 - Feb 7, 2007 at 1:34 PM
  2. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    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
     
  3. Unread #2 - Feb 7, 2007 at 1:40 PM
  4. Govind
    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

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    I don't know what this code's for

    That looks like a PHP stat calculator.

    Moving to Other Languages...
     
  5. Unread #3 - Feb 7, 2007 at 1:44 PM
  6. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    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 ;)
     
  7. Unread #4 - Feb 7, 2007 at 3:01 PM
  8. coach thorpe
    Joined:
    Dec 21, 2005
    Posts:
    1,621
    Referrals:
    3
    Sythe Gold:
    0

    coach thorpe Guru
    Banned

    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
     
  9. Unread #5 - Feb 8, 2007 at 10:23 AM
  10. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    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.
     
  11. Unread #6 - Feb 14, 2007 at 8:29 PM
  12. Deacon Frost
    Joined:
    Jan 30, 2007
    Posts:
    2,905
    Referrals:
    3
    Sythe Gold:
    57

    Deacon Frost Grand Master
    Banned

    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?
     
  13. Unread #7 - Feb 27, 2007 at 2:56 AM
  14. Perfect Idol
    Referrals:
    1

    Perfect Idol Guest

    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.
     
  15. Unread #8 - Mar 12, 2007 at 2:28 PM
  16. pescados666
    Joined:
    Jan 21, 2007
    Posts:
    502
    Referrals:
    1
    Sythe Gold:
    0

    pescados666 Forum Addict
    Do Not Trade

    I don't know what this code's for

    looks like it gets the stats from runescape.
     
  17. Unread #9 - Mar 12, 2007 at 5:02 PM
  18. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    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.
     
  19. Unread #10 - Mar 17, 2007 at 2:43 AM
  20. T-Trader
    Joined:
    Mar 15, 2007
    Posts:
    92
    Referrals:
    0
    Sythe Gold:
    0

    T-Trader Member

    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 >

Users viewing this thread
1 guest


 
 
Adblock breaks this site