Results 1 to 5 of 5

Thread: Trying to make a simple auto clicker

  1. #1
    Join Date
    Aug 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Trying to make a simple auto clicker

    I'm just trying to make a simple auto clicker for a non-RS game... I have done this before with SCAR numerous times but I am pretty unfamiliar with SIMBA and I don't understand why it's not working. The script compiles, but the mouse goes to the top left of the client and clicks no matter what. It's like the X and Y variables aren't actually working, because I replaced them with fixed coordinates and the mouse worked properly. Help?? Also, I have a few procedures that aren't currently being called, the only procedure I want to make sure is working right now is the 'clicktree' procedure.

    UPDATE: Ok so now the mouse no longer goes to the top left of the screen, I just removed the line of code within the clicktree procedure that establishes the X,Y variables. Now, the mouse does everything except move to the actual X and Y coordinates. It clicks and finds the tree, but doesn't actually move.

    Code:
    program EW;
    {$i srl-6/srl.simba}
    
    const
    tree=4608;
    treenight = 2560;
    tar =   3881787;
    rock =   1052688;
    food =   1318290;
    bar=  16777215 ;
    
    var
    X1,Y1:Integer;
    
    procedure clicktree;
    var X1,Y1:Integer;
    begin
    if(findcolortolerance(X1,Y1,1471145, 441, 146, 1130, 625,1)) then
    writeln('foundtree');
    //movemouse(X, Y);
    wait(500);
    writeln('inbetween');
     mouse(X1,Y1,1);
    writeln('clicked');
    wait(14000);
    end;
    //if(not(findcolortolerance(x,y,tree, 442, 137, 1159, 672,1))) then
    //begin
    //writeln('didntfindtree');
    //end;
    
    procedure clicktreenight;
    var
    b,n:integer;
    begin
    if(findcolortolerance(b,n,treenight,631, 279, 933, 477,1)) then
    movemouse(b,n);
    wait(14000);
    clickmouse(b,n,1);
    end;
    
    procedure notcollecting;
    var
    b,n:integer;
    begin
    if(not(findcolor(b,n,bar,802, 411,802, 411))) then
    wait(500);
    end;
    
    begin
    repeat
    clicktree;
    until(false);
    end.
    Last edited by back2nexus; 07-23-2016 at 01:36 PM.

  2. #2
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    18) if(findcolortolerance(X1,Y1,1471145, 441, 146, 1130, 625,1)) then

    20) //movemouse(X, Y)

    looks like you were outputting the location to X1, Y1 but were trying to move to X, Y.

  3. #3
    Join Date
    Aug 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nah, that line is commented out and tried using mouse(x1,y1,1) instead, but that didn't work. Here's my latest code:

    Code:
    program EW;
    //{$i srl-6/srl.simba}
    
    const
    tree=11326;
    treenight =2560;
    tar =3881787;
    rock =1052688;
    food =1318290;
    bar= 16777215;
    
    
    var
    X1,Y1:Integer;
    
    procedure clicktree;
    begin
    if(findcolortolerance(X1,Y1,1945619456 ,617,321,859,520,1)) then
    MoveMouse(X1,Y1);
    wait(50);
    ClickMouse(X1,Y1,1);
    writeln('foundtree');
    //movemouse(X, Y);
    wait(500);
    writeln('inbetween');
    writeln('clicked');
    wait(6000);
    end;
    //if(not(findcolortolerance(x,y,tree, 442, 137, 1159, 672,1))) then
    //begin
    //writeln('didntfindtree');
    //end;
    
    procedure clicktreenight;
    var
    b,n:integer;
    begin
    if(findcolortolerance(b,n,treenight,631, 279, 933, 477,1)) then
    movemouse(b,n);
    wait(14000);
    clickmouse(b,n,1);
    end;
    
    procedure notcollecting;
    var
    b,n:integer;
    begin
    if(not(findcolor(b,n,bar,802, 411,802, 411))) then
    wait(500);
    end;
    
    begin
    repeat
    clicktree;
    until(false);
    end.

  4. #4
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    Going through your code I can assume it doesn't actually find the tree. You have an if condition to MoveMouse, but for whatever reason movemouse doesn't do anything. So if it were to find the tree, it would assign x1 & y1 with its place, and do nothing. Then later on when ClickMouse would be called it would move to the tree and click it. But if it doesn't find the tree the variables are never assigned and it clicks to (0, 0) (default value). I would suggest using a tool such as ACA or atleast increase the tolerance to have a better chance of detecting the tree.
    Last edited by Joopi; 07-23-2016 at 06:18 PM.
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

  5. #5
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    I think joopi is correct.

    You should add a begin after your if statement so that the ClickMouse does not run if the tree is not found.

    Here is an example
    Simba Code:
    procedure clicktree;
    begin
      if(findcolortolerance(X1,Y1,1945619456 ,617,321,859,520,1)) then
      begin
        MoveMouse(X1,Y1);
        wait(50);
        ClickMouse(X1,Y1,1);
        writeln('foundtree');
        //movemouse(X, Y);
        wait(500);
        writeln('inbetween');
        writeln('clicked');
        wait(6000);
      end;
    end;
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

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
  •