Results 1 to 2 of 2

Thread: Cant click in window.

  1. #1
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Cant click in window.

    Im trying to make a simple cow killer. How do i make it click on actual cows here is my script.

    HTML Code:
    {$DEFINE SMART} // comment this line out if you don't want to use SMART
    {$i srl-6/srl.simba}
    
    var
    x,y:integer;
    x1,y1,x2,y2:integer;
    {begin
    clearDebug();
    setupSRL();
    end.
    
             }
    procedure killcows;
    begin
    writeln('start');
    if(FindColorTolerance(x,y,4676986,0,0,788,586,20)) then
    begin
    clickmouse(x,y,mouse_Right);
    writeln('found cow');
    
    wait(200+random(200));
    clickmouse(x,y+29,Mouse_left);
    end;
          end;
    begin
    killcows;
    end.
    It find cows but dont click on them. How do i know its even clicking in smart.

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

    Default

    I see that you're using the srl-6 include, just want to confirm that you are writing a bot for RS3 and not OSRS. Also your setupSRL is in a strange place.

    Here's a nice template that I recommend you start with:

    Code:
    program scriptTemplate;
    
    {$DEFINE SMART}              // Always have this to load smart
    {$I SRL-6/SRL.simba}         // To load the SRL include files
    {$I SPS/lib/SPS-RS3.Simba}   // To load the SPS include files
    
    procedure declarePlayers();
    begin
      setLength(players, 1);
      with players[0] do
      begin
        loginName := 'username';
        password := 'password';
        isActive := true;
        isMember := true;
      end
      currentPlayer := 0;
    end;
    
    
    // main loop
    begin
      clearDebug();               // Clear the debug box
      smartEnableDrawing := true; // So we can draw on SMART
      setupSRL();                   // Load the SRL include files
      declarePlayers();             // Set up your username/pass
    
      if not isLoggedIn() then             // If player isn't logged in then
      begin
        players[currentPlayer].login();   // Log them in
        exitTreasure();            // Exit treasure hunter   
        minimap.setAngle(MM_DIRECTION_NORTH);  // Make compass north and angle high
        mainScreen.setAngle(MS_ANGLE_HIGH);
      end;
    
    end.
    Last edited by 27Ronin; 11-30-2018 at 10:41 PM.

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
  •