Simba Code:
function TRSGrandExchange.getProgressNumbers(): TIntegerArray;
var
textArea1 : TBox := [self.x1 + 29, self.y1 + 366, self.x1 + 423, self.y1 + 382];
textArea2 : TBox := [self.x1 + 29, self.y1 + 382, self.x1 + 423, self.y1 + 398];
TessFilter: TTesseractFilter = [4, 4, [False, 24, TM_Mean]];
TABMap1, TABMap2, x, y : Integer;
TessStr : String;
Nums : TStringArray;
begin
if not self.isOpen() then
begin
print('TRSGrandExchange.abortSlot(): Cannot abort as the GE is not open', TDebug.ERROR);
exit([-1]);
end;
TABMap1 := BitmapFromClient(textArea1);
TABMap2 := BitmapFromClient(textArea2);
//DebugBitmap(TABMap); //a
for x := 0 to 394 do
begin
for y:= 0 to 16 do
begin
if not SimilarColors(FastGetPixel(TABMap1,x,y),224656,80) then
FastSetPixel(TABMap1,x,y,0)
else
FastSetPixel(TABMap1,x,y,255);
if not SimilarColors(FastGetPixel(TABMap2,x,y),224656,80) then
FastSetPixel(TABMap2,x,y,0)
else
FastSetPixel(TABMap2,x,y,255);
end;
end;
//DebugBitmap(TABMap); //b
Tesseract_ApplyFilter(TABMap1,TessFilter);
Tesseract_ApplyFilter(TABMap2,TessFilter);
DebugBitmap(TABMap2); //c
SetLength(Nums,2);
Nums[0] := Tesseract_GetText(TABMap1);
Nums[1] := Tesseract_GetText(TABMap2);
Writeln(Nums[0]);
WriteLn(Nums[1]);
//fix string up
for x := 0 to 1 do
begin
for y := 0 to length(Nums[x]) do
begin
if not isStrInArr(Nums[x][y],false,['1','2','3','4','5','6','7','8','9','0']) then
Delete(Nums[x],y,1);
end;
end;
Writeln(Nums[0]);
WriteLn(Nums[1]);
Result := [StrToInt(Nums[0]),StrToInt(Nums[1])];
FreeBitmap(TABMap1);
FreeBitmap(TABMap2);
end;