This seems to work while resting, walking, running, resting with run activated...
delphi Code:
program new;
{$I SRL-6/SRL.simba}
function FindColorsTolBitmap(bmp:Int32; var TPA:TPointArray; color:Int32; B:TBox; tol:Int32): Boolean;
var oldT,T:Int32;
begin
oldT := GetImageTarget();
T := SetTargetBitmap(bmp);
SetImageTarget(T);
Result := FindColorsTolerance(TPA, color, B.x1,B.y1,B.x2,B.y2, tol);
SetImageTarget(oldT);
FreeTarget(T);
end;
function TRSMinimap.GetRunEnergy(): Int32; override;
var
w,h,bmp,src:Int32;
TPA:TPointArray;
tmpVar:String;
begin
try
src := BitmapFromClient(762,31,790,38);
bmp := CreateBitmap(50,25);
FastDrawTransparent(5,5,src,bmp);
FreeBitmap(src);
GetBitmapSize(bmp,w,h);
W *= 6;
H *= 6;
ResizeBitmapEx(bmp,RM_Bilinear,w,h);
FindColorsTolBitmap(bmp, TPA, $FFFFFF, [0,0,w-1,h-1], Trunc(441.6*0.4));
FastDrawClear(bmp, 0);
DrawTPABitmap(bmp, TPA, $FFFFFF);
tmpVar := Tesseract_GetText(bmp, TESS_WHITELIST_NUMBERS+'%');
Result := StrToIntDef(ExtractFromStr(tmpVar, NUMBERS), -1);
finally
FreeBitmap(bmp);
end;
end;
*waits for cup*