It wasn't working due to the defined search area for the text. Since where the window pops up is pretty random, I changed it to search the inventory for the 'urrent' text.
SCAR Code:
{*******************************************************************************
function GetXP(Skill: Variant): Integer;
By: Nielsie95
Description: Returns current xp for a skill. Returns -1 if failed.
*******************************************************************************}
function GetXP(Skill: Variant): Integer;
var
p: TPoint;
tx, ty, x, y: Integer;
begin
Result := -1;
if (not TabExists(tab_Stats)) then exit;
GameTab(tab_Stats);
if (GetCurrentTab <> tab_Stats) then exit;
P := SkillToCoords(True, Skill);
if (P.x < 1) then exit;
MMouse(P.x, P.y + 5, 12, 4);
if (not WaitFindColor(x, y, 10551295, MIX1, MIY1, MIX2, MIY2, 0, 4000)) then exit;
Wait(200 + Random(150));
if IsTextInAreaEx(MIX1, MIY1, MIX2, MIY2, 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;
There may be a better way to do it, but this works.