Page 1 of 2 12 LastLast
Results 1 to 25 of 46

Thread: Mouse movement fun

  1. #1
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default Mouse movement fun

    So... I notice when(if) I play RS legitimately my mouse movements aren't even close to being a one-shot deal. For example, if I were moving from the bottom of the inventory to the Prayer tab chances are the initial movement would land on one of the neighboring tabs and then to my Prayer tab.

    So I whipped something up quick to simulate such humanish mistakes. First off, this will use the standard MMouse to move our mouse to a "mistake box region", and this region's size is determined by both the mouse speed and distance of travel. From there it's just another standard MMouse to the final destination.

    So obviously it's nothing fancy or state of the art, but it goes to show how just tiny modifications like this could make our scripts that much more human.

    Here's a couple of tests I did. The blue circles are the starting points, the red are the targets.


    ~

    ~

    ~


    Edit:
    Here's the procedure I used for the above testing:
    Simba Code:
    {*******************************************************************************
    Procedure HumanMMouse(eX, eY: Integer);
    By: Flight
    Description: Human-like miss-and-correct mouse movement
    *******************************************************************************}

      Procedure HumanMMouse(eX, eY: Integer);
      var
        randSpeed: extended;
        X,Y,A,Dist,MP: integer;
      begin
        A := MouseSpeed;
        GetMousePos(X, Y);
        Dist := Distance(X, Y, eX, eY);
        MP := Round(Dist/150);
        if MP < 0 then
          MP := 1;

        randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
        MMouse(RandomRange(eX-(A*MP), eX+(A*MP)), RandomRange(eY-(A*MP), eY+(A*MP)), 0, 0);
        GetMousePos(X, Y);
        MMouse(eX, eY, 0, 0);
        MouseSpeed := A;
      end;

    And here's a super version of it directly using WindMouse: (If I remember correctly, it looks like a drunk player)
    Simba Code:
    {*******************************************************************************
    Procedure HumanMMouse(eX, eY: Integer);
    By: Flight
    Description: Human-like miss-and-corect mouse movement
    *******************************************************************************}

      Procedure HumanMMouse(eX, eY: Integer);
      var
        randSpeed: extended;
        X,Y,A,Dist,MP: integer;
      begin
        A := MouseSpeed;
        GetMousePos(X, Y);
        Dist := Distance(X, Y, eX, eY);
        MP := Round(Dist/100);
        if MP < 0 then
          MP := 1;

        randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
        WindMouse(X, Y, RandomRange(eX-(A*MP), eX+(A*MP)), RandomRange(eY-(A*MP), eY+(A*MP)),
                30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
        GetMousePos(X, Y);
        WindMouse(X, Y, eX, eY, 30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);

        MouseSpeed := A;
      end;
    Last edited by Flight; 12-04-2011 at 02:53 AM.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  2. #2
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    From the looks of it, this is a good improvement to our current MMouse

  3. #3
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Please do post the procedure. I'd love to study it and see how exactly you accomplished this improvement.

    Great job, by the way!

    E: I was thinking, is there any randomization to this? I don't believe a human would always make this little "Mistake".
    Last edited by RISK; 12-03-2011 at 06:22 PM.

  4. #4
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    If you wanted to randomize the times it does the mistake'ish mouse just have a random chance of using my mouse or the standard MMouse.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I've noticed a lot recently that overshooting and stuff would be a cool thing to do instead of just moving straight to it. Would be cool if MMouse had this built in and just if random(5) = 4 to do it. (I bet this won't get added, but I might add it to my scripts fasho!)

  6. #6
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    Awesome! I overshot the buttons and then go back too, especially with high sensitivity
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  7. #7
    Join Date
    Jun 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Something to consider working on while in a mouse-movement mood [see this post and previous]: http://villavu.com/forum/showthread....117#post850117

  8. #8
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I took it a bit further now. Made a quick modified WindMouse to pain my mouse movements on-screen. I'l post some pictures here.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  9. #9
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    That human mouse looks nothing humanlike to me. I never overshoot like that except maybe 1/100 of the time. I play too many FPSes so I almost never overshoot my clicks in RS. Windmouse looks quite similar to how my mouse moves.

    Overshooting is good, but looks like you do it too much. Also the "hook" to get back in after overshooting I don't really like.

    But neat, keep up the good work.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  10. #10
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Harry View Post
    That human mouse looks nothing humanlike to me. I never overshoot like that except maybe 1/100 of the time. I play too many FPSes so I almost never overshoot my clicks in RS. Windmouse looks quite similar to how my mouse moves.

    Overshooting is good, but looks like you do it too much. Also the "hook" to get back in after overshooting I don't really like.

    But neat, keep up the good work.
    Yeah that's what Risk was talking about, it having a random chance to use HumanMMouse or the standard MMouse.

    As promised, here's some pictures of it using a modified WindMouse:






    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  11. #11
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Yeah that's what Risk was talking about, it having a random chance to use HumanMMouse or the standard MMouse.

    As promised, here's some pictures of it using a modified WindMouse:

    images ommited
    I never move my mouse like that.

  12. #12
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Yeah, that spline is very bad looking :/


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  13. #13
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    We don't move in a perfect spline do weh?!Some of the latest images are a bit too whachy though but others look nice! First posts I like, hook is ok to have sometimes randomly I'd say.

  14. #14
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    That's with some highly adjust Wind/Gravity.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  15. #15
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I think the parameters could probably use some tweaking. We need to find an appropriate set, though.

    Simba is not drunk. :<
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  16. #16
    Join Date
    Dec 2011
    Location
    Seattle
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is the final coordinate set or recalculated? What I mean is, if you need speed and precision for instance in a fighting script, you could potentially misclick unless it calculates the desired path after the "mistake box" not before? On top of that I guess the next question is how often is too often?

  17. #17
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Flight, could you do these pics with this branch of SRL5:
    https://github.com/SRL/SRL-5/tree/gauss

    If I can get my stuff together with git, this will not break anything.. :/
    Last edited by Nava2; 12-04-2011 at 09:14 PM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  18. #18
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Simba is not drunk. :<
    made me lol irl.

    On topic: i think that's a little bit... too much i guess, if it happens once in every 25~ mouse movements then yes.
    Hi

  19. #19
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Flight, could you do these pics with this branch of SRL5:
    https://github.com/SRL/SRL-5/tree/gauss

    If I can get my stuff together with git, this will not break anything.. :/
    You're talking about running the script with SRL5 and redoing the pictures? I'd be happy to, but the last time (first day of release) I tried converting to SRL5 I had a truck load of compile problems. I tried doing what Wizzup? said and I still couldn't get any where. Believe me I'd love to update my scripts to SRL5, had I the option.

    @Tickyy:
    Yeah those last pictures were taken with huge gravity and wind mods. I've settled them back down to a little higher than normal, but with the same miss-and-correct movement format.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  20. #20
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Flight, PM me the issues you're having with SRL5 and I can help you out.

    I like the looks if this though.

    E: Moved to SRL Suggestions.

  21. #21
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    The final version of HumanMMouse is in Astralz if you'd like to take a look at it.

    Edit:
    I PM'd you earlier this morning, Coh3n. I hope you can give me some good advice, I'm looking forward to getting my scripts running on SRL5.
    Last edited by Flight; 12-13-2011 at 04:04 AM.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  22. #22
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    The final version of HumanMMouse is in Astralz if you'd like to take a look at it.

    Edit:
    I PM'd you earlier this morning, Coh3n. I hope you can give me some good advice, I'm looking forward to getting my scripts running on SRL5.
    Would be easier if you just posted here. I think I'll add it to mouse.simba.

  23. #23
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Simba Code:
    {*******************************************************************************
    Procedure HumanMMouse(eX, eY: Integer);
    By: Flight
    Description: Human-like miss-and-correct mouse movement
    *******************************************************************************}

      Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
      var
        randSpeed: extended;
        X,Y,X2,Y2,A,Dist,MP: integer;
      begin
        A := MouseSpeed;
        GetMousePos(X, Y);
        Dist := Distance(X, Y, eX, eY);
        MP := Round(Dist/150);
        if MP < 0 then
          MP := 1;

        randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
        X2 := RandomRange(eX-(A*MP), eX+(A*MP));
        Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
        WindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
        GetMousePos(X, Y);
        MMouse(eX, eY, ranX, ranY);
        MouseSpeed := A;
      end;

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  24. #24
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    If it still functions like it did in the pictures in the original post I am a bit weary of it. That sharp change in direction at the end is very unrealistic to me IMO. I went from blue to red with my mouse manually multiple times and if I did miss, the correction was never so sharp. The rest of the movements seem to be on a good track though
    STOP PM'ING ME

  25. #25
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Maybe make the "miss area" smaller?

Page 1 of 2 12 LastLast

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
  •