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

Thread: BrakeMMouse

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

    Default BrakeMMouse

    Hi there,

    So while doing some more observation on my own mouse movements another concept stood out. I don't know what a good word would be used to sum it up, but basically slowing down the speed as the mouse approaches it's destination point.

    Picture moving your mouse from the main screen (in Runescape) to an item in your inventory. It's a long distance from where you started and you have, basically, a smaller target to hit. Normally, you will move your mouse quickly to get there because of the distance, but will you always remain that fast speed, even drawing nearer and nearer to the item? I personally slow down to make that final distance more accurate. In essence, that's what's done here.

    -[Updated 8-20-2012]-

    Simba Code:
    Procedure BrakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, targetArea: extended);
    var
      veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,D: extended;
      lastX,lastY,MSP,W,TDist,T: integer;
      sqrt2,sqrt3,sqrt5,PDist,maxStep: extended;
    begin
      MSP  := MouseSpeed;
      sqrt2:= sqrt(2);
      sqrt3:= sqrt(3);
      sqrt5:= sqrt(5);

      TDist := Distance(Round(xs), Round(ys), Round(xe), Round(ye));
      if (TDist < 1) then
        TDist := 1;
      MarkTime(T);
      repeat
        if (TimeFromMark(T)>5000) then
          break;

        dist:= hypot(xs - xe, ys - ye);
        wind:= minE(wind, dist);
        if (dist < 1) then
          dist := 1;
        PDist := (dist/TDist);
        if (PDist < 0.01) then
          PDist := 0.01;

        {
          These constants seem smooth to me, but
          feel free to modify these settings however
          you wish.
        }


        if (PDist >= 0.15) then                                 //15% (or higher) dist to destination
        begin
          D := (Round((Round(dist)*0.3))/5);
          if (D < 20) then
            D := 20;
        end else if (PDist < 0.15) then
        begin
          if ((PDist <= 0.15) and (PDist >= 0.10)) then         //10%-15%
            D := RandomRange(8, 13)
          else if (PDist < 0.10) then                           //< 10%
            D := RandomRange(4, 7);
        end;

        if (D <= Round(dist)) then
          maxStep := D
        else
          maxStep := Round(dist);

        if dist >= targetArea then
        begin
          windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
          windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
        end else
        begin
          windX:= windX / sqrt2;
          windY:= windY / sqrt2;
        end;

        veloX:= veloX + windX;
        veloY:= veloY + windY;
        veloX:= veloX + gravity * (xe - xs) / dist;
        veloY:= veloY + gravity * (ye - ys) / dist;

        if (hypot(veloX, veloY) > maxStep) then
        begin
          randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
          veloMag:= sqrt(veloX * veloX + veloY * veloY);
          veloX:= (veloX / veloMag) * randomDist;
          veloY:= (veloY / veloMag) * randomDist;
        end;

        lastX:= Round(xs);
        lastY:= Round(ys);
        xs:= xs + veloX;
        ys:= ys + veloY;

        if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
          MoveMouse(Round(xs), Round(ys));

        W := (Random((Round(100/MSP)))*6);
        if (W < 5) then
          W := 5;
        W := Round(W*1.2);
        wait(W);
        lastdist:= dist;
      until(hypot(xs - xe, ys - ye) < 1)

      if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
        MMouse(Round(xe), Round(ye), 0, 0);

      MouseSpeed := MSP;
    end;

    Simba Code:
    Procedure BrakeMMouse(eX, eY, ranX, ranY: Integer);
      var
        randSpeed: extended;
        X,Y,MS: integer;
      begin
        MS := MouseSpeed;
        randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
        GetMousePos(X, Y);
        BrakeWindMouse(X, Y, RandomRange(eX-ranX, eX+ranX), RandomRange(eY-ranY,eY+ranY), 8, 5, 10.0 / randSpeed, 15.0 / randSpeed, 10.0 * randSpeed);
        MouseSpeed := MS;
      end;

    I know 'BrakeWindMouse' and 'BrakeMMouse' are horrible names, but that's all I could think of. Suggestions are welcome.
    Last edited by Flight; 09-08-2012 at 03:47 PM.

    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
    Feb 2011
    Location
    Earth
    Posts
    1,784
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Once again another brilliant idea for mouse movements!

    I would test it, but I just got in bed for the night. Ill have a go with it tomorrow.

    Currently: Working on Defending&Attacking in my Castle-Wars Script
    Project Rebuild: 90M/170M

  3. #3
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Hmm, that makes total sense! Awesome work, will give these a go tomorrow
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  4. #4
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    All your mouse functions NEED to go into the Include :L

  5. #5
    Join Date
    Jan 2012
    Posts
    83
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Does this actually matter? If this is suppose to be for safe botting (idk) doesn't Jagex just see where the mouse clicks and the timing of the click, they don't actually track how fast your mouse is going across the screen...?

  6. #6
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by halgboy_tbc View Post
    Does this actually matter? If this is suppose to be for safe botting (idk) doesn't Jagex just see where the mouse clicks and the timing of the click, they don't actually track how fast your mouse is going across the screen...?
    It's all about being more human-like.

    Also, what wrong with adding some STYLE in to your script?

  7. #7
    Join Date
    Jan 2012
    Posts
    83
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    It's all about being more human-like.

    Also, what wrong with adding some STYLE in to your script?
    I just want to know to make sure I am not overlooking a huge point. In all of my clicks I use randomrange points or offsets and the wait is randomranged as well. So, if I do that, would it matter the if I used a function like this?

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

    Default

    Quote Originally Posted by halgboy_tbc View Post
    Does this actually matter? If this is suppose to be for safe botting (idk) doesn't Jagex just see where the mouse clicks and the timing of the click, they don't actually track how fast your mouse is going across the screen...?
    Maybe not now, but what if they start doing it? Also it doesn't really hurt anyone. We need functions like this
    Working on: Tithe Farmer

  9. #9
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    This seems to be a very human mouse moving methode! Will definietly try this when I am back home.

    I will try to answer all Runescape related questions!

  10. #10
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default

    Quote Originally Posted by halgboy_tbc View Post
    Does this actually matter? If this is suppose to be for safe botting (idk) doesn't Jagex just see where the mouse clicks and the timing of the click, they don't actually track how fast your mouse is going across the screen...?
    I'd agree with you here, it would seem like a waste of resources for jagex to monitor that kind of stuff for individual players, HOWEVER, awesome work Flight!! It is great to look through your code and see the genius

  11. #11
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Why your mouse movements never go in the include I will never know :x

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

    Default

    It's no biggie if they aren't in the include, that's why I post them here in the Snippets section for anyone to use however they wish.

    @halgboy_tbc:
    This wouldn't really matter as far as detectability goes. I know for sure Jagex checks for mouse speed, coordinate-clicking, and direction the mouse is moving from point A to point B, I've seen the packets they use to monitor these, they've been keeping track of them for a long time now. Luckily, BenLand100 made our mouse spline that you see in all scripts; a combination of wind & gravity so we're not moving in an absolute straight line. So you're right, we're fine already as far as detectability goes.

    I personally, however, enjoy pushing our abilities as to mimicking human interface. I hear a lot about how RiD has some advance mouse movements; "100% like a human", so then why isn't the same said about us? Because we have a spline to pass detection already, so no one bothers to improve more to it, like it's a rule or something.

    We have every possible resource to have SRL & our scripts act human, so why stop at just the absolute minimum? I say push on, advance.

    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..."


  13. #13
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    I'm using this in my newest script! It's pretty awesome
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  14. #14
    Join Date
    Jan 2012
    Posts
    83
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Edit: I understand.

    I'm not sure how to use procedures like this properly. I see procedures like HumanMMouse, SuperWindMouse in scripts, but they appear to be not used (just stated in the beginning of the script as a procedure) - With BrakeMMouse, SuperWindMouse and the like can I just place them the beginning and they will be applied throughout the script without it being called anywhere?
    Idk
    Last edited by halgboy_tbc; 04-25-2012 at 09:42 PM.

  15. #15
    Join Date
    Feb 2007
    Location
    Switzerland
    Posts
    583
    Mentioned
    1 Post(s)
    Quoted
    50 Post(s)

    Default

    Quote Originally Posted by halgboy_tbc View Post
    Edit: I understand.

    I'm not sure how to use procedures like this properly. I see procedures like HumanMMouse, SuperWindMouse in scripts, but they appear to be not used (just stated in the beginning of the script as a procedure) - With BrakeMMouse, SuperWindMouse and the like can I just place them the beginning and they will be applied throughout the script without it being called anywhere?
    Idk
    Instead of MMouse() you call for example HumanMMouse().

    This function makes sense for long distances like Mainscreen -> Inventory. I will definitely use this in my next script.

  16. #16
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Fantastic work here Flight!
    Will update my scripts to use this function now

    Forum account issues? Please send me a PM

  17. #17
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    456
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Love it Flight, going to use this! :P

  18. #18
    Join Date
    Jan 2012
    Posts
    83
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    This sometimes just moves to the spot and shakes (moves the cursor back in forth in a small area) and stays that way without clicking (going on to the next command).

  19. #19
    Join Date
    Dec 2011
    Location
    -bash
    Posts
    515
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    This really is clever Flight, I especially love how it works in you ZMI script. It's amazing cause ever since I started botting, I have never seen a bot controlling a mouse to move in a not-so-straight but almost snaking movement across the screen. And this is what gives me confidence that it will be impossible to detect bot-like movements when using scripts that use MMouse.

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

    Default

    Updated the OP. I still continue to work on this over time.

    What happens now is as long as the mouse is 30% or higher distance to its target point, the 'step' between each movement will be 1/3 or the current distance. When the mouse comes within 20%-29% the step will decrease to (randomly) between 15 and 18; between 10%-19% the step will decrease once again to (randomly) 10 and 14; and finally when we're under 10% to the target point the step decreases to between 5 and 8.

    More steps = slower speed, but also a much smoother mouse motion. If you try out these procedures on a long distance mouse movement you'll clearly see the distance. All of the values can be changed however you wish. Just play around with them and come up with something that fits your own movement style.

    Edit:
    Oh and Kyle if you read this I have a short message for you. When you first used this in the early stages of your Runespan script people were reporting the mouse "spazzing out", yes? I believe this was caused because of the current step (sometimes) being higher than the remaining distance to the target point. I made sure this couldn't happen anymore in the updated version, but I've only used it in minor testing, you understand. So if you or anyone else would like to give this a longer test run it would help confirm my theory & fix.
    Last edited by Flight; 06-01-2012 at 04:45 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..."


  21. #21
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Sweet update! I'll test this with my dev version of the ess script! As always, awesome job!
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  22. #22
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Wow, this is exactly what I was thinking of for an ideal mouse procedure. I even experimented for a couple hours to try to have it reduce speed when its oncomming/closing in closer to it's target. This is one heck of a mouse proc, so much gratitude!

  23. #23
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Yay for this I've also been looking into it, the IT term is Fitts Law. I'll be working on implementing this into SRL. My current work is mostly related to the size of the Item (the bigger the item the faster the mouse move) and I agree with the steps too. I'd highly suggest using physics law of acceleration to actually deal with it realistically. I made a thread up in devs for this the other day, and there's one im members too about fitts law, you might be interested to read it

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  24. #24
    Join Date
    Feb 2006
    Location
    Berkeley, CA
    Posts
    1,837
    Mentioned
    52 Post(s)
    Quoted
    60 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Luckily, BenLand100 made our mouse spline that you see in all scripts; a combination of wind & gravity so we're not moving in an absolute straight line.
    I would like to note, just for clarity, that WindMouse does not use splines. The last mouse methods I wrote did use splines, and that was around for so long that people forever associate 'human mouse movement' with the term 'spline'. Technically 'spline' is a very broad term meaning 'a curve generated from a set of control points' and WindMouse does not fall in that category.

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

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    Yay for this I've also been looking into it, the IT term is Fitts Law. I'll be working on implementing this into SRL. My current work is mostly related to the size of the Item (the bigger the item the faster the mouse move) and I agree with the steps too. I'd highly suggest using physics law of acceleration to actually deal with it realistically. I made a thread up in devs for this the other day, and there's one im members too about fitts law, you might be interested to read it

    ~RM
    Well thank you. Yes I've thought along the same lines as far as the target area size go. Exactly what you said, the bigger the target the faster we'll move to get there. I also thought we might use the same when choosing an option on a right-click menu; the more options are on the menu, the longer it should take us to choose the correct option. But actually this has nothing to do with BrakeMMouse, just a general suggestion. :P

    Yes I read over your thread about that, I think it's a great idea to be honest. Have you begun to fabricate something for the mouse taking into account Fitts Law?

    Quote Originally Posted by BenLand100 View Post
    I would like to note, just for clarity, that WindMouse does not use splines. The last mouse methods I wrote did use splines, and that was around for so long that people forever associate 'human mouse movement' with the term 'spline'. Technically 'spline' is a very broad term meaning 'a curve generated from a set of control points' and WindMouse does not fall in that category.
    Oh ok, I believe I follow now. I thought spline was simply the formula used to calculate a route for the mouse's movement. Seeing as how the next mouse movement is recalculated after each step I guess it really does rule out being a spline.

    Thanks for the clarification.

    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..."


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
  •