Results 1 to 5 of 5

Thread: Can't find the correct Function

  1. #1
    Join Date
    Nov 2012
    Location
    Costa Rica
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Question Can't find the correct Function

    Hello. I'm actually working on a personal script to run it on bluestacks with the game "Monster Warlord".

    Right now I'm working with static mouse positions and the game can detect if there is a bot running since he detects the same mouse positions.

    This is the code i have right now.

    Program bounty;

    Procedure Place;
    Begin
    MoveMouse(356,348);
    ClickMouse(356,348,1)
    Wait(3000);
    MoveMouse(477,257);
    ClickMouse(477,257,1);
    Wait(3000);
    MoveMouse(507,442);
    ClickMouse(507,442,1);
    Wait(93000);
    End

    begin
    Repeat
    Place;
    Until(False)
    end.
    Basically, what I need now is a function that moves the mouse not in the exact x and y position. It must have some kind of random space where the mouse can play. In that way, the game won't recognize it as a bot.


    I need a command that makes me the function of the left click, since the "ClickMouse(x,y,1)" uses static coordinates and that does not help me.

    Any Suggestions?

    Sorry for my bad english haha.

    Thanks,

  2. #2
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Simba Code:
    temp_x := RandomRange(x-10,x+10);
    temp_y := RandomRange(y-10,y+10);

    Generally you should use SRL include - there is a lot of randomizing functions there. Personally, I usually use MouseBox() function

  3. #3
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by darker2k View Post
    I need a command that makes me the function of the left click, since the "ClickMouse(x,y,1)" uses static coordinates and that does not help me.

    Any Suggestions?

    Sorry for my bad english haha.

    Thanks,
    You can do what bg5 said, but turn it into a procedure:

    Simba Code:
    procedure RanMouse(x, y, ran: integer);
    begin
      x := Random(x-ran, x+ran);
      y := Random(y-ran, y+ran);

      MoveMouse(x, y);
      ClickMouse(x, y, 1);
    end;

    Now your code would look like this:

    Simba Code:
    program bounty;

    procedure RanMouse(x, y, ran: integer);
    begin
      x := Random(x-ran, x+ran);
      y := Random(y-ran, y+ran);

      MoveMouse(x, y);
      ClickMouse(x, y, 1);
    end

    procedure Place();
    begin
      RanMouse(356, 348, 5); // Randomness of 5 pixels
      Wait(3000);
      RanMouse(477,257, 5);
      Wait(3000);
      RanMouse(507,442, 10); // Randomness of 10 pixels
      Wait(93000);
    end;

    begin
      repeat
        Place();
      until(False)
    end.

  4. #4
    Join Date
    Nov 2012
    Location
    Costa Rica
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default

    Do I have to declarate the temp_x and temp_y as Integers? In that case, I've been doing this and when I run the script, an error appears exactly in the word "var" which i have under the program name.

    Quote Originally Posted by bg5 View Post
    Simba Code:
    temp_x := RandomRange(x-10,x+10);
    temp_y := RandomRange(y-10,y+10);

    Generally you should use SRL include - there is a lot of randomizing functions there. Personally, I usually use MouseBox() function

  5. #5
    Join Date
    Nov 2012
    Location
    Costa Rica
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default

    Thanks man, the script runs perfectly

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •