Results 1 to 6 of 6

Thread: breakWindMouse to Java

  1. #1
    Join Date
    Nov 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default breakWindMouse to Java

    Hello, I am newer to coding but after having a couple Java classes I have spiked an interest in writing programs in java to play RS for me. Using Javas Robot Class, I have been quite successful in doing this - mostly I believe is because I found ways to level where the mouse does not need to traverse very far. I have a few skills left to max but they require more mouse use and further mouse travel and I am paranoid about my mouse now that I am close to max. Currently my mouse only moves in straight lines so I tried finding out how to make it move human like and I stumbled across beizier curves but those seemed too "smooth" to be considered, I am not sure how you could add "jaggedness" or cusps. Then I found a link to SRL from stackoverflow so here I am, ready to learn about Pascal and how you guys have successfully conjured a human like mouse movement.

    I am confused about some of the variables and their apparent arbitrariness in _breakWindMouse.
    1. In the user defined function I assume wind deals with x movement? and gravity deals with y movements? and min and max wait are the wait times between mouse steps? Where is min and max wait used?
    2. What is the use and why sqrt 2,3,5?
    3. nModa ect is the remaining distances?
    4. hypot is hypotenuse? ?
    5. minE is min value ?

    If someone would be kind enough to chop the code down into steps and add comments so I can follow and hopefully transfer into Java, that would be fantastic! I do not really understand the logic.

    Thank you.
    Last edited by mars01; 11-08-2017 at 08:08 PM.

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

  3. #3
    Join Date
    Nov 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Was written in Java originally:
    I got it to work but the mouse speed really tanks when the cursor gets close to the destination and tries to correct the randomness to reach the target point, do you know what I could adjust to altar how much it slows down?

  4. #4
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    That does not look normal at all... You've done something wrong.
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

  5. #5
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by Joopi View Post
    That does not look normal at all... You've done something wrong.
    What's wrong with it?

  6. #6
    Join Date
    Nov 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks like I got it, swapped some variables

    Code:
                xs += veloX;
                ys += veloY;
               int mx = (int) Math.round(xs);
               int my = (int) Math.round(ys);
               if (cx != mx || cy != my) {
                    try {
                        Robot r = new Robot();
                        r.mouseMove(mx,my);
                    } catch (Exception e) { }
                }
                double step = Math.hypot(xs - mx, ys - my); //(xs-cx,ys-cy)
                try {
                    Thread.sleep(Math.round((maxWait - minWait) * (step / maxStep) + minWait));
                } catch (InterruptedException ex) {  }

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
  •