Results 1 to 4 of 4

Thread: Get Stats from highscores

  1. #1
    Join Date
    Sep 2014
    Location
    Netherlands
    Posts
    264
    Mentioned
    11 Post(s)
    Quoted
    130 Post(s)

    Default Get Stats from highscores

    I needed to get the stats of the player before the script started. So I ended up with this little snippet. Could be useful for someone in the future, that's why I'm posting this. It'll retrieve the current experience and the current level.

    Simba Code:
    program highScores;
    {$DEFINE SMART}
    {$i srl-6/srl.simba}

    const
      HIGHSCORES_ATTACK = 1;
      HIGHSCORES_DEFENCE = 2;
      HIGHSCORES_STRENGTH = 3;
      HIGHSCORES_CONSTITUTION = 4;
      HIGHSCORES_RANGED = 5;
      HIGHSCORES_PRAYER = 6;
      HIGHSCORES_MAGIC = 7;
      HIGHSCORES_COOKING = 8;
      HIGHSCORES_WOODCUTTING = 9;
      HIGHSCORES_FLETCHING = 10;
      HIGHSCORES_FISHING = 11;
      HIGHSCORES_FIREMAKING = 12;
      HIGHSCORES_CRAFTING = 13;
      HIGHSCORES_SMITHING = 14;
      HIGHSCORES_MINING = 15;
      HIGHSCORES_HERBLORER = 16;
      HIGHSCORES_AGILITY = 17;
      HIGHSCORES_THIEVING = 18;
      HIGHSCORES_SLAYER = 19;
      HIGHSCORES_FARMING = 20;
      HIGHSCORES_RUNECRAFTING = 21;
      HIGHSCORES_HUNTER = 22;
      HIGHSCORES_CONSTRUCTION = 23;
      HIGHSCORES_SUMMONING = 24;
      HIGHSCORES_DUNGEONEERING = 25;
      HIGHSCORES_DIVINATION = 26;

    function getLevelHighScores(userName: string; skill: Integer): integer;
    var
      highScores, skillCode, newString: string;
      xpString: TStringArray;

    begin
      highScores := getPage('http://services.runescape.com/m=hiscore/compare?user1=' + userName);
      skillCode := 'table=' + IntToStr(skill) + '&page=1">';
      xpString := multiBetween(highScores, skillCode, '</a>');
      result := strToIntDef(ExtractFromStr(xpString[2], numbers), - 1);
    end;

    function getExpHighScores(userName: string; skill: Integer): integer;
    var
      highScores, skillCode, newString: string;
      xpString: TStringArray;

    begin
      highScores := getPage('http://services.runescape.com/m=hiscore/compare?user1=' + userName);
      skillCode := 'table=' + IntToStr(skill) + '&amp;page=1">';
      xpString := multiBetween(highScores, skillCode, '</a>');
      result := strToIntDef(ExtractFromStr(xpString[1], numbers), - 1);
    end;


    begin
      WriteLn(IntToStr(getLevelHighScores('Zezima', HIGHSCORES_DIVINATION)));
      WriteLn(IntToStr(getExpHighScores('Zezima', HIGHSCORES_DIVINATION)));
    end.

  2. #2
    Join Date
    Dec 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    looks good going to try it out now

  3. #3
    Join Date
    Jun 2015
    Location
    New Zealand
    Posts
    322
    Mentioned
    2 Post(s)
    Quoted
    131 Post(s)

    Default

    Thanks for the release mate +REP

  4. #4
    Join Date
    May 2012
    Posts
    499
    Mentioned
    23 Post(s)
    Quoted
    228 Post(s)

    Default

    Try this:
    MultiBetween(GetPage('http://hiscore.runescape.com/index_lite.ws?player=' + username), ',', ',');

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •