Results 1 to 8 of 8

Thread: function IsTextAtTPA

  1. #1
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default function IsTextAtTPA

    Hi, I wanted to make my own version of is text at, but, using TPAs. I don't like the FindText functions, they confuse me

    Anyways, here it is.

    SCAR Code:
    function IsTextAtTPA(Text: string; x1, x2, x3, x4: integer; color, tolerance: integer): boolean;
    var TextTPA, TextColorTPA, Matches: TPointArray;
    begin
      TextTPA := CreateTPAFromText(Text, Length(Text));
      FindColorsTolerance(TextColorTPA, color, x1, x2, x3, x4, tolerance);
      Result := FindTPAinTPA(TextColorTPA, TextTPA, Matches);
    end;

    Edit: I have a new function:

    SCAR Code:
    function IsInChatTPA(Text: string): boolean;
    var TextTPA, ColorTextTPA, Matches: TPointArray;
    begin
      TextTPA := CreateTPAFromText(Text, Length(Text));
      FindColorsSpiralTolerance(MCCX, MCCY, ColorTextTPA, 16711680, MCX1, MCY1, MCX2, MCY2, 5);
      Result := FindTPAinTPA(ColorTextTPA, TextTPA, Matches);
    end;

    Thanks,
    Cut em2 it
    Formerly known as Cut em2 it

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I like FindText functions, i uderstand them lol. Nice function with TPAs, im trying to learn them.

  3. #3
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    lol thanks btw!

    Cut em2 it
    Formerly known as Cut em2 it

  4. #4
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    There is one in SRL, its different.. Called something like FindTextTPA or something like that..

    It uses a different version of FindTPAInTPA, since that doesn't work with stuff like . , etc..

    EDIT:
    SCAR Code:
    {*******************************************************************************
    Function FindTextTpa(Color,Tol,xs,ys,xe,ye : integer; Txt : string; Chars : Integer; Action  : (ClickLeft,ClickRight,Move,Nothing)) : Boolean;
    By: Raymond
    Description: Uses TPA's to find text.. In action you can put what you want to do after its found..
    Nothing - Just return wether its found
    Move - Just move the mouse to it
    Clickleft - Movemouse & Clickmouse left
    Clickright - MoveMouse & Clickmouse right
    *******************************************************************************}
    Verrekte Koekwous

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

    Default

    Actually I got question whats wrong with SRL's findtext, but yours is nice aswell

    But, you could remove few lines

    SCAR Code:
    function IsTextAtTPA(Text: string; x1, x2, x3, x4: integer; color, tolerance: integer): boolean;
    var
      ThatLength: integer;
      TextTPA, TextColorTPA, Matches: TPointArray;
    begin
      ThatLength := Length(Text);
      TextTPA := CreateTPAFromText(Text, ThatLength);
      FindColorsTolerance(TextColorTPA, color, x1, x2, x3, x4, tolerance);
      Result := FindTPAinTPA(TextColorTPA, TextTPA, Matches)
    end;

    Nice anyways...
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  6. #6
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Thanks, for everyone's input. Mastaraymond, I wasn't aware of that function, thanks

    Cut em2 it

    @ Negaal - It uses like different spacing booleans and strict and chars, it doesn't make much sense to me at all...
    Formerly known as Cut em2 it

  7. #7
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Negaal View Post
    Actually I got question whats wrong with SRL's findtext, but yours is nice aswell

    But, you could remove few lines

    SCAR Code:
    function IsTextAtTPA(Text: string; x1, x2, x3, x4: integer; color, tolerance: integer): boolean;
    var
      ThatLength: integer;
      TextTPA, TextColorTPA, Matches: TPointArray;
    begin
      ThatLength := Length(Text);
      TextTPA := CreateTPAFromText(Text, ThatLength);
      FindColorsTolerance(TextColorTPA, color, x1, x2, x3, x4, tolerance);
      Result := FindTPAinTPA(TextColorTPA, TextTPA, Matches)
    end;

    Nice anyways...
    TPA Text finding is way faster
    Verrekte Koekwous

  8. #8
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I agree Raymond. Look at FindTalk, super speed

    Cut em2 it
    Formerly known as Cut em2 it

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. Any function that does this?
    By shadowpwner in forum OSR Help
    Replies: 2
    Last Post: 08-14-2007, 03:15 AM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 AM

Posting Permissions

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