Results 1 to 6 of 6

Thread: Not Clicking?

  1. #1
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Question Not Clicking?

    Ok, I have started scripting recently and I have currently only written a scripts for a few private servers.

    I am trying to write a script to do the gnome agility course on a private server. I have started, as you can see, to write the first procedure which would be crossing the balance log.

    The script compiles:
    Code:
    Compiled successfully in 360 ms.
    SRL Compiled in 0 msec
    Successfully executed.
    But it won't actually click the log. My target is the webclient and it should work, but I cannot see why it won't actually click.

    Code:
    program CrisisXAgility;
    {$i srl/srl.simba}
    
    Procedure ClickLogBalance;
    var
      X,Y:Integer;
    begin
     if FindColorTolerance(X, Y, 872066, 294, 172, 400, 480, 1) or
      FindColorTolerance(X, Y, 868459, 324, 171, 400, 480, 1)
      then
      begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
      end;
    end;
    
    Begin
    SetupSRL;
    MouseSpeed := 15;
    ClickLogBalance;
    end.

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Most probably it cant find the 2 colors. The tolerance of 1 is pretty low unless the colors are static?

  3. #3
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Most probably it cant find the 2 colors. The tolerance of 1 is pretty low unless the colors are static?
    Can you explain the tolerance number because I don't quite understand it :/

    Edit: Changed to tolerance 3 works like a charm
    Last edited by icode; 08-08-2013 at 01:58 PM.

  4. #4
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by icode View Post
    Can you explain the tolerance number because I don't quite understand it :/

    Edit: Changed to tolerance 3 works like a charm
    Basically the difference in color in which the function will tolerate to perceive as equivalent.
    You can check out this tutorial for a more in-depth explanation for tolerance and CTS:
    http://villavu.com/forum/showthread.php?t=74908

  5. #5
    Join Date
    Jul 2013
    Posts
    91
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Basically the difference in color in which the function will tolerate to perceive as equivalent.
    You can check out this tutorial for a more in-depth explanation for tolerance and CTS:
    Ok thanks, but I added a new procedure for climbing the 1st obstacle net and now it won't click the log again:

    Code:
    program CrisisXAgility;
    {$i srl/srl.simba}
    
    Procedure ClickLogBalance;
    var
      X,Y:Integer;
    begin
     if FindColorTolerance(X, Y, 872066, 294, 172, 400, 480, 3) or
      FindColorTolerance(X, Y, 868459, 324, 171, 400, 480, 3)
      then
      begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
      end;
    end;
    
    Procedure ClickObstacleNet1;
    var
      X,Y:Integer;
    begin
     if FindColorTolerance(X, Y, 7301224, 440, 191, 500, 480, 3) or
      FindColorTolerance(X, Y, 537172, 440, 184, 500, 480, 3)
      then
      begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
      end;
    end;
    
    Begin
    SetupSRL;
    MouseSpeed := 15;
    ClickLogBalance;
    ClickObstacleNet1;
    end.

  6. #6
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    You probably need to wait after ClickLogBalance() so that the next obstacle will be visible? You can do with a loop to repeatedly wait until the color is found (with a failsafe to prevent infinite loop)

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
  •