Hello again,
Just wanted to see if there's a possibility to add this code into aeroLib?
Reason:
Hovering the skill to get the "start" experience/level is really stupid everytime we run scripts.
Explained:
It'll use getPage once, and then work out all the numbers for each variable(rank, level and experience). I didn't want to create a separate record for such a small function.
Code:
Simba Code:
program Hiscore;
{$i AeroLib/AeroLib.Simba}
const
HISCORE_RANK = 0;
HISCORE_LEVEL = 1;
HISCORE_XP = 2;
function getHiscoreInfo(Username: String): T2DIntegerArray;
var
I, II: Integer;
S, tS: String;
sArr, skillArr: TStringArray;
begin
S := GetPage('http://services.runescape.com/m=hiscore_oldschool/hiscorepersonal.ws?user1=' + Username);
skillArr := ['Attack', 'Defence', 'Strength', 'Hitpoints', 'Ranged', 'Prayer', 'Magic', 'Cooking', 'Woodcutting', 'Fletching', 'Fishing', 'Firemaking', 'Crafting', 'Smithing', 'Mining', 'Herblore', 'Agility', 'Thieving', 'Slayer', 'Farming', 'Runecraft', 'Hunter', 'Construction'];
SetLength(Result, 3);
For I:=0 to 2 do
SetLength(Result[I], 23);
For I:=SKILL_ATTACK to SKILL_CONSTRUCTION do
begin
If I = SKILL_CONSTRUCTION then
tS := Between(skillArr[I], '</table>', S)
else
tS := Between(skillArr[I], '<img class', S);
sArr := MultiBetween(tS, '="right">', '</td>');
For II:=0 to 2 do
Result[II][I] := StrToIntDef(GetNumbers(sArr[II]), -1);
end;
end;
var
CharInfo: T2DIntegerArray;
begin
initAL;
CharInfo := getHiscoreInfo('vestfold');
Writeln(CharInfo[HISCORE_LEVEL][SKILL_FIREMAKING]);
end.