Log in

View Full Version : Why won't this find my text.



NexPB
01-21-2012, 06:55 PM
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
01-21-2012, 07:00 PM
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
01-21-2012, 07:02 PM
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
01-21-2012, 07:10 PM
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
01-21-2012, 07:14 PM
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:

http://i44.tinypic.com/dzi35x.png

NexPB
01-22-2012, 12:59 PM
Someone can help me on this ?:p

NexPB
01-23-2012, 03:53 PM
Bump.

Kyle Undefined
01-23-2012, 03:56 PM
Are you sure it's the SmallChars? Have you tried other fonts?

NexPB
01-23-2012, 04:00 PM
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
01-23-2012, 08:06 PM
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
01-23-2012, 08:23 PM
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
01-23-2012, 09:07 PM
Knew it was the font, StatChars :p

KeepBotting
01-24-2012, 01:24 AM
Use Safemode..

NexPB
01-24-2012, 04:19 PM
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.


Knew it was the font, StatChars :p
Haha soz bro ;p