This function download experience from runescape highscores.
SCAR Code:
{*******************************************************************************
function GetMyExperience(myNumber: integer; myName: string): Integer;
By: manfromczech
Description: Downloads Rank/Level/Exp/Score from Runescape Highscores
********************************************************************************
myNumber :=
Skill name | Rank | Level | Xp Game name | Rank | Score
Duel Tournament | 75 | 76
Overall | 0 | 1 | 2 Bounty Hunters | 77 | 78
Attack | 3 | 4 | 5 Bounty Hunter Rogues| 79 | 80
Defence | 6 | 7 | 8 Fist of Gutix | 81 | 82
Strength | 9 | 10 | 11
Hitpoints | 12 | 13 | 14
Ranged | 15 | 16 | 17
Prayer | 18 | 19 | 20
Magic | 21 | 22 | 23
Cooking | 24 | 25 | 26
Woodcutting | 27 | 28 | 29
Fletching | 30 | 31 | 32
Fishing | 33 | 34 | 35
Firemaking | 36 | 37 | 38
Crafting | 39 | 40 | 41
Smithing | 42 | 43 | 44
Mining | 45 | 46 | 47
Herblore | 48 | 49 | 50
Agility | 51 | 52 | 53
Thieving | 54 | 55 | 56
Slayer | 57 | 58 | 59
Farming | 60 | 61 | 62
Runecraft | 63 | 64 | 65
Hunter | 66 | 67 | 68
Construction | 69 | 70 | 71
Summoning | 72 | 73 | 74
*******************************************************************************}
function GetMyExperience(myNumber: integer; myName: string): Integer;
begin
Result := GetExperience(myNumber, myName);
end;
and source of dll plugin:
Code:
library GetMyExperience;
uses
FastShareMem,
SysUtils,
Classes,
Windows,
IdHttp,
Graphics;
{$R *.res}
type
TStrArray = array of string;
function Explode(var a: TStrArray; Border, S: string): Integer;
var
S2: string;
begin
Result := 0;
S2 := S + Border;
repeat
SetLength(A, Length(A) + 1);
a[Result] := Copy(S2, 0,Pos(Border, S2) - 1);
Delete(S2, 1, Length(a[Result] + Border));
Inc(Result);
until S2 = '';
end;
function GetExperience(myNumber: integer; myName: string): integer; stdcall;
var
s: string;
A: TStrArray;
b: integer;
begin
b := myNumber;
with TIdHttp.Create(nil) do
try
s := Get('http://hiscore.runescape.com/index_lite.ws?player=' + myName);
s := StringReplace(s, '-1', '0', [rfReplaceAll]);
s := StringReplace(s, #10, ',', [rfReplaceAll]);
finally
Explode(A, ',', s);
result := StrToInt(A[b]);
Free;
end;
end;
function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 1;
end;
function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall;
begin
case x of
0:
begin
ProcAddr := @GetExperience;
StrPCopy(ProcDef, 'function GetExperience(myNumber: integer; myName: string): integer;');
end;
else
x := -1;
end;
Result := x;
end;
exports GetFunctionCount;
exports GetFunctionInfo;
end.
I think this should be added to next rev

What do you think about this function??