Page 1 of 2 12 LastLast
Results 1 to 25 of 31

Thread: Nab runescape highscore stats?

  1. #1
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default Nab runescape highscore stats?

    Does any one know how to grab them? because I wanna make a in scar highscore checker.
    Oh Hai Dar

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Make it fetch the data from the site and then just parse it from it.
    There used to be something meaningful here.

  3. #3
    Join Date
    Feb 2008
    Location
    S
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use CURL and parse the web page.

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by trecool999 View Post
    Use CURL and parse the web page.
    No need for such.
    There used to be something meaningful here.

  5. #5
    Join Date
    Feb 2008
    Location
    S
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    "Make it fetch the data" isn't really a great explanation either lol
    Depends on what he's using.

  6. #6
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by trecool999 View Post
    "Make it fetch the data" isn't really a great explanation either lol
    Depends on what he's using.
    Well, lets ask?
    There used to be something meaningful here.

  7. #7
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    I wanna find it from scar. I can get the username as a string.

    I was wondering if there is a url that I can insert the string or a php code.
    Oh Hai Dar

  8. #8
    Join Date
    Feb 2008
    Location
    S
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know SCAR has HTTP functions, but I don't know what they are or how to use them. Sorry lol

  9. #9
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by trecool999 View Post
    I know SCAR has HTTP functions, but I don't know what they are or how to use them. Sorry lol
    You can find out by pressing F1.
    There used to be something meaningful here.

  10. #10
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    does any of you guys know rs's url for getting stats? (html/php)
    Oh Hai Dar

  11. #11
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Main_Ftw View Post
    does any of you guys know rs's url for getting stats? (html/php)
    Post this: http://services.runescape.com/m=hisc...orepersonal.ws
    with: user1 and it will output the highscore page with that users stats.

    I can make you an example later today if you want?
    There used to be something meaningful here.

  12. #12
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Sure, but I was wondering if I could just get the individual stats as a results so I could use get page or one of the internet functions.
    Oh Hai Dar

  13. #13
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    You can get a lite version of the high scores by parsing the following page:

    http://hiscore.runescape.com/index_l...layer=username

    where username is the name of the player you want information for.
    :-)

  14. #14
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice link Method, and that's now simple to parse (split by comma, and then every 2n+2 is the level)

    sigh and I made myself a program to compose a page that produces output like that link, for you to parse, oh well was good fun :/

    ~ Craig`

  15. #15
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Craig` View Post
    nice link Method, and that's now simple to parse (split by comma, and then every 2n+2 is the level)

    sigh and I made myself a program to compose a page that produces output like that link, for you to parse, oh well was good fun :/

    ~ Craig`
    Its not splitted by comma I just checked, look closely.
    There used to be something meaningful here.

  16. #16
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well yeah the space acts as the individual skill delimiter, but you could always scan for /,(-?\d+),/

    thanks for the correction though

    ~ Craig`

  17. #17
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Craig` View Post
    well yeah the space acts as the individual skill delimiter, but you could always scan for /,(-?\d+),/

    thanks for the correction though

    ~ Craig`
    Theres 31 spaces, so there must be 32 skills then?
    There used to be something meaningful here.

  18. #18
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    bleh don't go against everything I say, and if you notice, you'll find that I then suggested using the regular expression, /,(-?\d+),/

    demonstrated:
    Code:
    require "open-uri"
    require "nokogiri"
    
    stats = %w{Overall Attack Defence Strength Constitution Ranged Prayer Magic Cooking Woodcutting Fletching Fishing Firemaking Crafting Smithing Mining Herblore Agility Theiving Slayer Farming Runecrafting Hunter Construction Summoning}
    levels = Nokogiri::HTML(open("http://hiscore.runescape.com/index_lite.ws?player=Tiny%20Craig")).to_s.scan(/,(-?\d+),/)
    
    stats.each_with_index do |stat, i|
      stats[i] = [stat, levels[i][0]]
    end
    
    stats.each do |stat|
      puts "#{stat[0]}> #{stat[1]}"
    end
    EDIT nicer version imo:
    Code:
    require "open-uri"
    require "nokogiri"
    
    stats = {}
    levels = Nokogiri::HTML(open("http://hiscore.runescape.com/index_lite.ws?player=Tiny%20Craig")).to_s.scan(/,(-?\d+),/)
    
    %w{Overall Attack Defence Strength Constitution Ranged Prayer Magic Cooking Woodcutting Fletching Fishing Firemaking Crafting Smithing Mining Herblore Agility Theiving Slayer Farming Runecrafting Hunter Construction Summoning}.each_with_index do |key, i|
      stats[key] = levels[i][0]
    end
    
    stats.each do |skill, level|
      puts "#{skill}> #{level}"
    end
    outputting:
    Code:
    Overall> 903
    Attack> -1
    Defence> -1
    Strength> -1
    Constitution> -1
    Ranged> -1
    Prayer> -1
    Magic> -1
    Cooking> -1
    Woodcutting> -1
    Fletching> 66
    Fishing> -1
    Firemaking> -1
    Crafting> 56
    Smithing> 47
    Mining> 60
    Herblore> -1
    Agility> -1
    Theiving> 31
    Slayer> -1
    Farming> -1
    Runecrafting> 40
    Hunter> -1
    Construction> 35
    Summoning> -1
    no hate for Ruby pls.

    ~ Craig`
    Last edited by Craig`; 04-10-2010 at 04:10 PM.

  19. #19
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    I was not trying to offend
    There used to be something meaningful here.

  20. #20
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Sweet, thanks.
    But do you have a way to get it in scar ?
    Last edited by Main; 04-10-2010 at 08:26 PM.
    Oh Hai Dar

  21. #21
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    love me:

    SCAR Code:
    program new;

    var
      skillArr: tStringArray;

    const
      username = 'Zezima';

    function Parse(): tStringArray;
    var
      page: string;
    begin
      page := GetPage('http://hiscore.runescape.com/index_lite.ws?player='+username);
      result := explode(',', page);
    end;

    var
      stats, actualStats: tStringArray;
      i: Integer;

    begin
      skillArr := ['Overall', 'Attack', 'Defence', 'Strength', 'Constitution', 'Ranged', 'Prayer', 'Magic', 'Cooking', 'Woodcutting', 'Fletching', 'Fishing', 'Firemaking', 'Crafting', 'Smithing', 'Mining', 'Herblore', 'Agility', 'Theiving', 'Slayer', 'Farming', 'Runecrafting', 'Hunter', 'Construction', 'Summoning'];

      stats := parse();
      for i := 0 to high(stats) do
      begin
        if i mod 2 <> 0 then
        begin
          setArrayLength(actualStats, length(actualStats)+1);
          actualStats[length(actualStats)-1] := stats[i];
        end;
      end;
     
      for i := 0 to high(skillArr) do
        writeLn(skillArr[i]+': '+actualStats[i]);
       
    end.

    I'll make a form for you if you say please :>
    “Ignorance, the root and the stem of every evil.”

  22. #22
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    please
    Oh Hai Dar

  23. #23
    Join Date
    Feb 2007
    Location
    @ SRL
    Posts
    402
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I made this not too long ago.
    It gathers the data from the 'Adventures Log', so it only works for member accounts, but it gets every skill even it is a low level.

    Also I've created a function which calculates a players combat level and 'player type'.
    Hope you like it.

    SCAR Code:
    program Get_Levels;    // By TurboBk


    Const
      PlayersName = '';    // User to lookup?
      PvPOnly     = False; // PvP info only?
      SaveTxt     = False; // Save info to a .txt file?
      TxtName     = '';    // Only filename, DO NOT add .txt


    Function Odd(i: Extended): Boolean;
    Begin
      Result := (GetOthers(FloatToStr(i / 2)) = '.');
    End;

    Function HighestValue(Var Which: Integer; N1, N2, N3: Extended): Extended;
    Begin
      If (N1 >= N2) And (N1 >= N3) Then
      Begin  Result := N1;  Which := 1;  End;
      If (N2 >= N3) And (N2 >= N1) Then
      Begin  Result := N2;  Which := 2;  End;
      If (N3 >= N1) And (N3 >= N2) Then
      Begin  Result := N3;  Which := 3;  End;
    End;

    Function SaveInfo(FName: String): Boolean;
    Var
      F: Integer;
      SV: String;
    Begin
      SV := IntToStr(GetSCARVersion);
      Insert('.', SV, 2);
      F := RewriteFile('C:\Program Files\SCAR ' + SV + '\Scripts\' + FName + '.txt', False);
      If WriteFileString(F, GetDebugText) Then
      Begin
        WriteLn('Successfully saved to file!');
        Result := True;
      End Else WriteLn('Failed saving to file!');
      CloseFile(F);
    End;

    Function CalculateCombatLevel(Var PClass: String; Att, Str, Def, Ranged, Pray, Mage, Cons, Summ: Extended): Extended;
    Var
      BaseCL, ClassCL: Extended;
      MeleeC, RangedC, MageC: Extended;
      PlayerClass: Integer;
    Begin
      Def := Def * 100;
      Cons := Cons * 100;
      If Odd(Pray) Then
        Pray := ((Pray - 1) * 50)
      Else Pray := Pray * 50;
      If Odd(Summ) Then
        Summ := ((Summ - 1) * 50)
      Else Summ := Summ * 50;
      BaseCL := ((Def + Cons + Pray + Summ) / 400);
      Att := Att * 130;
      Str := Str * 130;
      If Odd(Ranged) Then
        Ranged := ((Ranged * 195) - 65)
      Else Ranged := Ranged * 195;
      If Odd(Mage) Then
        Mage := ((Mage * 195) - 65)
      Else Mage := Mage * 195;
      MeleeC := ((Att + Str) / 400);
      RangedC := (Ranged / 400);
      MageC := (Mage / 400);
      ClassCL := HighestValue(PlayerClass, MeleeC, RangedC, MageC);
      Case PlayerClass Of
        1: PClass := 'Melee (' + FloatToStr(MeleeC) + ')';
        2: PClass := 'Ranged (' + FloatToStr(RangedC) + ')';
        3: PClass := 'Mage (' + FloatToStr(MageC) + ')';
      End;
      Result := (ClassCL + BaseCL);
    End;

    Procedure GetPlayerLevels(RSUser: String; PvPInfo: Boolean);
    Var
      Name, Page: String;
      TL, Attack, Defence, Strength, Constitution, Ranged, Prayer,
      Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting,
      Smithing, Mining, Herblore, Agility, Thieving, Slayer, Farming,
      Runecrafting, Hunter, Construction, Summoning, Combat, PType: String;
    Begin
      Name := RSUser;
      If (Pos(' ', Name) <> 0) Then
        Name := Replace(Name, ' ', '%A0');
      If (Pos('_', Name) <> 0) Then
        Name := Replace(Name, '_', '%A0');
      Page := '';
      Page := GetPage('http://services.runescape.com/m=adventurers-log/display_player_profile.ws?searchName=' + Name);
      If Not (Page = '') Then
      Begin
        If Not (Pos('Non-member account', Page) <> 0) Then
        Begin
          If Not (Pos('Private profile', Page) <> 0) Then
          Begin
            If Not (Pos('Account not found', Page) <> 0) Then
            Begin
              Page := Between('var skills=[', '/* Init', Page);
              TL := Between('skill(''Total Level'',', ')', Page);
              TL := Between(''',', ',''', TL);
              Attack := Between('skill(''Attack'',', ')', Page);
              Attack := Between(''',', ',''', Attack);
              Defence := Between('skill(''Defence'',', ')', Page);
              Defence := Between(''',', ',''', Defence);
              Strength := Between('skill(''Strength'',', ')', Page);
              Strength := Between(''',', ',''', Strength);
              Constitution := Between('skill(''Constitution'',', ')', Page);
              Constitution := Between(''',', ',''', Constitution);
              Ranged := Between('skill(''Ranged'',', ')', Page);
              Ranged := Between(''',', ',''', Ranged);
              Prayer := Between('skill(''Prayer'',', ')', Page);
              Prayer := Between(''',', ',''', Prayer);
              Magic := Between('skill(''Magic'',', ')', Page);
              Magic := Between(''',', ',''', Magic);
              Cooking := Between('skill(''Cooking'',', ')', Page);
              Cooking := Between(''',', ',''', Cooking);
              Woodcutting := Between('skill(''Woodcutting'',', ')', Page);
              Woodcutting := Between(''',', ',''', Woodcutting);
              Fletching := Between('skill(''Fletching'',', ')', Page);
              Fletching := Between(''',', ',''', Fletching);
              Fishing := Between('skill(''Fishing'',', ')', Page);
              Fishing := Between(''',', ',''', Fishing);
              Firemaking := Between('skill(''Firemaking'',', ')', Page);
              Firemaking := Between(''',', ',''', Firemaking);
              Crafting := Between('skill(''Crafting'',', ')', Page);
              Crafting := Between(''',', ',''', Crafting);
              Smithing := Between('skill(''Smithing'',', ')', Page);
              Smithing := Between(''',', ',''', Smithing);
              Mining := Between('skill(''Mining'',', ')', Page);
              Mining := Between(''',', ',''', Mining);
              Herblore := Between('skill(''Herblore'',', ')', Page);
              Herblore := Between(''',', ',''', Herblore);
              Agility := Between('skill(''Agility'',', ')', Page);
              Agility := Between(''',', ',''', Agility);
              Thieving := Between('skill(''Thieving'',', ')', Page);
              Thieving := Between(''',', ',''', Thieving);
              Slayer := Between('skill(''Slayer'',', ')', Page);
              Slayer := Between(''',', ',''', Slayer);
              Farming := Between('skill(''Farming'',', ')', Page);
              Farming := Between(''',', ',''', Farming);
              Runecrafting := Between('skill(''Runecrafting'',', ')', Page);
              Runecrafting := Between(''',', ',''', Runecrafting);
              Hunter := Between('skill(''Hunter'',', ')', Page);
              Hunter := Between(''',', ',''', Hunter);
              Construction := Between('skill(''Construction'',', ')', Page);
              Construction := Between(''',', ',''', Construction);
              Summoning := Between('skill(''Summoning'',', ')', Page);
              Summoning := Between(''',', ',''', Summoning);
              Combat := FloatToStr(CalculateCombatLevel(PType, StrToInt(Attack), StrToInt(Strength), StrToInt(Defence), StrToInt(Ranged), StrToInt(Prayer), StrToInt(Magic), StrToInt(Constitution), StrToInt(Summoning)));
            End Else
            Begin
              WriteLn('ERROR: Invalid account name, please check the account name and try again.');
              TerminateScript;
            End;
          End Else
          Begin
            WriteLn('ERROR: Private Profile, can only retreive Info from Public Profiles.');
            TerminateScript;
          End;
        End Else
        Begin
          WriteLn('ERROR: Non-Member Account, can only retreive Info from Members Accounts.');
          TerminateScript;
        End;
      End Else
      Begin
        WriteLn('ERROR: Could not retrieve Info.');
        TerminateScript;
      End;
      If Not PvPInfo Then
      Begin
        WriteLn('[*] Player Name:  ' + RSUser);
        WriteLn('[*] Combat Level:  ' + Combat);
        WriteLn('[*] Total Level:  ' + TL);
        WriteLn('[*] Player Type:  ' + PType);
        WriteLn('[*] Attack:  ' + Attack);
        WriteLn('[*] Strength:  ' + Strength);
        WriteLn('[*] Defence:  ' + Defence);
        WriteLn('[*] Ranged:  ' + Ranged);
        WriteLn('[*] Prayer:  ' + Prayer);
        WriteLn('[*] Magic:  ' + Magic);
        WriteLn('[*] Constitution:  ' + Constitution);
        WriteLn('[*] Cooking:  ' + Cooking);
        WriteLn('[*] Woodcutting:  ' + Woodcutting);
        WriteLn('[*] Fletching:  ' + Fletching);
        WriteLn('[*] Fishing:  ' + Fishing);
        WriteLn('[*] Firemaking:  ' + Firemaking);
        WriteLn('[*] Crafting:  ' + Crafting);
        WriteLn('[*] Smithing:  ' + Smithing);
        WriteLn('[*] Mining:  ' + Mining);
        WriteLn('[*] Herblore:  ' + Herblore);
        WriteLn('[*] Agility:  ' + Agility);
        WriteLn('[*] Thieving:  ' + Thieving);
        WriteLn('[*] Slayer:  ' + Slayer);
        WriteLn('[*] Farming:  ' + Farming);
        WriteLn('[*] Runecrafting:  ' + Runecrafting);
        WriteLn('[*] Hunter:  ' + Hunter);
        WriteLn('[*] Construction:  ' + Construction);
        WriteLn('[*] Summoning:  ' + Summoning);
      End Else
      Begin
        WriteLn('[*] Player Name:  ' + RSUser);
        WriteLn('[*] Combat Level:  ' + Combat);
        WriteLn('[*] Player Type:  ' + PType);
        WriteLn('[*] Attack:  ' + Attack);
        WriteLn('[*] Strength:  ' + Strength);
        WriteLn('[*] Defence:  ' + Defence);
        WriteLn('[*] Ranged:  ' + Ranged);
        WriteLn('[*] Prayer:  ' + Prayer);
        WriteLn('[*] Magic:  ' + Magic);
        WriteLn('[*] Constitution:  ' + Constitution);
      End;
    End;

    begin
      ClearDebug;
      GetPlayerLevels(PlayersName, PvPOnly);
      If SaveTxt Then
        SaveInfo(TxtName);
    end.
    Last edited by turbobk; 04-11-2010 at 02:28 AM.
    The game has an unexplainable attraction that convinces the player they are having fun, despite the fact that all they are doing is performing repetitive tasks to increase their statistics. "The game is actually a graphical nightmare and its gameplay is simple at best. Yet something, perhaps by subliminal means, forces the player - against his will - to play the game, and to believe that they are having fun".

  24. #24
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    love me moar!

    SCAR Code:
    program new;
    var
      skillArr, actualStats: tStringArray;
      SavedText: string;
     
      frmDesign : TForm;
      Panel : TPanel;
      Label1 : TLabel;
      UsernameBox : TEdit;
      Title: array of TLabel;
      Button: tButton;
     
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    function Parse(name: string): tStringArray;
    var
      page: string;
    begin
      page := GetPage('http://hiscore.runescape.com/index_lite.ws?player='+name);
      result := explode(',', page);
    end;

    procedure ButtonClick(Sender: TObject);
    var
      stats: tStringArray;
      i: Integer;

    begin
      setArrayLength(actualStats, 0);
      stats := parse(UsernameBox.Text);
      for i := 0 to high(stats) do
      begin
        if i mod 2 <> 0 then
        begin
          setArrayLength(actualStats, length(actualStats)+1);
          actualStats[length(actualStats)-1] := stats[i];
        end;
      end;
      SavedText := UsernameBox.Text;
      frmDesign.ModalResult:= mrOk;
      SafeInitForm;
      SafeShowFormModal;
    end;
     
    procedure InitForm();
    var
      i: Integer;
    begin
      frmDesign := CreateForm;
      with frmDesign do
      begin
        Left := 457;
        Top := 117;
        Width := 241;
        Height := 600;
        Caption := ':: Highscore Stats Generator ::';
        Color := clBtnFace;
        Font.Color := clWindowText;
        Font.Height := -11;
        Font.Name := 'MS Sans Serif';
        Font.Style := [];
      end;
      Panel := TPanel.Create(frmDesign);
      with Panel do
      begin
        Parent := frmDesign;
        Left := 16;
        Top := 15;
        Width := 193;
        Height := 65;
      end;
      Button := TButton.Create(frmDesign);
      with Button do
      begin
        Parent := frmDesign;
        Left := 65;
        Top := 90;
        Width := 75;
        Height := 25;
        Caption := 'Search';
        OnClick := @ButtonClick;
      end;
      Label1 := TLabel.Create(Panel);
      with Label1 do
      begin
        Parent := Panel;
        Left := 56;
        Top := 8;
        Width := 64;
        Height := 17;
        Caption := 'Username';
        Font.Color := clWindowText;
        Font.Height := -13;
        Font.Name := '@Meiryo UI';
        Font.Style := [];
        ParentFont := False;
      end;
      UsernameBox := TEdit.Create(Panel);
      with UsernameBox do
      begin
        Parent := Panel;
        Left := 32;
        Top := 32;
        Width := 121;
        Height := 21;
        Hint := Savedtext;
      end;
      setArrayLength(Title, length(SkillArr)+1);
      for i := 0 to high(skillArr) do
      begin
        Title[i] := TLabel.Create(frmDesign);
        with Title[i] do
        begin
          Parent := frmDesign;
          Left := 15;
          Top := 150+15*i;
          Width := 75;
          Height := 25;
          Font.Color := clWindowText;
          Caption := skillArr[i]+': '+actualStats[i];
        end;
      end;
      Title[High(Title)]:= TLabel.Create(frmDesign);
      with Title[i] do
      begin
        Parent := frmDesign;
        Left := 15;
        Top := 135;
        Width := 75;
        Height := 25;
        Font.Color := clWindowText;
        Caption := 'Name: '+SavedText;
      end;
    end;

    begin
      setArrayLength(actualStats, 99);
      skillArr := ['Overall', 'Attack', 'Defence', 'Strength', 'Constitution', 'Ranged', 'Prayer', 'Magic', 'Cooking', 'Woodcutting', 'Fletching', 'Fishing', 'Firemaking', 'Crafting', 'Smithing', 'Mining',
                   'Herblore', 'Agility', 'Theiving', 'Slayer', 'Farming', 'Runecrafting', 'Hunter', 'Construction', 'Summoning'];
      SafeInitForm;
      SafeShowFormModal;
    end.
    “Ignorance, the root and the stem of every evil.”

  25. #25
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    love me moar!

    SCAR Code:
    program new;
    var
      skillArr, actualStats: tStringArray;
      SavedText: string;
     
      frmDesign : TForm;
      Panel : TPanel;
      Label1 : TLabel;
      UsernameBox : TEdit;
      Title: array of TLabel;
      Button: tButton;
     
    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    function Parse(name: string): tStringArray;
    var
      page: string;
    begin
      page := GetPage('http://hiscore.runescape.com/index_lite.ws?player='+name);
      result := explode(',', page);
    end;

    procedure ButtonClick(Sender: TObject);
    var
      stats: tStringArray;
      i: Integer;

    begin
      setArrayLength(actualStats, 0);
      stats := parse(UsernameBox.Text);
      for i := 0 to high(stats) do
      begin
        if i mod 2 <> 0 then
        begin
          setArrayLength(actualStats, length(actualStats)+1);
          actualStats[length(actualStats)-1] := stats[i];
        end;
      end;
      SavedText := UsernameBox.Text;
      frmDesign.ModalResult:= mrOk;
      SafeInitForm;
      SafeShowFormModal;
    end;
     
    procedure InitForm();
    var
      i: Integer;
    begin
      frmDesign := CreateForm;
      with frmDesign do
      begin
        Left := 457;
        Top := 117;
        Width := 241;
        Height := 600;
        Caption := ':: Highscore Stats Generator ::';
        Color := clBtnFace;
        Font.Color := clWindowText;
        Font.Height := -11;
        Font.Name := 'MS Sans Serif';
        Font.Style := [];
      end;
      Panel := TPanel.Create(frmDesign);
      with Panel do
      begin
        Parent := frmDesign;
        Left := 16;
        Top := 15;
        Width := 193;
        Height := 65;
      end;
      Button := TButton.Create(frmDesign);
      with Button do
      begin
        Parent := frmDesign;
        Left := 65;
        Top := 90;
        Width := 75;
        Height := 25;
        Caption := 'Search';
        OnClick := @ButtonClick;
      end;
      Label1 := TLabel.Create(Panel);
      with Label1 do
      begin
        Parent := Panel;
        Left := 56;
        Top := 8;
        Width := 64;
        Height := 17;
        Caption := 'Username';
        Font.Color := clWindowText;
        Font.Height := -13;
        Font.Name := '@Meiryo UI';
        Font.Style := [];
        ParentFont := False;
      end;
      UsernameBox := TEdit.Create(Panel);
      with UsernameBox do
      begin
        Parent := Panel;
        Left := 32;
        Top := 32;
        Width := 121;
        Height := 21;
        Hint := Savedtext;
      end;
      setArrayLength(Title, length(SkillArr)+1);
      for i := 0 to high(skillArr) do
      begin
        Title[i] := TLabel.Create(frmDesign);
        with Title[i] do
        begin
          Parent := frmDesign;
          Left := 15;
          Top := 150+15*i;
          Width := 75;
          Height := 25;
          Font.Color := clWindowText;
          Caption := skillArr[i]+': '+actualStats[i];
        end;
      end;
      Title[High(Title)]:= TLabel.Create(frmDesign);
      with Title[i] do
      begin
        Parent := frmDesign;
        Left := 15;
        Top := 135;
        Width := 75;
        Height := 25;
        Font.Color := clWindowText;
        Caption := 'Name: '+SavedText;
      end;
    end;

    begin
      setArrayLength(actualStats, 99);
      skillArr := ['Overall', 'Attack', 'Defence', 'Strength', 'Constitution', 'Ranged', 'Prayer', 'Magic', 'Cooking', 'Woodcutting', 'Fletching', 'Fishing', 'Firemaking', 'Crafting', 'Smithing', 'Mining',
                   'Herblore', 'Agility', 'Theiving', 'Slayer', 'Farming', 'Runecrafting', 'Hunter', 'Construction', 'Summoning'];
      SafeInitForm;
      SafeShowFormModal;
    end.
    This is very very sexy!

Page 1 of 2 12 LastLast

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
  •