Results 1 to 8 of 8

Thread: Help with simple thieving script please!

  1. #1
    Join Date
    Jan 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Help with simple thieving script please!

    Hey everyone, I'm really new to scripting and I'm just trying to get a very simple thieving script working on a private server.

    It functions essentially the same as an auto clicker, and could easily be replaced by one, but I decided to do this for practise.

    Here it is..

    Code:
    Program ClickStall;
    {$i SRL-OSR/srl.simba}
    Procedure ClickStall;
    var
      X,Y:Integer;
    begin
        if FindColorTolerance(X, Y, 10867935, 247, 200, 336, 230, 3) then
        begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;
    end;
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.

    So, as you can see, its extremely basic. It compiiles perfectly but my problem is trying to run the script.


    When I press run I get..

    Code:
    SRL Compiled in 31 msec
    Successfully executed.
    but, nothing happens in the client, and yes i did drag client selector to my client.


    Any help would be greatly appreciated! I hope to contribute to this community in a big way in the future, thanks

  2. #2
    Join Date
    Dec 2010
    Posts
    483
    Mentioned
    30 Post(s)
    Quoted
    328 Post(s)

    Default

    Notice:

    Code:
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.
    This is your main execution. Your entry point.

    All your script does right now is set mouse speed and setup the SRL library.

    Call your function in your main.

    Code:
    Begin
      MouseSpeed := 15;
      SetupSRL();
      ClickStall();
    end.

  3. #3
    Join Date
    Jan 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by the bank View Post
    Notice:

    Code:
    Begin
    MouseSpeed := 15;
    SetupSRL;
    end.
    This is your main execution. Your entry point.

    All your script does right now is set mouse speed and setup the SRL library.

    Call your function in your main.

    Code:
    Begin
      MouseSpeed := 15;
      SetupSRL();
      ClickStall();
    end.
    Thanks so much!!

    Would you be able to help me turn this into a loop? I just want it to keep clicking the stall, at the moment it just stops after one click.
    How exactly would I go about doing this?

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

    Default

    Quote Originally Posted by Follow View Post
    Thanks so much!!

    Would you be able to help me turn this into a loop? I just want it to keep clicking the stall, at the moment it just stops after one click.
    How exactly would I go about doing this?
    https://gyazo.com/70d45c44da088f5d85b5211d851ec96f
    https://villavu.com/forum/showthread.php?t=107757

    Simba Code:
    repeat
    ClickStall;
    until false

  5. #5
    Join Date
    Jan 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by

    [simba
    repeat
    ClickStall;
    until false
    [/simba]
    Thanks for the help, man. Sorry to bother everyone once more, but ive done what you said and now my script is executed succesfully but nothing is happening and my mouse doesnt even move. What could cause this? I tried chosing a more unique color and increasong the area of the coordinates where it looks for the color, but it hasnt helped. Heres the full script as I have it now!

    Code:
    Program ClickStall;
    {$i SRL-OSR/srl.simba}
    Procedure ClickStall;
    var
      X,Y:Integer;
    begin
        if FindColorTolerance(X, Y, 10867935, 200, 300, 500, 450, 3) then
        begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;
    end;
    Begin
      MouseSpeed := 15;
      SetupSRL;
      repeat
        ClickStall;
      until (false)
    end.

  6. #6
    Join Date
    Dec 2010
    Posts
    483
    Mentioned
    30 Post(s)
    Quoted
    328 Post(s)

    Default

    Quote Originally Posted by Follow View Post
    Thanks for the help, man. Sorry to bother everyone once more, but ive done what you said and now my script is executed succesfully but nothing is happening and my mouse doesnt even move. What could cause this? I tried chosing a more unique color and increasong the area of the coordinates where it looks for the color, but it hasnt helped. Heres the full script as I have it now!

    Code:
    Program ClickStall;
    {$i SRL-OSR/srl.simba}
    Procedure ClickStall;
    var
      X,Y:Integer;
    begin
        if FindColorTolerance(X, Y, 10867935, 200, 300, 500, 450, 3) then
        begin
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;
    end;
    Begin
      MouseSpeed := 15;
      SetupSRL;
      repeat
        ClickStall;
      until (false)
    end.
    First of all, I recommend swapping the repeat loop in favor of a while loop. I feel it is more readable, especially from people coming from other programming languages.

    Next, I recommend doing some debugging. Put a WriteLn in your find color condition to see if it ever found it. Then go from there. If it never finds it, adjust your color finding. If it does find it, but doesn't move the mouse, then you seem to have a weird error.

    Anyway:

    Code:
    Program ClickStall;
    {$i SRL-OSR/srl.simba}
    Procedure ClickStall;
    var
      X,Y:Integer;
    begin
        if FindColorTolerance(X, Y, 10867935, 200, 300, 500, 450, 3) then
        begin
          WriteLn('Found Color!');
          mmouse(x, y,1,1);
          wait(250);
          ClickMouse(X, Y, mouse_Left)
        end;
    end;
    Begin
      MouseSpeed := 15;
      SetupSRL();
      while (true) do
      begin
        ClickStall();
      end;
    end.

  7. #7
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    you have some small bounds, are u sure the stall is even is within those bounds?

  8. #8
    Join Date
    Mar 2014
    Posts
    195
    Mentioned
    4 Post(s)
    Quoted
    92 Post(s)

    Default

    if you want to switch to srl-6 You could try something like this. Just fill in the vars.
    All you have to do is get the colors of the stalls in aca and just make sure that the best color only highlights the stalls.
    And if it isnt clicking the right stall adjust the cluster var.
    Simba Code:
    procedure clickstall;
    var
    color,tol,clusterdistance:integer;
    Hue,Sat:Extended;
    Tpa: TPointArray;
    Atpa: T2DPointArray;
    area:tbox;
    begin
      area:= intToBox(addpoints);
      color:= ;
      tol:= ;
      Hue:= ;
      Sat:= ;
      clusterdistance:= 50;

    if FindColorsTolerance(Tpa, color,area,tol, colorSetting(2,Hue, sat)) then
      begin
        Atpa := ClusterTPA(Tpa, clusterdistance);
        SortAtpaSize(Atpa, True);  
        mouse(middleTPA(Atpa[0]), MOUSE_MOVE,MOUSE_HUMAN);
        fastclick(MOUSE_LEFT);
        wait(randomrange(2900,3200))  
        end else
           begin
           writeln('couldnt find stall colors');
           terminatescript;
           end;
    end;

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
  •