SRL Archive - OSR Help

FindText Question


King of the Nites

2011-03-21 19:22:42

Hey guys, I just got back into scripting and I have no clue what text this is:
What type of text is the 'Soft Clay'?

And is a good way of doing this to use:

function SofteningScreen : Boolean;
begin
Result := FindText(x, y, 'clay', {TextType}, MCx1, MCy1, MCx2, MCy2);
end; // ^^ is this the right area to use?

And is using MC, right for the chatbox area?

Thanks,
King of the Nites

Brandon

2011-03-21 19:30:52

I was asking the exact! same thing.. But no one really knows much about interfaces or there isnt very THOROUGH tutorials on it… Thats an interface.. and the text is a component on that interface.
And Yes MC is the chat box area..

const
Make_All = //Interface ID Here.

Procedure ClickAll;
var
Interfaces: TIntegerArray;
Text: String;
CompID: Integer;

Begin
If(ValidInterface(Make_All))Then
begin
Text:= GetInterfaceText(Make_All, CompID);
end;
End.

Problem with this is that your going to get an Interface, Child Component.. and Another one (Might be a ComponentID)… At least When I found that interface, I couldnt interact with it for that reason :S

King of the Nites

2011-03-21 19:36:56

From: ggzz
I was asking the exact! same thing.. But no one really knows much about interfaces or there isnt very THOROUGH tutorials on it… Thats an interface.. and the text is a component on that interface.
And Yes MC is the chat box area..

const
Make_All = //Interface ID Here.

Procedure ClickAll;
var
Interfaces: TIntegerArray;
Text: String;
CompID: Integer;

Begin
If(ValidInterface(Make_All))Then
begin
Text:= GetInterfaceText(Make_All, CompID);
end;
End.

Problem with this is that your going to get an Interface, Child Component.. and Another one (Might be a ComponentID)… At least When I found that interface, I couldnt interact with it for that reason :S


That's reflection right? Because I'm making it 100% color… But thanks for responding so fast! :)

Brandon

2011-03-21 20:19:58

Well U can of course make a bitmap of it or a dtm or something.. Im not exactly sure why you want to find the "Text" But simba has quite a lot of OCR functions.. To find the text, Can you not use the UpText?

Im almost 100% sure when u point the mouse over that, the text shows up in the top left corner of the screen and thats then you can use the IsUpText function.

King of the Nites

2011-03-21 20:27:59

From: ggzz
Well U can of course make a bitmap of it or a dtm or something.. Im not exactly sure why you want to find the "Text" But simba has quite a lot of OCR functions.. To find the text, Can you not use the UpText?

Im almost 100% sure when u point the mouse over that, the text shows up in the top left corner of the screen and thats then you can use the IsUpText function.


Never thought of that haha, thanks! rep + :)

Floor66

2011-03-22 02:01:06

Why can't you do a GetColor? iirc that text colour is static, and else you just add a tolerance to it.
When I had to do this for a certain scrip btw, I just made it wait until it found the DTM (In your case of the soft clay) in the chat box.

lordsaturn

2011-03-22 02:08:54

Use this to find which chars you need to use:
function SofteningScreen : Boolean;
var
charsarr:tstringarray;
i,x,y: integer;
begin
charsarr := [BigChars, CharsNPC, CharsTrade, Fonts, FriendChars, LoginChars, SmallChars, StatChars, UpChars, XPChars];
for i := 0 to High(charsarr) do
begin
Result := FindText(x, y, 'clay', charsarr[i], MCx1, MCy1, MCx2, MCy2);
if Result then
begin
Writeln('Found text using '+charsarr[i]);
Exit;
end;
end;
end;

On what floor66 said, a countcolor might be more efficient.

Bonfield

2011-03-22 08:31:33

tr_Letters works for the white letters

here is what i use


function PizzaMenuUp :Boolean;
var
x, y: Integer;
begin
Result := GetTextAtEx(MENU_PT_X, MENU_PT_Y, 5, SmallChars, True, False, 0, 0, COL_MENU_WHITE, 3, True, tr_Letters) = 'How';
if not Result and (FindColorSpiralTolerance(x, y, COL_MENU_ORANGE, MCX1, MCY1, MCX2, MCY2, 2)) then
Result := True;
end;

that searches for both the white text 'how' and the orange colour of the text

Emaziz

2011-03-22 08:58:34

StatChars. It's StatChars :)

EDIT: Wow, noone bothered looking up in Simba/Fonts? :p