Results 1 to 3 of 3

Thread: Basic java mouse movements

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default Basic java mouse movements

    Can someone link me to some sort of guide/code for basic java mousemovents? So far I have:

    java Code:
    public void MMouse(int sx, int sy, int ex, int ey, int speed) throws AWTException {
                Robot robot = new Robot();
                int a = 10;
                boolean flag = true;
                for (int i = 0; i < 100; i++) {
                    int mov_x = ((ex * i) / 100) + (sx * (100 - i) / 100);
                    int mov_y = ((ey * i) / 100) + (sy * (100 - i) / 100);
                    if (flag == true) {
                        robot.mouseMove(mov_x + a, mov_y); // adds 10 to X-axis
                        flag = false;
                    } else {
                        robot.mouseMove(mov_x - 2 * a, mov_y); // subtracts 20 to X-axis
                        flag = true;
                    }
                    robot.delay(speed);
                }
            }

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

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    I think SMART has an example, credit to BenLand100
    https://github.com/BenLand100/SMART/...Nazi.java#L200
    OOO ty

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
  •