Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleOCR update #79

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osr/antiban.simba
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ begin
begin
B := Box(MainScreen.Center, 250, 100);

if OCR.LocateText(B, Name, RS_FONT_BOLD_12, TOCRColorRule.Create([$00FFFF, 0]), 0.85) then
if OCR.LocateText(B, Name, RS_FONT_BOLD_12, TOCRColorFilter.Create([$00FFFF, 0]), 0.85) then
begin
if Self.DebugRandoms then
begin
Expand Down
4 changes: 2 additions & 2 deletions osr/bank.simba
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,9 @@ begin
TPA := ATPA[0];

//Now we run OCR on the number TPA to find out what number is it and set our result
Result := OCR.RecognizeNumber(TPA.Bounds, TOCRColorRule.Create([10672356]), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber(TPA.Bounds, TOCRColorFilter.Create([10672356]), RS_FONT_PLAIN_11);
if Result = 0 then
Result := OCR.RecognizeNumber(TPA.Bounds, TOCRColorRule.Create([16777215]), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber(TPA.Bounds, TOCRColorFilter.Create([16777215]), RS_FONT_PLAIN_11);

if (Result > 0) and OpenTab then
Self.OpenTab(Result);
Expand Down
8 changes: 4 additions & 4 deletions osr/bankpin.simba
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ function TRSBankPin.Enter(Pin: String): Boolean;

function GetDigitToEnter: Char;
begin
if OCR.LocateText(Self.Bounds, 'FIRST', RS_FONT_BOLD_12, TOCRColorRule.Create([$FFFFFF]), 1) then Exit(Pin[1]);
if OCR.LocateText(Self.Bounds, 'SECOND', RS_FONT_BOLD_12, TOCRColorRule.Create([$FFFFFF]), 1) then Exit(Pin[2]);
if OCR.LocateText(Self.Bounds, 'THIRD', RS_FONT_BOLD_12, TOCRColorRule.Create([$FFFFFF]), 1) then Exit(Pin[3]);
if OCR.LocateText(Self.Bounds, 'FOURTH', RS_FONT_BOLD_12, TOCRColorRule.Create([$FFFFFF]), 1) then Exit(Pin[4]);
if OCR.LocateText(Self.Bounds, 'FIRST', RS_FONT_BOLD_12, TOCRColorFilter.Create([$FFFFFF]), 1) then Exit(Pin[1]);
if OCR.LocateText(Self.Bounds, 'SECOND', RS_FONT_BOLD_12, TOCRColorFilter.Create([$FFFFFF]), 1) then Exit(Pin[2]);
if OCR.LocateText(Self.Bounds, 'THIRD', RS_FONT_BOLD_12, TOCRColorFilter.Create([$FFFFFF]), 1) then Exit(Pin[3]);
if OCR.LocateText(Self.Bounds, 'FOURTH', RS_FONT_BOLD_12, TOCRColorFilter.Create([$FFFFFF]), 1) then Exit(Pin[4]);
end;

var
Expand Down
10 changes: 5 additions & 5 deletions osr/chat.simba
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ var
begin
for Color in Colors do
begin
Result := OCR.RecognizeStatic(Self.GetLineBoxes()[CHAT_INPUT_LINE], TOCRColorRule.Create([Color]), RS_FONT_PLAIN_12);
Result := OCR.RecognizeStatic(Self.GetLineBoxes()[CHAT_INPUT_LINE], TOCRColorFilter.Create([Color]), RS_FONT_PLAIN_12);
if Result <> '' then
Break;
end;
Expand Down Expand Up @@ -206,7 +206,7 @@ Example
*)
function TRSChat.GetQuery: String;
begin
Result := OCR.Recognize(Self.Bounds(), TOCRColorRule.Create([$000000]), RS_FONT_BOLD_12);
Result := OCR.Recognize(Self.Bounds(), TOCRColorFilter.Create([$000000]), RS_FONT_BOLD_12);
end;

(*
Expand All @@ -223,7 +223,7 @@ Example
*)
function TRSChat.GetQueryAnswer: String;
begin
Result := OCR.Recognize(Self.Bounds(), TOCRColorRule.Create([8388608]), RS_FONT_BOLD_12);
Result := OCR.Recognize(Self.Bounds(), TOCRColorFilter.Create([8388608]), RS_FONT_BOLD_12);
end;

(*
Expand Down Expand Up @@ -291,7 +291,7 @@ var
Boxes: TBoxArray;
I, Key: Int32;
begin
Strings := OCR.RecognizeMulti(Self.Bounds(), TOCRColorRule.Create(Colors), RS_FONT_QUILL_8, Boxes);
Strings := OCR.RecognizeLines(Self.Bounds(), TOCRColorFilter.Create(Colors), RS_FONT_QUILL_8, Boxes);

SetLength(Result, Length(Strings));
for I := 0 to High(Result) do
Expand Down Expand Up @@ -437,7 +437,7 @@ begin
if (Matrix[StaticOffset][X] = CHAT_COLOR_BLACK) theN
Matrix[StaticOffset][X] := Colors[0];

Result := OCR.RecognizeStatic(Matrix, TOCRColorRule.Create(Colors), RS_FONT_PLAIN_12);
Result := OCR._RecognizeStatic(Matrix, TOCRColorFilter.Create(Colors), RS_FONT_PLAIN_12);
end;
end;

Expand Down
2 changes: 1 addition & 1 deletion osr/chooseoption.simba
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ begin
if (B.Y2 > Bounds.Y2) then
Exit;

Result[I].Text := OCR.RecognizeStatic(B, TOCRThresholdRule.Create(-1), RS_FONT_BOLD_12_SHADOW);
Result[I].Text := OCR.RecognizeStatic(B, TOCRThresholdFilter.Create(-1), RS_FONT_BOLD_12_SHADOW);
Result[I].Bounds := B;
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions osr/combat.simba
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ begin
B := Self.Bounds;
B.Y2 := B.Y1 + 25;

Result := OCR.Recognize(B, TOCRColorRule.Create([2070783]), RS_FONT_QUILL_8);
Result := OCR.Recognize(B, TOCRColorFilter.Create([2070783]), RS_FONT_QUILL_8);
end;

(*
Expand Down Expand Up @@ -307,7 +307,7 @@ begin
B.X1 += 20;
B.X2 -= 20;

Result := OCR.RecognizeNumber(B, TOCRColorRule.Create([2070783]), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber(B, TOCRColorFilter.Create([2070783]), RS_FONT_PLAIN_11);
end;

(*
Expand Down
32 changes: 16 additions & 16 deletions osr/grandexchange.simba
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ begin
B.Y2 := Self.Y1 + 65;

case Self.GetCurrentInterface() of
ERSGEInterface.OFFER_SETUP: Result := OCR.Recognize(B, TOCRColorRule.Create([2070783]), RS_FONT_BOLD_12);
ERSGEInterface.OFFER_STATUS: Result := OCR.Recognize(B, TOCRColorRule.Create([2070783]), RS_FONT_BOLD_12);
ERSGEInterface.OFFER_SETUP: Result := OCR.Recognize(B, TOCRColorFilter.Create([2070783]), RS_FONT_BOLD_12);
ERSGEInterface.OFFER_STATUS: Result := OCR.Recognize(B, TOCRColorFilter.Create([2070783]), RS_FONT_BOLD_12);
end;
end;

Expand All @@ -213,7 +213,7 @@ begin
end;

if Button.Visible() then
Result := OCR.RecognizeNumber(Button.Bounds, TOCRColorRule.Create([4176127]), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber(Button.Bounds, TOCRColorFilter.Create([4176127]), RS_FONT_PLAIN_11);
end;

function TRSGrandExchange.GetItemPrice: Int32;
Expand All @@ -226,7 +226,7 @@ begin
end;

if Button.Visible() then
Result := OCR.RecognizeNumber(Button.Bounds, TOCRColorRule.Create([4176127]), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber(Button.Bounds, TOCRColorFilter.Create([4176127]), RS_FONT_PLAIN_11);
end;

function TRSGrandExchange.GetItemTotalPrice: Int32;
Expand All @@ -239,7 +239,7 @@ begin
end;

if Button.Visible() then
Result := OCR.RecognizeNumber(Button.Bounds, TOCRColorRule.Create([$FFFFFF]), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber(Button.Bounds, TOCRColorFilter.Create([$FFFFFF]), RS_FONT_PLAIN_11);
end;

function TRSGrandExchange.GetItemGuidePrice: Int32;
Expand All @@ -259,13 +259,13 @@ begin
B.Y2 += 20;
B.X2 += 40;

Result := OCR.RecognizeNumber(B, TOCRColorRule.Create([4176127]), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber(B, TOCRColorFilter.Create([4176127]), RS_FONT_PLAIN_11);
end;
end;

function TRSGrandExchange.IsSearchOpen: Boolean;
begin
Result := OCR.LocateText(Chat.Bounds, 'What would you like to buy', RS_FONT_BOLD_12, TOCRColorRule.Create([$000000]), 1);
Result := OCR.LocateText(Chat.Bounds, 'What would you like to buy', RS_FONT_BOLD_12, TOCRColorFilter.Create([$000000]), 1);
end;

function TRSGrandExchange.OpenSearch: Boolean;
Expand All @@ -279,7 +279,7 @@ end;

function TRSGrandExchange.GetCurrentSearch: String;
begin
Result := OCR.Recognize(Chat.Bounds, TOCRColorRule.Create([8388608]), RS_FONT_BOLD_12).StripR('*');
Result := OCR.Recognize(Chat.Bounds, TOCRColorFilter.Create([8388608]), RS_FONT_BOLD_12).StripR('*');
end;

function TRSGrandExchange.ClearSearch: Boolean;
Expand All @@ -295,14 +295,14 @@ begin
if (Item <> '') then
Item[1] := UpCase(Item[1]);

Result := OCR.LocateText(Chat.Bounds, Item, RS_FONT_PLAIN_12, TOCRColorRule.Create([$000000]), B) = 1;
Result := OCR.LocateText(Chat.Bounds, Item, RS_FONT_PLAIN_12, TOCRColorFilter.Create([$000000]), B) = 1;
end;

function TRSGrandExchange.ClickSearch(Item: String): Boolean;
var
B: TBox;
begin
Result := Self.IsSearchOpen() and (OCR.LocateText(Chat.Bounds, Item, RS_FONT_PLAIN_12, TOCRColorRule.Create([$000000]), B) = 1);
Result := Self.IsSearchOpen() and (OCR.LocateText(Chat.Bounds, Item, RS_FONT_PLAIN_12, TOCRColorFilter.Create([$000000]), B) = 1);
if Result then
Mouse.Click(B, MOUSE_LEFT);
end;
Expand All @@ -311,7 +311,7 @@ function TRSGrandExchange.Search(Item: String; Click: Boolean): Boolean;
var
B: TBox;
begin
if OCR.LocateText(Chat.Bounds, Item, RS_FONT_BOLD_12, TOCRColorRule.Create([8388608]), 1) then
if OCR.LocateText(Chat.Bounds, Item, RS_FONT_BOLD_12, TOCRColorFilter.Create([8388608]), 1) then
Exit(True);

if Self.OpenSearch() and Self.ClearSearch() then
Expand Down Expand Up @@ -358,16 +358,16 @@ var
begin
Slots := Self.GetOfferSlots();

case OCR.Recognize(Slots[Slot], TOCRColorRule.Create([2070783]), RS_FONT_BOLD_12) of
case OCR.Recognize(Slots[Slot], TOCRColorFilter.Create([2070783]), RS_FONT_BOLD_12) of
'Empty': Result.OfferType := ERSGEOfferType.EMPTY;
'Buy': Result.OfferType := ERSGEOfferType.BUY;
'Sell': Result.OfferType := ERSGEOfferType.SELL;
end;

if (Result.OfferType <> ERSGEOfferType.EMPTY) then
begin
Result.Item := OCR.RecognizeMulti(Slots[Slot], TOCRColorRule.Create([4176127]), RS_FONT_PLAIN_11).Merge(' ');
Result.PricePerItem := OCR.RecognizeNumber(Slots[Slot], TOCRColorRule.Create([2070783]), RS_FONT_PLAIN_11);
Result.Item := OCR.RecognizeLines(Slots[Slot], TOCRColorFilter.Create([4176127]), RS_FONT_PLAIN_11).Merge(' ');
Result.PricePerItem := OCR.RecognizeNumber(Slots[Slot], TOCRColorFilter.Create([2070783]), RS_FONT_PLAIN_11);
Result.Quantity := SRL.GetItemAmount(Slots[Slot]);
Result.TotalPrice := Result.Quantity * Result.PricePerItem;
Result.Progress := Self.GetProgress(Slots[Slot], 105);
Expand Down Expand Up @@ -409,15 +409,15 @@ begin

Item := [];
Item.Bounds := Row;
Item.Item := OCR.Recognize(Columns[1].Expand(25, 0), TOCRColorRule.Create([4176127, $FFFFFF]), RS_FONT_PLAIN_12);
Item.Item := OCR.Recognize(Columns[1].Expand(25, 0), TOCRColorFilter.Create([4176127, $FFFFFF]), RS_FONT_PLAIN_12);
if (Item.Item = '') then
Continue;

Item.Quantity := SRL.GetItemAmount(Columns[2]);
if (Item.Quantity = 0) Then
Item.Quantity := 1;

Item.TotalPrice := OCR.RecognizeNumber(Columns[3], TOCRColorRule.Create([2070783]), RS_FONT_PLAIN_11);
Item.TotalPrice := OCR.RecognizeNumber(Columns[3], TOCRColorFilter.Create([2070783]), RS_FONT_PLAIN_11);
Item.PricePerItem := Item.TotalPrice div Item.Quantity;

Result := Result + Item;
Expand Down
6 changes: 3 additions & 3 deletions osr/interface.simba
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,12 @@ end;

function TRSButton.FindText(constref Text: String; constref Font: TFontSet; Color: Int32): Boolean; constref; overload;
begin
Result := OCR.LocateText(Self.Bounds, Text, Font, TOCRColorRule.Create([Color]), 1);
Result := OCR.LocateText(Self.Bounds, Text, Font, TOCRColorFilter.Create([Color]), 1);
end;

function TRSButton.FindText(constref Text: String; constref Font: TFontSet): Boolean; constref; overload;
begin
Result := OCR.LocateText(Self.Bounds, Text, Font, TOCRAnyColorRule.Create(0), 1);
Result := OCR.LocateText(Self.Bounds, Text, Font, TOCRColorFilter.Create([0]), 1);
end;

function TRSButton.FindText(Text: TStringArray; constref Font: TFontSet; out Found: String): Boolean; constref; overload;
Expand Down Expand Up @@ -521,7 +521,7 @@ begin
B.Y2 := B.Y1 + 15;
B.LimitTo(Self.Bounds);

Result := OCR.Recognize(B, TOCRThresholdRule.Create(15), RS_FONT_BOLD_12);
Result := OCR.Recognize(B, TOCRThresholdFilter.Create(15), RS_FONT_BOLD_12);
end;

function TRSTitledInteface.ClickCloseButton(PressEscape: Boolean = False): Boolean;
Expand Down
12 changes: 6 additions & 6 deletions osr/login.simba
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ You probably will never to use this directly.
*)
function TRSLogin.FindText(Text: String; out B: TBox): Boolean;
begin
Result := (OCR.LocateText(Self.Bounds, Text, RS_FONT_BOLD_12, TOCRColorRule.Create([$FFFFFF]), B) = 1) or
(OCR.LocateText(Self.Bounds, Text, RS_FONT_BOLD_12, TOCRColorRule.Create([$00FFFF]), B) = 1) or
(OCR.LocateText(Self.Bounds, Text, RS_FONT_PLAIN_12, TOCRColorRule.Create([$FFFFFF]), B) = 1) or
(OCR.LocateText(Self.Bounds, Text, RS_FONT_PLAIN_11, TOCRColorRule.Create([$FFFFFF]), B) = 1);
Result := (OCR.LocateText(Self.Bounds, Text, RS_FONT_BOLD_12, TOCRColorFilter.Create([$FFFFFF]), B) = 1) or
(OCR.LocateText(Self.Bounds, Text, RS_FONT_BOLD_12, TOCRColorFilter.Create([$00FFFF]), B) = 1) or
(OCR.LocateText(Self.Bounds, Text, RS_FONT_PLAIN_12, TOCRColorFilter.Create([$FFFFFF]), B) = 1) or
(OCR.LocateText(Self.Bounds, Text, RS_FONT_PLAIN_11, TOCRColorFilter.Create([$FFFFFF]), B) = 1);
end;

function TRSLogin.FindText(Text: String): Boolean; overload;
Expand Down Expand Up @@ -203,7 +203,7 @@ function TRSLogin.ClickWorld(World: Int32): Boolean;
var
B: TBox;
begin
Result := OCR.LocateText(Self.Bounds, ToString(World), RS_FONT_BOLD_12, TOCRColorRule.Create([$000000]), B) = 1;
Result := OCR.LocateText(Self.Bounds, ToString(World), RS_FONT_BOLD_12, TOCRColorFilter.Create([$000000]), B) = 1;

if Result then
begin
Expand Down Expand Up @@ -309,7 +309,7 @@ begin
begin
B.Y1 -= 25;

Result := OCR.RecognizeNumber(B, TOCRColorRule.Create([$FFFFFF]), RS_FONT_BOLD_12);
Result := OCR.RecognizeNumber(B, TOCRColorFilter.Create([$FFFFFF]), RS_FONT_BOLD_12);
end;
end;

Expand Down
19 changes: 15 additions & 4 deletions osr/mainscreen.simba
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ type
end;

TRSMainScreen = record(TRSInterface)
UpTextBitmapBuffer: TMufasaBitmap;
UpTextArea: TBox;
UpTextFilter: TCompareRules;
UpTextFilter: TOCRFilter;

YellowClicks: TIntegerArray;
RedClicks: TIntegerArray;
Expand All @@ -154,6 +155,7 @@ procedure TRSMainScreen.Free;
var
Bitmap: Int32;
begin
Self.UpTextBitmapBuffer.Free();
for Bitmap in Self.YellowClicks + Self.RedClicks do
FreeBitmap(Bitmap);
end;
Expand All @@ -175,7 +177,8 @@ begin

Self.Name := 'MainScreen';

Self.UpTextFilter := TOCRAnyColorRule.Create(85, 60);
Self.UpTextBitmapBuffer.Init(Client.GetMBitmaps());
Self.UpTextFilter := TOCRAnyColorFilter.Create(85, 65);
Self.UpTextFilter.MinCharacterMatch := '-';

Self.YellowClicks := [
Expand Down Expand Up @@ -237,8 +240,16 @@ Example
WriteLn(MainScreen.GetUpText());
*)
function TRSMainScreen.GetUpText(): String;
var
Bitmap: TMufasaBitmap;
begin
Result := OCR.RecognizeStatic(Self.UpTextArea, Self.UpTextFilter, RS_FONT_BOLD_12_SHADOW);
with Self.UpTextArea do
Self.UpTextBitmapBuffer.CopyClientToBitmap(Client.GetIOManager(), True, X1,Y1,X2,Y2);

// improve when bankscreen (and other interfaces) are open
// replace orange title text with interface background color
Self.UpTextBitmapBuffer.ReplaceColor(2070783, 3424329);
Result := OCR._RecognizeStatic(Self.UpTextBitmapBuffer.ToMatrix(), Self.UpTextFilter, RS_FONT_BOLD_12_SHADOW);

{$IFDEF SRL_DEBUG_UPTEXT}
Self.DebugLn('UpText: ' + Result);
Expand Down Expand Up @@ -611,7 +622,7 @@ function TRSMainScreen.FindHitsplats(Area: TBox): TRSHitsplatArray;
for B in TPA.Cluster(3).ToTBA() do
if (B.Width >= 10) and (B.Height >= 10) then
begin
Hit := OCR.RecognizeNumber(B.Expand(5, Area), TOCRColorRule.Create([$FFFFFF]), RS_FONT_PLAIN_11);
Hit := OCR.RecognizeNumber(B.Expand(5, Area), TOCRColorFilter.Create([$FFFFFF]), RS_FONT_PLAIN_11);

Result += [B.Middle(), Hit, Red];
end;
Expand Down
2 changes: 1 addition & 1 deletion osr/make.simba
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ begin
if not WaitUntil((TPA := Self.FindHint()) <> [], SRL.TruncatedGauss(50, 1500), 4000) then
Continue;

if SameText(OCR.Recognize(TPA.Bounds(), TOCRColorRule.Create([0]), RS_FONT_PLAIN_12), Item) then
if SameText(OCR.Recognize(TPA.Bounds(), TOCRColorFilter.Create([0]), RS_FONT_PLAIN_12), Item) then
begin
Self.Items += [Item, Buttons[I].Index , 0];

Expand Down
2 changes: 1 addition & 1 deletion osr/minimap.simba
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ end;

function TRSMinimap.GetOrbLevel(Orb: TCircle): Int32;
begin
Result := OCR.RecognizeNumber([Orb.X-35, Orb.Y-1, Orb.X-15, Orb.Y+9], TOCRShadowRule.Create(), RS_FONT_PLAIN_11);
Result := OCR.RecognizeNumber([Orb.X-35, Orb.Y-1, Orb.X-15, Orb.Y+9], TOCRShadowFilter.Create(), RS_FONT_PLAIN_11);
end;

function TRSMinimap.GetRunEnergy: Int32;
Expand Down
6 changes: 3 additions & 3 deletions osr/misc.simba
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ get the number of stacked items there are.
function TSRL.GetItemAmount(constref Area: TBox): Int32; constref;
begin
if SRL.CountColor(RS_ITEM_YELLOW_STACK, Area) > 0 then
Result := OCR.RecognizeNumber(Area, TOCRColorRule.Create([RS_ITEM_YELLOW_STACK]), RS_FONT_PLAIN_11)
Result := OCR.RecognizeNumber(Area, TOCRColorFilter.Create([RS_ITEM_YELLOW_STACK]), RS_FONT_PLAIN_11)
else
if SRL.CountColor(RS_ITEM_WHITE_STACK, Area) > 0 then
Result := OCR.RecognizeNumber(Area, TOCRColorRule.Create([RS_ITEM_WHITE_STACK]), RS_FONT_PLAIN_11) * 1000
Result := OCR.RecognizeNumber(Area, TOCRColorFilter.Create([RS_ITEM_WHITE_STACK]), RS_FONT_PLAIN_11) * 1000
else
if SRL.CountColor(RS_ITEM_GREEN_STACK, Area) > 0 then
Result := OCR.RecognizeNumber(Area, TOCRColorRule.Create([RS_ITEM_GREEN_STACK]), RS_FONT_PLAIN_11) * 1000000;
Result := OCR.RecognizeNumber(Area, TOCRColorFilter.Create([RS_ITEM_GREEN_STACK]), RS_FONT_PLAIN_11) * 1000000;
end;

(*
Expand Down
2 changes: 1 addition & 1 deletion osr/prayer.simba
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ begin

if (GameTabs.GetCurrentTab() = ERSGameTab.PRAYER) then
begin
Text := OCR.Recognize(Self.Bounds, TOCRColorRule.Create([$1F98FF]), RS_FONT_PLAIN_12);
Text := OCR.Recognize(Self.Bounds, TOCRColorFilter.Create([$1F98FF]), RS_FONT_PLAIN_12);

Result := Text.Before('/').ExtractNumber();
end;
Expand Down
Loading