Results 1 to 17 of 17

Thread: How would I click on this monster?

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default How would I click on this monster?

    Ok, my queston is more complicated then it looks, pretty much I have any auto fighter that relies on finding the npc with 1 color. But, this also has the chance to fail so, How would I make it so if the bot finds 2 of the 3 colors within like a 50x40 area then it clicks in that area?
    Example, click in the red box searching for the colors that are the red dots:

  2. #2
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    Ok, my queston is more complicated then it looks, pretty much I have any auto fighter that relies on finding the npc with 1 color. But, this also has the chance to fail so, How would I make it so if the bot finds 2 of the 3 colors within like a 50x40 area then it clicks in that area?
    Example, click in the red box searching for the colors that are the red dots:
    learn about TPA's and/or ATPA's (:
    Tut section is GREAT

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    learn about TPA's and/or ATPA's (:
    Tut section is GREAT
    Looked at 2 TPA tut's they did not go into much detail about finding more then 1 color

  4. #4
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    Looked at 2 TPA tut's they did not go into much detail about finding more then 1 color
    search for your two different colors and create two TPA's with the results. Then compare the two of them using ATPA's (:

  5. #5
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    search for your two different colors and create two TPA's with the results. Then compare the two of them using ATPA's (:
    It's pretty hard for me to even get a remote understanding of TPA's when i can't even run the example without getting an error.

  6. #6
    Join Date
    Oct 2012
    Posts
    758
    Mentioned
    6 Post(s)
    Quoted
    282 Post(s)

    Default

    Using CTS2/Simple TPA TuT:
    http://villavu.com/forum/showthread.php?t=90767

    With auto-colouring (or using ACA AutoColorAid) and ATPAs as mentioned above you can make object finding a lot more reliable.

    As for common errors I recommend a look into the FAQ section:
    http://villavu.com/forum/showthread.php?p=851555

    Hope I helped in some way

  7. #7
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default

    Find the user "Runaway" in the members list and check the threads he has started, he has created a function which does exactly what you are looking for.

  8. #8
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by cause View Post
    Find the user "Runaway" in the members list and check the threads he has started, he has created a function which does exactly what you are looking for.
    Saw his thread. not going to learn a 250 line script, when in the end he says its not worth it because it can take up to 5000 ms to do. nty

  9. #9
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Runehack123 View Post
    Using CTS2/Simple TPA TuT:
    http://villavu.com/forum/showthread.php?t=90767

    With auto-colouring (or using ACA AutoColorAid) and ATPAs as mentioned above you can make object finding a lot more reliable.

    As for common errors I recommend a look into the FAQ section:
    http://villavu.com/forum/showthread.php?p=851555

    Hope I helped in some way
    Currently testing out "tpas"... working worse then finding 1 color and clicking it... always clicks something thats not the sekeletn 60% of the time. we as 1 color it did it 3% of the time.

  10. #10
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    rjj no need to double post. but try using ACA (:

  11. #11
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    rjj no need to double post. but try using ACA (:
    I give up. No point.

    What am i doing wrong here?

    Simba Code:
    procedure ClickNPC;
    var
      X, Y,cx,cy: Integer;
    begin     // kill npc
      WriteLn('Attacking skeleton...');
      if FindColorTolerance(X, Y, NPC, tleft, tright, bleft, bright, tolerence) then
      begin
        GetMousePos(cx,cy);
        MouseSpeed:=40;
        mmouse(x, y,1,1);
        Wait(20 + Random(50));
        ClickMouse(X, Y, Mouse_Left);
      if FindColorTolerance(x,y,65535,cx-10,cy+10,cx+10,cy-10,5) then
       begin
       ClickNPC;
       end;
        WriteLn('Attacked skeleton!');
        CheckCombat;
        end;
      end;

    Code:
    Error: Exception: You passed wrong values to a finder function: ys > ye (116,96). at line 67
    The following bitmaps were not freed: [0]

  12. #12
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,194
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    One your looking for a single color.

    With TPAs you could group all colors of the same shade then search them by Size. Which is 100% better than what you have. Look for the TPA tuts everyone has been mentioning.

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  13. #13
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by BraK View Post
    One your looking for a single color.

    With TPAs you could group all colors of the same shade then search them by Size. Which is 100% better than what you have. Look for the TPA tuts everyone has been mentioning.
    I did. And I made one. And it kept clicking the wrong thing.

  14. #14
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    I did. And I made one. And it kept clicking the wrong thing.
    share your code. What did you use to obtain the color? Did you try using Auto color Aid?

  15. #15
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    share your code. What did you use to obtain the color? Did you try using Auto color Aid?
    yea

    Code:
    program new;
    {$i srl/srl.simba}
    Procedure FindSkele;
    var
    tmpCTS,i,l,r,x,y,counter:integer;
    SkeletonTPA:TPointArray;
    
    begin
    tmpCTS := GetToleranceSpeed;
    SetColorToleranceSpeed(1);
    SetToleranceSpeed2Modifiers(0.16, 1.10);
    
      FindColorTolerance(x, y,1385045, MSX1, MSY1, MSX2, MSY2, 1);
    
      SetColorToleranceSpeed(tmpCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);
      l := High(SkeletonTPA)
      marktime(counter);
      for i:= 0 to l do
      begin
      r := random(l);
      wait(randomrange(10,50));
      mmouse(SkeletonTPA[r].x,SkeletonTPA[r].y,2,2);
      if waituptext('Skele',20) then
      Break;
      if timefrommark(counter) > 3000 then
      begin
      writeln('failed to find skeleton...');
      Terminatescript;
      end;
    end;
    writeln('we found the skeleton.');
    MouseSpeed:=40;
    mmouse(x,y,1,1);
      clickmouse2(mouse_left);
    end;
    begin
      SetupSRL
      FindSkele;
    end.

  16. #16
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    I'm not going to spoonfeed you a function, so read this carefully, and if you don't understand a part of it ask.

    First thing I do when I look at finding something on the screen is check the most common unique color of the object. For a skeleton I would say that its the helmet/shield colors. I split the TPA of the object by distance(usually no more than 5), then I get the count of those colors on the object and use that as my bounds for including a TPA or not. Then I get a random point in the largest TPA and that is my clicking point. I move the mouse to verify the object and then do the clicking action(left or menu).
    If the object still isn't being found well, I will add the main color of the skeleton and get a shit-ton of samples from different clients and worlds, so that I get the exact color profile of the object. Also, use CTS 2 for now.

  17. #17
    Join Date
    Nov 2012
    Location
    N/A
    Posts
    185
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    If yuo cant use TPAs then use Auto Color Aid2(ACA2)

    A video by Yohojo on how to do so for beginners is here:
    http://www.youtube.com/watch?v=98wVrr6GwyU

    He goes into very high detail on how to use this from start to finish!.

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
  •