Results 1 to 9 of 9

Thread: FindText Question

  1. #1
    Join Date
    Jul 2007
    Location
    Ohio
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindText Question

    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:
    Simba Code:
    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

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    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..

    Simba Code:
    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
    Last edited by Brandon; 03-21-2011 at 11:35 PM.

  3. #3
    Join Date
    Jul 2007
    Location
    Ohio
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    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..

    Simba Code:
    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!

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    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.

  5. #5
    Join Date
    Jul 2007
    Location
    Ohio
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    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 +

  6. #6
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    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.
    Ce ne sont que des gueux


  7. #7
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Use this to find which chars you need to use:
    Simba Code:
    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.

  8. #8
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    tr_Letters works for the white letters

    here is what i use

    Simba Code:
    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



  9. #9
    Join Date
    Mar 2009
    Location
    Norway
    Posts
    493
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    StatChars. It's StatChars

    EDIT: Wow, noone bothered looking up in Simba/Fonts?
    Last edited by Emaziz; 03-22-2011 at 01:04 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •