SCAR Code:
function HSGet(C: ChatMsg; Username, Skill: string; Options : TStringArray) : TStringArray;
var
I, II, III, L : Integer;
S : String;
arrS : TStringArray;
arrarrS : Array of TStringArray;
begin
Result := ['N/A', 'N/A', 'N/A']
try
S := GetPage('http://hiscore.runescape.com/index_lite.ws?player=' + Replace(UserName, ' ', '_'))
except
Exit;
end;
arrS := Explode(#10, S);
SetArrayLength(arrarrS, 29);
for I := 0 to 28 do
arrarrS[I] := Explode(',', ArrS[I]);
case LowerCase(Skill) of
'overall' : I := 0;
'attack', 'att' : I := 1;
'defence', 'def' : I := 2;
'strength', 'str' : I := 3;
'hitpoints', 'hp' : I := 4;
'ranged', 'range' : I := 5;
'prayer', 'pray' : I := 6;
'magic', 'mage' : I := 7;
'cooking', 'cook' : I := 8;
'woodcutting', 'wc' : I := 9;
'fletching', 'fletch' : I := 10;
'fishing', 'fish' : I := 11;
'firemaking', 'fm' : I := 12;
'crafting', 'craft' : I := 13;
'smithing', 'smith' : I := 14;
'mining', 'mine' : I := 15;
'herblore', 'herb', 'herby' : I := 16;
'agility' : I := 17;
'thieving', 'thief' : I := 18;
'slayer' : I := 19;
'farming', 'farm' : I := 20;
'runecraft', 'rc', 'runecrafting' : I := 21;
'hunter' : I := 22;
'construction', 'con': I := 23;
'summoning' : I := 24;
'duel_tournament' : I := 25;
'bounty_hunters', 'bh' : I := 26;
'bounty_hunters_rougue', 'bhr' : I := 27;
'fist_of_guthix', 'fog' : I := 28;
else
Exit;
end;
for III := 0 to High(Options) do
begin
case LowerCase(Options[III]) of
'rank' : II := 0;
'level', 'lvl', 'score' : II := 1;
'xp' : II := 2;
else II := -1;
end;
if II <> -1 then
begin
L := Length(Result);
SetArrayLength(Result, L + 1);
Result[L] := arrarrS[I][II];
if Result[L] = '-1' then
Result[L] := 'N/A';
end;
end;
end;
Helpful?
If you need any explanation, just let me know.