Results 1 to 6 of 6

Thread: Randomness in Mouse functions

  1. #1
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default Randomness in Mouse functions

    I have noticed that the randomness parameter in MMouse only increases the x and y value.
    example:

    MMouse(10, 10, 5, 5)

    it clicks a x value from 10 to 15. and a y value from 10 to 15 too.

    but it should click a x value from 5 to 15 and a y value from 5 to 15 too.

    Well, I think it should...

    Is it working as usual and it doesn't decrease because it always been like that? or is something wrong?


    crappy english I know...

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    It has always been like this. Really odd, I know. But this was like this in scar and since then we didn't want to break any existing scripts. I suggest using MouseBox or

    procedure MyMMouse(x, y, rand:Integer);
    begin
    MMouse(x - rand, y - rand, rand, rand);
    end;
    Working on: Tithe Farmer

  3. #3
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    I'm not on my computer so if what are you saing is right.

    Simba Code:
    MMouse(10, 10, 5, 5); // add random +5 to each
    //so this should do 10 10 coordinates as center and 5 would be kinda "radius" around that point I guess
    MMouse(10, 10, RandomRange(-5, 5), RandomRange(-5, 5)); //should do +- random

  4. #4
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    Thanks guys I could have done that. I just didn't occur me

  5. #5
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Laimonas171 View Post
    I'm not on my computer so if what are you saing is right.

    Simba Code:
    MMouse(10, 10, 5, 5); // add random +5 to each
    //so this should do 10 10 coordinates as center and 5 would be kinda "radius" around that point I guess
    MMouse(10, 10, RandomRange(-5, 5), RandomRange(-5, 5)); //should do +- random
    Wouldn't that be a random of a random?

    Lets say that the RandomRange(-5, 5) is 3. then the randomness passed to the mouse function is 3. meaning it would be 0, 1, 2 or 3. If I use it it would be more likely to click near the center..

    EDIT: Forget it, actually it is better that way because when your legitting you are more likely to click near center

  6. #6
    Join Date
    Nov 2008
    Location
    Norway, Alesund
    Posts
    924
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Nirvana View Post
    Wouldn't that be a random of a random?

    Lets say that the RandomRange(-5, 5) is 3. then the randomness passed to the mouse function is 3. meaning it would be 0, 1, 2 or 3. If I use it it would be more likely to click near the center..

    EDIT: Forget it, actually it is better that way because when your legitting you are more likely to click near center
    AFAIK RandomRange(-5, 5); may give you -5, -4 -3 -2 -1 0 1 2 3 4 5 so if it so if you get < 0 then mouse click more to negative side of x and y from MMouse(x, y, 5, 5); (x, y) = center; and if it's > 0 positive does click to positive sides of x, y.. correct me if I'm wrong

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
  •