Page 2 of 2 FirstFirst 12
Results 26 to 35 of 35

Thread: Using Simple CTS2/TPA's

  1. #26
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry, I misunderstood your question. I'll add it now.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  2. #27
    Join Date
    Nov 2008
    Location
    UK
    Posts
    153
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Loved the tutorial. Good explanation and perfect amount of depth for getting people going. CTS and ACA are amazing tools! Think im gonna be using them all the time. The breakdown of the TPA was also very clear.

    Great job!

  3. #28
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Love it, thankyou!

  4. #29
    Join Date
    Nov 2011
    Posts
    335
    Mentioned
    0 Post(s)
    Quoted
    68 Post(s)

    Default

    Nice tutorial! Will post s script that uses it after the weekend

  5. #30
    Join Date
    Dec 2012
    Posts
    191
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Has helped me a lot, thank you!!

  6. #31
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    I think I found a possible problem with Footy's FindImp procedure.

    Simba Code:
    program new;
    {$i srl/srl.simba}

    Procedure FindImp;
    var
      tmpCTS, i, l, r, counter:integer;
      ImpTPA:TPointArray;
    begin
      tmpCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.08, 0.95);     //Ive plugged in my hue and sat mods. Plug in your own here.

      FindColorsTolerance(ImpTPA, 1911631, MSX1, MSY1, MSX2, MSY2, 8);

      SetColorToleranceSpeed(tmpCTS);              //RIGHT AFTER we find our colors, we
      SetToleranceSpeed2Modifiers(0.02, 0.02);     //Change the CTS back.

      L := High(ImpTPA)
      marktime(counter);
      for i := 0 to L do
        begin
          r := random(L);
          wait(randomrange(60, 200));
          mmouse(ImpTPA[r].x, ImpTPA[r].y, 2, 2);
          if waituptext('mp', 300) then
            Break;
          if timefrommark(counter) > 3000 then
            begin
              writeln('We failed to find the Imp!');
              Terminatescript;
            end;
        end;
      writeln('We found the imp!');
      clickmouse2(mouse_right);

    Should be changed to something like

    Simba Code:
    program new;
    {$i srl/srl.simba}

    Procedure FindImp;
    var
      tmpCTS, i, l, r, counter:integer;
      ImpTPA:TPointArray;
    begin
      tmpCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.08, 0.95);     //Ive plugged in my hue and sat mods. Plug in your own here.

      FindColorsTolerance(ImpTPA, 1911631, MSX1, MSY1, MSX2, MSY2, 8);

      SetColorToleranceSpeed(tmpCTS);              //RIGHT AFTER we find our colors, we
      SetToleranceSpeed2Modifiers(0.02, 0.02);     //Change the CTS back.

      L := High(ImpTPA)
      if (L < 1) then   // ********I added this part so that if no color is found it will give stop********
      begin                                              
        writeln('We failed to find the Imp!');          
        Terminatescript;
      end;
      marktime(counter);
      for i := 0 to L do
        begin
          r := random(L);
          wait(randomrange(60, 200));
          mmouse(ImpTPA[r].x, ImpTPA[r].y, 2, 2);
          if waituptext('mp', 300) then
            Break;
          if timefrommark(counter) > 3000 then
            begin
              writeln('We failed to find the Imp!');
              Terminatescript;
            end;
        end;
      writeln('We found the imp!');
      clickmouse2(mouse_right);

    His version will think it found the imp and then click if no Imp-color is found. My edit makes it stop if no imp-color is found.

    If I'm correct maybe an admin could adjust his post?

    Thanks

  7. #32
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    The examples are only to show how to use ColorToleranceSpeed. Adding failsafes should be learned before getting to this level anyways, so I don't really think there's a point in adding that part.

    It would also make more sense to edit the FindColorsTolerance(); into "if not FindColorTolerance() then Exit;" instead

  8. #33
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    The examples are only to show how to use ColorToleranceSpeed. Adding failsafes should be learned before getting to this level anyways, so I don't really think there's a point in adding that part.

    It would also make more sense to edit the FindColorsTolerance(); into "if not FindColorTolerance() then Exit;" instead
    Ok, I just thought that if someone inexperienced tried this that they might think they were doing something else wrong

  9. #34
    Join Date
    Feb 2013
    Posts
    88
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    I've been trying to find a super basic TPA tutorial because everyone keeps telling me its better than findobj! I have to go to bed for the night, but what I've read so far has been excellent. Thanks!

  10. #35
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Xeronate View Post
    I've been trying to find a super basic TPA tutorial because everyone keeps telling me its better than findobj! I have to go to bed for the night, but what I've read so far has been excellent. Thanks!
    this one is easy to understand

    http://villavu.com/forum/showthread.php?t=33111

    And check WizzyPlugins tutorial for what TPa's / ATPa's could do!

    Creds to DannyRS for this wonderful sig!

Page 2 of 2 FirstFirst 12

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
  •