Results 1 to 3 of 3

Thread: Can't make it click a color

  1. #1
    Join Date
    Sep 2012
    Posts
    270
    Mentioned
    4 Post(s)
    Quoted
    97 Post(s)

    Default Can't make it click a color

    I'm kinda stuck with finding color or clicking it. I viewed some giudes but half of them had functions that don't even exist in Simba anymore.

    I used auto color aid v2 to generate the color function.

    Here is the code
    Simba Code:
    function Color: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.00, 0.30);

      if not (FindColorsTolerance(arP, 1316117, MSX1, MSY1, MSX2, MSY2, 2)) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    procedure Click;
    var
      x, y : Integer;
    begin
     if FindColor(x, y, Color, MMX1, MMY1, MMX2, MMY2) then
          MMouse(x, y, 4, 4)


    end;

    All it does is write "AutoColor = 1447703" in the debug but no clicking or mouse movement. I tried Mouse instead of MMouse but it didn't work. (and yes its added to the main loop)

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

    Default

    Try a slightly higher tolerance. I always up the tolerance ACA gives with 2-3

    also your coords on function color says Mainscreen, while you're findcolor one is using Minimap.
    Last edited by Sjoe; 05-29-2013 at 05:54 PM.

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Sep 2012
    Posts
    270
    Mentioned
    4 Post(s)
    Quoted
    97 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    Try a slightly higher tolerance. I always up the tolerance ACA gives with 2-3

    also your coords on function color says Mainscreen, while you're findcolor one is using Minimap.
    Thanks, it works now

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
  •