Results 1 to 8 of 8

Thread: TPA Noob Problem...

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

    Default TPA Noob Problem...

    Im new at TPA's and i tried to make one:
    SCAR Code:
    function FindBankBooth : Boolean;
    var
      TPAA : TPointArray;
      ATPAA : TpointArrayArray;
      I,U,K,x,y : Integer;
    begin
      MarkTime(U);
      FindColorsTolerance(TPAA,5461593,MMX1,MMY1,MMX2,MMY2,10);
      GetArrayLength(TPAA);
      ATPAA := SplitTPAEx(TPAA,15,15);
      SortATPAFromFirstPoint(ATPAA,IntToPoint(MSCX,MSCY));
      for i:= 0 to High(TPAA) do
      begin
        MiddleTPAEx(ATPAA[i],x,y);
        MMouse(x-2,y+2,11,11);
        wait(50+random(50))
        if IsUpText('ooth') then
        begin
          Mouse(x,y,2,2,false);
          wait(100+random(100))
          ChooseOption('uickly');
          K := TimeFromMark(U);
          Result:=True;
          Writeln('Bank opened and found in '+IntToStr(K)+' milisecs');
          Exit;
        end;
      end;
    end;
    It doesnt find the ban booth...


  2. #2
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function FindBankBooth : Boolean;
    var
      TPAA : TPointArray;
      ATPAA : TpointArrayArray;
      I,U,K,x,y : Integer;
    begin
      MarkTime(U);
      FindColorsTolerance(TPAA,5461593,MMX1,MMY1,MMX2,MMY2,10);
      GetArrayLength(TPAA);
      ATPAA := TPAtoATPAEx(TPAA,15,15); //changed from SplitTPAEx,seems to  work better
      SortATPAFromFirstPoint(ATPAA,IntToPoint(MSCX,MSCY));
      for i:= 0 to High(ATPAA) do //changed from TPAA to ATPA
      begin
        if high(ATPAA) >= 3 then //added that. will only go to if there are 3 or more of the color
        begin
          MiddleTPAEx(ATPAA[i],x,y);
          MMouse(x-2,y+2,11,11);
          wait(50+random(50))
          if IsUpText('ooth') then
          begin
            Mouse(x,y,2,2,false);
            wait(100+random(100))
            ChooseOption('uickly');
            K := TimeFromMark(U);
            Result:=True;
            Writeln('Bank opened and found in '+IntToStr(K)+' milisecs');
            Exit;
          end;
        end;
      end;
    end;

    try that, if it doesn't work try changing your tolerance/ if high(ATPA) >=
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

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

    Default

    Quote Originally Posted by drizzt View Post
    SCAR Code:
    function FindBankBooth : Boolean;
    var
      TPAA : TPointArray;
      ATPAA : TpointArrayArray;
      I,U,K,x,y : Integer;
    begin
      MarkTime(U);
      FindColorsTolerance(TPAA,5461593,MMX1,MMY1,MMX2,MMY2,10);
      GetArrayLength(TPAA);
      ATPAA := TPAtoATPAEx(TPAA,15,15); //changed from SplitTPAEx,seems to  work better
      SortATPAFromFirstPoint(ATPAA,IntToPoint(MSCX,MSCY));
      for i:= 0 to High(ATPAA) do //changed from TPAA to ATPA
      begin
        if high(ATPAA) >= 3 then //added that. will only go to if there are 3 or more of the color
        begin
          MiddleTPAEx(ATPAA[i],x,y);
          MMouse(x-2,y+2,11,11);
          wait(50+random(50))
          if IsUpText('ooth') then
          begin
            Mouse(x,y,2,2,false);
            wait(100+random(100))
            ChooseOption('uickly');
            K := TimeFromMark(U);
            Result:=True;
            Writeln('Bank opened and found in '+IntToStr(K)+' milisecs');
            Exit;
          end;
        end;
      end;
    end;

    try that, if it doesn't work try changing your tolerance/ if high(ATPA) >=
    im going to try this... anyways thx!


  4. #4
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea they get pretty confusing sometimes..but after they are over they are great
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

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

    Default

    Quote Originally Posted by drizzt View Post
    SCAR Code:
    function FindBankBooth : Boolean;
    var
      TPAA : TPointArray;
      ATPAA : TpointArrayArray;
      I,U,K,x,y : Integer;
    begin
      MarkTime(U);
      FindColorsTolerance(TPAA,5461593,MMX1,MMY1,MMX2,MMY2,10);
      GetArrayLength(TPAA);
      ATPAA := TPAtoATPAEx(TPAA,15,15); //changed from SplitTPAEx,seems to  work better
      SortATPAFromFirstPoint(ATPAA,IntToPoint(MSCX,MSCY));
      for i:= 0 to High(ATPAA) do //changed from TPAA to ATPA
      begin
        if high(ATPAA) >= 3 then //added that. will only go to if there are 3 or more of the color
        begin
          MiddleTPAEx(ATPAA[i],x,y);
          MMouse(x-2,y+2,11,11);
          wait(50+random(50))
          if IsUpText('ooth') then
          begin
            Mouse(x,y,2,2,false);
            wait(100+random(100))
            ChooseOption('uickly');
            K := TimeFromMark(U);
            Result:=True;
            Writeln('Bank opened and found in '+IntToStr(K)+' milisecs');
            Exit;
          end;
        end;
      end;
    end;

    try that, if it doesn't work try changing your tolerance/ if high(ATPA) >=
    Nope, it doesnt find the bank...


  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    SCAR Code:
    function FindBankBooth : Boolean;
    var
      TPAA : TPointArray;
      ATPAA : TpointArrayArray;
      I,U,K,x,y : Integer;
    begin
      MarkTime(U);
      FindColorsTolerance(TPAA,5461593,MMX1,MMY1,MMX2,MMY2,10);
      {Maybe you want yo use a higher tolerance?}
      GetArrayLength(TPAA);    {
             What do you use this for?
             It returns an integer, you should either save the
             result, or just don't call it.  }

      ATPAA := SplitTPAEx(TPAA,15,15);
      {I personally do not use SplitTPA,
       because the distance it sorts at is not really '15',
       it varies alot. I recommend TPAToATPA.}

      SortATPAFromFirstPoint(ATPAA,IntToPoint(MSCX,MSCY));   {You can just use Point(MSCX, MSCY) here.}
      for i:= 0 to High(TPAA) do
      begin
        {Maybe a length check first?
        If Length(TPAA[i] < 5 then
          continue; }

        MiddleTPAEx(ATPAA[i],x,y);
        MMouse(x-2,y+2,11,11);
        wait(50+random(50))
        if IsUpText('ooth') then
        begin
          Mouse(x,y,2,2,false);
          wait(100+random(100))
          ChooseOption('uickly');
          K := TimeFromMark(U);
          Result:=True;
          Writeln('Bank opened and found in '+IntToStr(K)+' milisecs');
          Exit;
        end;
      end;
    end;



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Actually...demit...Wizzy pointed all out.
    Recommend you to use DTM[use DTMRotated()] for finding booth. Works very good. And lot easyer to make.

    Also this may be confusing for you.
    SCAR Code:
    {Maybe a length check first?
        If Length(TPAA[i] < 5 then
          continue; }

    it skips the loop and starts from next one.
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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

    Default

    Quote Originally Posted by Negaal View Post
    Actually...demit...Wizzy pointed all out.
    Recommend you to use DTM[use DTMRotated()] for finding booth. Works very good. And lot easyer to make.

    Also this may be confusing for you.
    SCAR Code:
    {Maybe a length check first?
        If Length(TPAA[i] < 5 then
          continue; }

    it skips the loop and starts from next one.
    k. thx negaal and wizzy.


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Noob To Noob Mentoring!
    By passiondrive in forum News and General
    Replies: 19
    Last Post: 11-11-2007, 03:23 AM
  2. Noob script ideas for a noob scripter
    By 13lacknova in forum First Scripts
    Replies: 7
    Last Post: 09-30-2007, 01:01 AM
  3. Noob Problem
    By marthx1 in forum OSR Help
    Replies: 5
    Last Post: 01-03-2007, 04:48 PM

Posting Permissions

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