function GetXp(skill: string): Integer;
var
p: TPoint;
i, tx, ty, x, y: Integer;
begin
Result := -1;
if (not LoggedIn) or (not TabExists(2)) then Exit;
GameTab(2);
if (GetCurrentTab <> 2) then Exit;
p := SkillToCoords(True,Skill);
if (p.x < 1) then Exit;
MMouse(p.x, p.y +5, 12, 4);
while (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) and (i < 50) do
begin
Wait(100);
Inc(i);
end;
Wait(200 + Random(150));
if (not FindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2)) then Exit;
if IsTextInAreaEx(x, y, x + 60, y + 60, tx, ty, 'urrent', 0, SmallChars, False, False, 0, 1, 0) then
Result := StrToIntDef(GetNumbers(GetTextAtEx(tx, ty, 0, SmallChars, False, True, 0, 1, 0, 50, False, tr_AllChars)), -1);
end.