SHARE
TWEET

OSRS Highscores V2

a guest Jul 21st, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $name = "yourusernamehere";
  3.         $rawdata = file_get_contents("https://secure.runescape.com/m=hiscore_oldschool/index_lite.ws?player=".$name);
  4.         $name = ucwords($name);
  5.         if (!$rawdata == "")
  6.         {
  7.             $data = str_replace("-1", "0", $rawdata);
  8.             $SplitSkill = explode("\n",$data);
  9.  
  10.             $Overall = explode(",",$SplitSkill[0]);
  11.             $Attack = explode(",",$SplitSkill[1]);
  12.             $Defence = explode(",",$SplitSkill[2]);
  13.             $Strength = explode(",",$SplitSkill[3]);
  14.             $Hitpoints = explode(",",$SplitSkill[4]);
  15.             $Ranged= explode(",",$SplitSkill[5]);
  16.             $Prayer = explode(",",$SplitSkill[6]);
  17.             $Magic= explode(",",$SplitSkill[7]);
  18.             $Cooking = explode(",",$SplitSkill[8]);
  19.             $Woodcutting = explode(",",$SplitSkill[9]);
  20.             $Fletching = explode(",",$SplitSkill[10]);
  21.             $Fishing = explode(",",$SplitSkill[11]);
  22.             $Firemaking = explode(",",$SplitSkill[12]);
  23.             $Crafting = explode(",",$SplitSkill[13]);
  24.             $Smithing = explode(",",$SplitSkill[14]);
  25.             $Mining = explode(",",$SplitSkill[15]);
  26.             $Herblore = explode(",",$SplitSkill[16]);
  27.             $Agility = explode(",",$SplitSkill[17]);
  28.             $Thieving = explode(",",$SplitSkill[18]);
  29.             $Slayer = explode(",",$SplitSkill[19]);
  30.             $Farming = explode(",",$SplitSkill[20]);
  31.             $Runecrafting = explode(",",$SplitSkill[21]);
  32.             $Hunter = explode(",",$SplitSkill[22]);
  33.             $Construction = explode(",",$SplitSkill[23]);
  34.            
  35.             for ($i=0; $i<=1; $i++)
  36.             {
  37.             $Overall[$i] = number_format($Overall[$i]);
  38.             $Attack[$i] = number_format($Attack[$i]);
  39.             $Defence[$i] = number_format($Defence[$i]);
  40.             $Strength[$i] = number_format($Strength[$i]);
  41.             $Hitpoints[$i] = number_format($Hitpoints[$i]);
  42.             $Ranged[$i] = number_format($Ranged[$i]);
  43.             $Prayer[$i] = number_format($Prayer[$i]);
  44.             $Magic[$i] = number_format($Magic[$i]);
  45.             $Cooking[$i] = number_format($Cooking[$i]);
  46.             $Woodcutting[$i] = number_format($Woodcutting[$i]);
  47.             $Fletching[$i] = number_format($Fletching[$i]);
  48.             $Fishing[$i] = number_format($Fishing[$i]);
  49.             $Firemaking[$i] = number_format($Firemaking[$i]);
  50.             $Crafting[$i] = number_format($Crafting[$i]);
  51.             $Smithing[$i] = number_format($Smithing[$i]);          
  52.             $Mining[$i] = number_format($Mining[$i]);          
  53.             $Herblore[$i] = number_format($Herblore[$i]);          
  54.             $Agility[$i] = number_format($Agility[$i]);        
  55.             $Thieving[$i] = number_format($Thieving[$i]);          
  56.             $Slayer[$i] = number_format($Slayer[$i]);          
  57.             $Farming[$i] = number_format($Farming[$i]);        
  58.             $Runecrafting[$i] = number_format($Runecrafting[$i]);          
  59.             $Hunter[$i] = number_format($Hunter[$i]);          
  60.             $Construction[$i] = number_format($Construction[$i]);
  61.             }
  62.         }
  63.            
  64.             $list = [
  65.     ["skill" => "Attack", "level" => $Attack[1]],
  66.     ["skill" => "Defence", "level" => $Defence[1]],
  67.     ["skill" => "Strength", "level" => $Strength[1]],
  68.     ["skill" => "Hitpoints", "level" => $Hitpoints[1]],
  69.     ["skill" => "Ranged", "level" => $Ranged[1]],
  70.     ["skill" => "Prayer", "level" => $Prayer[1]],
  71.     ["skill" => "Magic", "level" => $Magic[1]],
  72.     ["skill" => "Cooking", "level" => $Cooking[1]],
  73.     ["skill" => "Woodcutting", "level" => $Woodcutting[1]],
  74.     ["skill" => "Fletching", "level" => $Fletching[1]],
  75.     ["skill" => "Fishing", "level" => $Fishing[1]],
  76.     ["skill" => "Firemaking", "level" => $Firemaking[1]],
  77.     ["skill" => "Crafting", "level" => $Crafting[1]],
  78.     ["skill" => "Smithing", "level" => $Smithing[1]],
  79.     ["skill" => "Mining", "level" => $Mining[1]],
  80.     ["skill" => "Herblore", "level" => $Herblore[1]],
  81.     ["skill" => "Agility", "level" => $Agility[1]],
  82.     ["skill" => "Thieving", "level" => $Thieving[1]],
  83.     ["skill" => "Slayer", "level" => $Slayer[1]],
  84.     ["skill" => "Farming", "level" => $Farming[1]],
  85.     ["skill" => "Runecrafting", "level" => $Runecrafting[1]],
  86.     ["skill" => "Hunter", "level" => $Hunter[1]],
  87.     ["skill" => "Construction", "level" => $Construction[1]]
  88. ];
  89. $filename = "playerLevels.csv";
  90. $fp = fopen($filename, 'w');
  91. fputcsv($fp, array_keys($list[0]));
  92. foreach ($list as $fields) {
  93.     fputcsv($fp, $fields);
  94. }
  95. fclose($fp);
  96.             ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top