SRL Archive - Help

Why won't this find my text.


NexPB

2012-01-21 13:55:22

Title.

function FindInstruction: String;
Var
box: TBox;
begin
box := IntToBox(207, 37, 309, 54);
SMART_DrawBox(box);

if (FindTextTPA(clWhite, 20, box.X1, box.Y1, box. X2, box.Y2, 'Helm', SmallChars, nothing)) then
begin
Writeln('Found instrcution.');
Result := 'helm';
end else
if (FindTextTPA(clWhite, 20, box.X1, box.Y1, box. X2, box.Y2, 'Boots', SmallChars, nothing)) then
begin
Writeln('Found instrcution.');
Result := 'boots';
end else
if (FindTextTPA(clWhite, 20, box.X1, box.Y1, box. X2, box.Y2, 'Chestplate', SmallChars, nothing)) then
begin
Writeln('Found instrcution.');
Result := 'body';
end else
if (FindTextTPA(clWhite, 20, box.X1, box.Y1, box. X2, box.Y2, 'Gauntlets', SmallChars, nothing)) then
begin
Writeln('Found instrcution.');
Result := 'gaunts';
end else
Exit;

end;

Brandon

2012-01-21 14:00:03

Well firstly, your asking it to find text in a box.. Is this text visible to your eyes? If not, it won't find it.. you might have to move the mouse over each item and find the uptext.. OR right click each one so the text shows.. FindText TPA can only find text that you can see.

Check out some functions like IsXPBarOpen, GetChooseOptions, etc..

NexPB

2012-01-21 14:02:13

From: ggzz
Well firstly, your asking it to find text in a box.. Is this text visible to your eyes? If not, it won't find it.. you might have to move the mouse over each item and find the uptext.. OR right click each one so the text shows.. FindText TPA can only find text that you can see.

Check out some functions like IsXPBarOpen, GetChooseOptions, etc..

As you can see I made it draw a box the box is exactly around the text :s

Brandon

2012-01-21 14:10:30

From: NexPB
As you can see I made it draw a box the box is exactly around the text :s


I think you misunderstood.. regardless if it has the box, the text MUST be visible to your eyes.. if you cannot see it, how can the script see it? Screenshot the text your trying to find only then can we know what the script/you are seeing and be able to help further.

NexPB

2012-01-21 14:14:21

From: ggzz
I think you misunderstood.. regardless if it has the box, the text MUST be visible to your eyes.. if you cannot see it, how can the script see it? Screenshot the text your trying to find only then can we know what the script/you are seeing and be able to help further.

I do see the text let me upload a picture in a sec.

edit:


NexPB

2012-01-22 07:59:38

Someone can help me on this ?:p

NexPB

2012-01-23 10:53:54

Bump.

Kyle Undefined

2012-01-23 10:56:29

Are you sure it's the SmallChars? Have you tried other fonts?

NexPB

2012-01-23 11:00:55

From: Kyle Undefined
Are you sure it's the SmallChars? Have you tried other fonts?

Yes, cause its the same type I used before to check if the thingy was open to take bars.

edit: Would the size matter? cause its samller than other fonts.

Zee Best

2012-01-23 15:06:45

From: NexPB
Yes, cause its the same type I used before to check if the thingy was open to take bars.

edit: Would the size matter? cause its samller than other fonts.


I'm guessing the way that this program uses OCR is by having the characters and then finding key points etc, so, the size would matter.

Brandon

2012-01-23 15:23:03

Sorry for the late reply bro.. Never saw the thread again until now..


{$I SRL/SRL.Simba}

Function GetItems: String;
begin
Result:= GetTextAtExWrap(423, 337, 525, 352, 0, 5, 2, 16777215, 5, StatChars);
end;

begin
writeln(GetItems); //Will print Gauntlets..
end.

Change the [423, 337, 525, 352] to the right location.. I went off the bitmap u supplied and it worked.. so it will work for anything else.. To do matching, just do if GetItems = 'Gauntlets' then…

OR THE BEST WAY to do matching is with a RegExpression such as below:


{$I SRL/SRL.Simba}

Function GetItems: String;
begin
Result:= GetTextAtExWrap(423, 337, 525, 352, 0, 5, 2, 16777215, 5, StatChars);
end;

begin
writeln(GetItems); //Will print Gauntlets..

if ExecRegExpr('auntlet', GetItems) then
writeln('Found Gauntlets');
end.

Kyle Undefined

2012-01-23 16:07:36

Knew it was the font, StatChars :p

KeepBotting

2012-01-23 20:24:08

Use Safemode..

NexPB

2012-01-24 11:19:28

From: ggzz
Sorry for the late reply bro.. Never saw the thread again until now..


{$I SRL/SRL.Simba}

Function GetItems: String;
begin
Result:= GetTextAtExWrap(423, 337, 525, 352, 0, 5, 2, 16777215, 5, StatChars);
end;

begin
writeln(GetItems); //Will print Gauntlets..
end.

Change the [423, 337, 525, 352] to the right location.. I went off the bitmap u supplied and it worked.. so it will work for anything else.. To do matching, just do if GetItems = 'Gauntlets' then…

OR THE BEST WAY to do matching is with a RegExpression such as below:


{$I SRL/SRL.Simba}

Function GetItems: String;
begin
Result:= GetTextAtExWrap(423, 337, 525, 352, 0, 5, 2, 16777215, 5, StatChars);
end;

begin
writeln(GetItems); //Will print Gauntlets..

if ExecRegExpr('auntlet', GetItems) then
writeln('Found Gauntlets');
end.


Thanks.

From: Kyle Undefined
Knew it was the font, StatChars :p

Haha soz bro ;p