Ashaman88
2013-12-23 17:45:40
Just a little something until the devs come up with something better.
put your xp bar round these parts:

(in the larger red box)
Then just call chatbox.getxp;
Only works for 1 xp bar at a time (any xp bar you set)
You can remove the drawboxes as you please!
function TRSChatBox.getXP: Integer;
var
b: TBox;
s: String;
tpa : TPointArray;
atpa : T2DPointArray;
i,cts,p: Integer;
begin
b := self.getBounds();
b.edit(+(b.x2-b.x1)-140, +10, -5, -94);
findColorsTolerance(tpa, 14013909, b, 4,colorSetting(2, 0.00, 0.00));
if length(tpa) < 2 then
begin
print('chatBox.getXP(): No XP found', TDebug.SUB);
Exit;
end;
atpa := tpa.cluster(5);
b:= atpa.getbounds;
b.edit(-2,-2,+2,+3);
s:=Replace(tesseractgettext(b.x1,b.y1,b.x2,b.y2, FILTER_SMALL_CHARS), ' ', '', [rfReplaceAll]);
P := Pos('x', S);
if P > 0 then
Result := StrToIntDef(ExtractFromStr(Copy(s, P, Length(S)), Numbers), 0)
else
Result := StrToIntDef(ExtractFromStr(S, Numbers), 0);
print('chatBox.getXP(): XP found: ' + tostr(result), TDebug.SUB);
end; put your xp bar round these parts:

(in the larger red box)Then just call chatbox.getxp;
—- chatBox.getXP(): XP found: 870072
Only works for 1 xp bar at a time (any xp bar you set)
You can remove the drawboxes as you please!
