Don't mean to steal your thunder, mate. But saw your post and decided to write a little something:
Code:
Hiscores() - Returns a player's level or experience in a desired skill. Returns -1 on failure.
Player:
-------
The player you'd like to search.
Skill:
------
The skill you'd like to search. NOT case sensitive.
Options:
--------
overall, total
def, defence, defense
str, strength
cons, constitution, hp, hitpoints
range, ranged
pray, prayer
mage, magic
cook, cooking
wc, woodcut, woodcutting
fletch, fletching
fish, fishing
fm, fire, firemake, firemaking
craft, crafting
smith, smithing
mine, mining
herb, herblore
agi, agility
thieve, thieving
slay, slayer, slaying
farm, farming
rc, runecraft, runecrafting
hunt, hunter, hunting
con, construction
sum, summon, summoning
dg, dung, dungeon, dungeoneering
div, divination
inv, invent, invention
Experience:
-----------
If true, return experience instead of level.
Oldschool:
----------
If true, search the Oldschool hiscores instead of RuneScape 3.
Simba Code:
Function Hiscores(Player, Skill : string; Experience, Oldschool : Boolean = False ) : Integer;
Const
Skills :=[
'overall|total',
'att(ack)?',
'def(en(c|s)e)?',
'str(ength)?',
'cons(titution)?|h(itpoints|p)',
'ranged?',
'pray(er)?',
'mag(ic|e)',
'cook(ing)?',
'w(oodcut(ting)?|c)',
'fletch(ing)?',
'fish(ing)?',
'f(ire(mak(e|ing))?|m)',
'craft(ing)?',
'smith(ing)?',
'min(e|ing)',
'herb(lore)?',
'agi(lity)?',
'thiev(e|ing)',
'slay(er|ing)?',
'farm(ing)?',
'r(unecraft(ing)?|c)',
'hunt(er|ing)?',
'con(struction)?',
'sum(mon(ing)?)?',
'd(ung(eon(eer|ing)?)?|g)',
'div(ination)?',
'inv(ent(ion)?)?'
];
Var
Index : Integer;
Page : string;
Statistics : TStringArray;
Begin
Page := GetPage('http://services.runescape.com/m=hiscore' + ['_oldschool'][Oldschool - 1] + '/index_lite.ws?player=' + Player);
If Pos('404 - Page not found', Page) Then
Exit(-1);
Statistics := Explode(#10, Page);
For Index To [27, 23][Oldschool] Do
If ExecRegExpr('(?i)' + Skills[Index], Skill) Then
Begin
Statistics := Explode(',', Statistics[Index]);
Exit(StrToInt(Statistics[1 + Experience]));
End;
End;
Simba Code:
Slayer := Hiscores('A Friend', 'slay', true); //~ Return RS3 Slayer XP
Dungeoneering := Hiscores('A Friend', 'dg'); //~ Return RS3 Dungeoneering level
Herblore := Hiscores('A Friend', 'HeRb', true, true); //~ Return OSR Herblore XP
Reg ex. IDC.