xxpoopyxx2
2013-08-05 16:56:55
Any one know how to go about getting another users stats on rs through the highscores?
2013-08-05 16:56:55
2013-08-05 23:19:49
From: xxpoopyxx2
Any one know how to go about getting another users stats on rs through the highscores?
Function ToSkillArray(Name: String): Array Of Array Of String;
var
Data: String;
Categories: String;
Experience: String;
I, J, K: Integer;
TrimmedCategories: TStringArray;
Pieces: TStringList;
Begin
Data := GetPage('http://services.runescape.com/m=hiscore/compare?user1=' + Replace(Name, ' ', '%A0', [rfReplaceAll]));
Categories := Between('<section class="skillIcons">', '</section>', Data);
Pieces := TStringList.Create;
SplitRegExpr('<div class="hiscoreIcon [A-Za-z]+" title="', Categories, Pieces);
SetLength(TrimmedCategories, Pieces.Count);
For I := 0 To Pieces.Count - 1 Do
Begin
If (Pieces.Strings[I] = #10) Then Pieces.Delete(I);
TrimmedCategories[I] := Replace(Replace(Pieces.Strings[I], '"></div>', '', [rfReplaceAll]), #10, '', [rfReplaceAll]);
End;
Pieces.Free;
Experience := Between('<td class="alignleft"><a href="http://services.runescape.com/m=hiscore/ranking?category_type=0&table=0&page=', '</tbody>', Data);
Pieces := TStringList.Create;
SplitRegExpr('<a href="[^>]+">', Experience, Pieces);
For I := 0 To Pieces.Count - 1 Do
Begin
Pieces.Strings[I] := ReplaceRegExpr('[A-Za-z "</>=]+', ReplaceRegExpr('[0-9]+">', Pieces.Strings[I], '', True), '', True);
Pieces.Strings[I] := Replace(Pieces.Strings[I], #10, '', [rfReplaceAll]);
End;
SetLength(Result, High(TrimmedCategories));
For I := 0 To High(TrimmedCategories) - 1 Do
Begin
SetLength(Result[I], 4);
Result[I][0] := TrimmedCategories[I];
For J := 1 To 3 Do
Begin
Result[I][J] := Pieces.Strings[K];
Inc(K);
End;
End;
Pieces.Free;
End;
begin
writeln(ToSkillArray('Jake'));
end.
Compiled successfully in 16 ms.
[['Overall', '2', '4,503,285,269', '2,496'],
['Attack', '12', '200,000,000', '99'],
['Defence', '19', '200,000,000', '99'],
['Strength', '20', '200,000,000', '99'],
['Constitution', '6', '200,000,000', '99'],
['Ranged', '20', '200,000,000', '99'],
['Prayer', '23', '200,000,000', '99'],
['Magic', '10', '200,000,000', '99'],
['Cooking', '119', '200,000,000', '99'],
['Woodcutting', '47', '200,000,000', '99'],
['Fletching', '56', '200,000,000', '99'],
['Fishing', '69', '176,382,959', '99'],
['Firemaking', '53', '200,000,000', '99'],
['Crafting', '23', '200,000,000', '99'],
['Smithing', '47', '138,241,365', '99'],
['Mining', '87', '92,633,702', '99'],
['Herblore', '29', '200,000,000', '99'],
['Agility', '145', '39,307,595', '99'],
['Thieving', '19', '200,000,000', '99'],
['Slayer', '3', '200,000,000', '99'],
['Farming', '43', '200,000,000', '99'],
['Runecrafting', '232', '56,719,648', '99'],
['Hunter', '18', '200,000,000', '99'],
['Construction', '24', '200,000,000', '99'],
['Summoning', '3', '200,000,000', '99'],
['Dungeoneering', '67', '200,000,000', '120']]
Successfully executed.
2013-08-06 07:15:00
info:= Between(',', ',', GetPage('hiscore.runescape.com/index_lite.ws?player=' + Replace(name, ' ', '_')));
if info = '' then
begin
writeln('Error retrieving player hiscore!');
writeln('Please allow permission for page access!');
writeln('Terminating...');
TerminateScript;
end;
if info <> ' Verdana' then
level:= StrToInt(info)
else
begin
info:= 'Unknown (Non-member)';
level:= -1;
end;
2013-08-09 22:30:33
2013-08-09 22:41:41
From: xxpoopyxx2
wow thank you both i love you
but how would i switch it to old school stats
2013-08-09 22:51:08
procedure GetStats(name : string);
var
info : string;
level : integer;
begin
info:= Between(',', ',', GetPage('http://services.runescape.com/m=hiscore_oldschool/index_lite.ws?player=' + Replace(name, ' ', '_')));
if info = '' then
begin
writeln('Error retrieving player hiscore!');
writeln('Please allow permission for page access!');
writeln('Terminating...');
TerminateScript;
end;
if info <> ' Verdana' then
level:= StrToInt(info)
else
begin
info:= 'Unknown (Non-member)';
level:= -1;
end;
end;
begin
GetStats('Player');
end.
Function ToSkillArray(Name: String): Array Of Array Of String;
var
Data: String;
Categories: String;
Experience: String;
I, J, K: Integer;
TrimmedCategories: TStringArray;
Pieces: TStringList;
Begin
Data := GetPage('http://services.runescape.com/m=hiscore_oldschool/hiscorepersonal.ws?user1=' + Replace(Name, ' ', '%A0', [rfReplaceAll]));
Categories := Between('<td align="left"><a href="overall.ws?', '<div id="footerHiscores">', Data);
Pieces := TStringList.Create;
SplitRegExpr('hiscores/skill_icon_', Categories, Pieces);
SetLength(TrimmedCategories, Pieces.Count);
For I := 0 To Pieces.Count - 1 Do
Begin
If (Pieces.Strings[I] = #10) Then Pieces.Delete(I);
TrimmedCategories[I] := Replace(Replace(Pieces.Strings[I], '1.gif"></td>', '', [rfReplaceAll]), #10, '', [rfReplaceAll]);
End;
Pieces.Free;
Experience := Between('<tr><td width="35"></td><td width="100"></td><td width="75"></td><td width="40"></td><td width="75"></td></tr>', '<div id="footerHiscores"></div>', Data);
Pieces := TStringList.Create;
SplitRegExpr('<td align="right">', Experience, Pieces);
For I := 0 To Pieces.Count - 1 Do
Begin
Pieces.Strings[I] := ReplaceRegExpr('[A-Za-z "</>=]+', ReplaceRegExpr('[0-9]+">', Pieces.Strings[I], '', True), '', True);
Pieces.Strings[I] := Replace(Pieces.Strings[I], #10, '', [rfReplaceAll]);
End;
SetLength(Result, High(TrimmedCategories));
For I := 0 To High(TrimmedCategories) - 1 Do
Begin
SetLength(Result[I], 4);
Result[I][0] := TrimmedCategories[I];
For J := 1 To 3 Do
Begin
Result[I][J] := Pieces.Strings[K];
Inc(K);
End;
End;
Pieces.Free;
End;
begin
writeln(ToSkillArray(''));
end.