Results 1 to 6 of 6

Thread: First TPA function - FindObjTPAEx

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

    Default First TPA function - FindObjTPAEx

    My first TPA function

    SCAR Code:
    function FindObjTPAEx(var x,y : Integer; Color,Tol,CTS,ObjWidth,ObjHeight,MinPoints : Integer; UpText : String; x1,y1,x2,y2 : Integer) : Boolean;
    var
     fx,CurrentCTS,yx,i,a,b : Integer;
     Points : TPointArray;
     PointsEx : T2DPointArray;
    begin
      CurrentCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(CTS);
      a := GetSystemTime;
      FindColorsSpiralTolerance(fx, yx, Points, Color, x1, y1, x2, y2, Tol)
      if Length(Points) < MinPoints then
      begin
        PointsEx := TPAToATPAEx(Points, ObjWidth, ObjHeight);
        for i:=0 to Length(PointsEx)-1 do
        begin
          if Length(Points) < MinPoints then
          MiddleTPAEx(PointsEx[i], fx, yx);
          MMouse(fx, yx, 5, 5);
          if IsUpText(UpText) then
          begin
            GetMousePos(x,y);
            Result := True;
            ColorToleranceSpeed(CurrentCTS);
            b := GetSystemTime - a;
            Writeln('Finding Obj took : '+inttostr(b)+' msecs');
          end else
          Result := False;
          ColorToleranceSpeed(CurrentCTS);
        end;
      end else
      Result := False;
      ColorToleranceSpeed(CurrentCTS);
    end;


  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Example pl0x?

  3. #3
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Franky, there is so many of these I'm not really impressed...


    But I'm sure you learned something in the process.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  4. #4
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Hmm, some things -

    Result := False;
    ColorToleranceSpeed(CurrentCTS);
    No need to return the CTS if you ain't going to use Exit


    Length(PointsEx)-1
    High(PointsEx).

  5. #5
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    looks like you got the hang of TPAs ... gratz man
    METAL HEAD FOR LIFE!!!

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

    Default

    Quote Originally Posted by Da 0wner View Post
    Example pl0x?
    What's hard there?
    e.g:
    SCAR Code:
    if FindObjTPAEx(x, y, 51564, 10, 1, 20, 15, 2, 'Oak', MSX1, MSY1, MSX2, MSY2) then
    Mouse(x, y, 5, 5, True)
    blabla...

    Quote Originally Posted by R0b0t1 View Post
    Franky, there is so many of these I'm not really impressed...


    But I'm sure you learned something in the process.


    Quote Originally Posted by n3ss3s View Post
    Hmm, some things -



    No need to return the CTS if you ain't going to use Exit




    High(PointsEx).
    Kk im learning

    Quote Originally Posted by gerauchert View Post
    looks like you got the hang of TPAs ... gratz man
    You know


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
  •