Jump to content
Wanted

IsUpText

Recommended Posts

Stand to west of booth

 

[sCAR]{$DEFINE RS07}

//{$DEFINE SMART}

{$DEFINE OSI_RS07_Color_Anti_Randoms}

 

{$I OSI\OSI.scar}

{$I OSI\Divi\Misc\Debug.scar}

//{$I OSI\SMART\DebugSMART.scar}

{$I MSSL\MSSL.scar}

 

procedure ScriptTerminate;

begin

FreeOSI;

end;

 

begin

SetUpOSI;

MSSL_Setup;

MMouse(302, 154, 0, 0);

Wait(1000);

WriteLn(RS07_IsUpText('booth'));

end.

[/sCAR]

 

Trouble detecting a lot of words such as booth while rs_GetUpText is working accurately. Further debuging by adding DebugBitmap inside IsUpText shows the colors are picking up the pixels but IsUpText is not matching up the chars.

 

Testing I've been doing with OSI implantation

 

[sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function AllUpTextColors: TIntegerArray;

Contributors: Wanted, Janilabo.

Description: Returns all uptext colors.

Date Created: April 7th, 2013. By Wanted & Janilabo. RS07 Build ???.

Last Modified: April 7th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function AllUpTextColors: TIntegerArray;

begin

Result := [4231423, 16776960, 16777215, 255, 12543, 28927, 45311, 65535, 65472, 65408, 65344, 65280];

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function FindUpTextMultiColors(Text: TStringArray; Colors: TIntegerArray): Boolean;

Contributors: Wanted, Janilabo.

Description: Returns true if uptext is found.

Date Created: April 7th, 2013. By Wanted & Janilabo. RS07 Build ???.

Last Modified: April 7th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function FindUpTextMultiColors(Text: TStringArray; Colors: TIntegerArray): Boolean;

var

bmpText: TSCARBitmap;

Client: TSCARClient;

I, H, CTS: LongInt;

begin

Result := False;

try

bmpText := GetClient.CaptureEx(RSX1, RSY1, RSX2, 25);

CTS := GetColorToleranceSpeed;

ColorToleranceSpeed(0);

H := High(Colors);

for I := 0 to H do

ReplaceColorTol(bmpText, Colors, 1337, 80);

DebugBitmap(bmpText); // REMOVE

Client := SetClient(TSCARBitmapClient.Create(bmpText));

try

H := High(Text);

for I := 0 to H do

begin

Result := IsTextAtEx(UpTextX, UpTextY, Text, 0, UpChars2, False, False, 0, 2, 1337);

if (Result) then

Break;

end;

finally

SetClient(Client).Free;

end;

finally

bmpText.Free;

end;

ColorToleranceSpeed(CTS);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function FindUpTextMultiColor(Text: TStringArray; Color: LongInt): Boolean;

Contributors: Wanted, Janilabo.

Description: Returns true if uptext is found.

Date Created: April 7th, 2013. By Wanted & Janilabo. RS07 Build ???.

Last Modified: April 7th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function FindUpTextMultiColor(Text: TStringArray; Color: LongInt): Boolean;

begin

Result := FindUpTextMultiColors(Text, );

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function FindUpTextColors(Text: string; Colors: TIntegerArray): Boolean;

Contributors: Wanted, Janilabo.

Description: Returns true if uptext is found.

Date Created: April 7th, 2013. By Wanted & Janilabo. RS07 Build ???.

Last Modified: April 7th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function FindUpTextColors(Text: string; Colors: TIntegerArray): Boolean;

begin

Result := FindUpTextMultiColors([Text], Colors);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function FindUpTextColor(Text: string; Color: LongInt): Boolean;

Contributors: Wanted, Janilabo.

Description: Returns true if uptext is found.

Date Created: April 7th, 2013. By Wanted & Janilabo. RS07 Build ???.

Last Modified: April 7th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function FindUpTextColor(Text: string; Color: LongInt): Boolean;

begin

Result := FindUpTextMultiColors([Text], );

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function FindUpTextMulti(Text: TStringArray): Boolean;

Contributors: Wanted, Janilabo.

Description: Returns true if uptext is found.

Date Created: April 7th, 2013. By Wanted & Janilabo. RS07 Build ???.

Last Modified: April 7th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function FindUpTextMulti(Text: TStringArray): Boolean;

begin

Result := FindUpTextMultiColors(Text, AllUpTextColors);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

function FindUpText(Text: string): Boolean;

Contributors: Wanted, Janilabo.

Description: Returns true if uptext is found.

Date Created: April 7th, 2013. By Wanted & Janilabo. RS07 Build ???.

Last Modified: April 7th, 2013. By Wanted. RS07 Build ???.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

 

function FindUpText(Text: string): Boolean;

begin

Result := FindUpTextMultiColors([Text], AllUpTextColors);

end;[/sCAR]

 

Would be nice to have the UpText colors cataloged =P

 

No luck harnessing this method enough yet to make me want to implement it.

Edited by Wanted
Link to comment
Share on other sites

RS07_IsUpText() requires that the uptext either STARTS or EQUALS WITH the text you hit it with (downside of it).

 

So, you would use "Bank Bank booth" for that.

 

I see what happened here but I can't confirm because I'm on my mobile.

 

That would also elimate the need for multi text.

 

It would be nice if you could name the colors ;)

 

Also do note that the methods I posted replace all text colors you use so it's a

little different with starting/ ending text.

Edited by Wanted
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
  • Create New...