SRL Archive - SRL Archives

GetLevelHS - Quickmarch


Quickmarch

2008-12-07 04:07:55

I don't know if this is useful or not and i don't think it has been made.

EDIT: Is this in the right section? Should it be in RS Scripts?


What it does:

Gets a Skill level from the runescape highscores

{*******************************************************************************
function GetLevelHS(Username, Skill: String): Integer;
By: Quickmarch
Description: Gets the Skill from the RS Highscores.
*******************************************************************************}
function GetLevelHS(Username, Skill: String): Integer;
var
Level, Level2, Level3: String;
Page: String;

begin
Page := GetPage('http://hiscore.runescape.com/hiscorepersonal.ws?user1=' + Username);
Level := Between(Capitalize(Skill), '<td align="center">', Page);
Level2 := Between('<td class="alL">', '</tr>', Level);
Level3 := Between('</td>', '</td>', Level2);
Result := StrToInt(GetNumbers(Level3));
if (Result <= 0) then
begin
WriteLn('There was a problem');
Exit;
end;
end;

Example:

WriteLn(IntToStr(GetLevelHS('Username', 'Attack')));

Enjoy :)

Rich

2008-12-07 04:46:42

This seems like it could be used. It's a good idea anyway. And this is the right section for it :p

Floor66

2008-12-07 05:14:51

I thought that SRL said they wouldn't add functions that connect to the runescape website?
W/e good though :p
My G.E Functions connect to it too.

Quickmarch

2008-12-07 05:18:43

From: floor66
I thought that SRL said they wouldn't add functions that connect to the runescape website?
W/e good though :p
My G.E Functions connect to it too.


oh ok i didn't realise lol:)