LetMeBot
Get full acces now! Register for free!

Got questions? Or you can't make an account?

Email to this email adress: support@letmebot.com

Anti-Ban for bots HUMAN MOUSE MOVEMENT

LetMeBot :: Coding :: Java

Go down

Anti-Ban for bots HUMAN MOUSE MOVEMENT

Post by Bnoit on February 6th 2011, 1:13 pm

Use this instead of the mouse jumps this is an antiban Smile

Code:

 public void humanMouse(Point targetPosition, int Speed, int wiggleFrequency) {
        Random rnd = new Random();
        Point A, B, C, D;
        A = MouseInfo.getPointerInfo().getLocation();
        B = targetPosition;
        C = GetPointCurve(A, B);
        int wiggleTimer = wiggleFrequency;
        int humanWiggle = 2;
        double lineLength = LineLength(A, B);
        int Displacement = (int) lineLength;
        double Inc = Displacement / ((double) Speed / 100);
        for (double t = 0; t < 1; t += (1.0 / Inc)) {
            // mouse movement according to a spline:
            // movement = A.x *(1-t)^2 + 2 * C.t * (t - 1)*t + t^2 * B.x
            //
            D = new Point;
            D.x = (int) (A.x * (1 - t) * (1 - t) + 2 * C.x * t * (1 - t) + t * t * B.x);
            D.y = (int) (A.y * (1 - t) * (1 - t) + 2 * C.y * t * (1 - t) + t * t * B.y);
            if (wiggleTimer == 0) {
                if (rnd.nextInt(1) == 0) {
                    D.x += -humanWiggle + rnd.nextInt(2 * humanWiggle);
                    D.y += -humanWiggle + rnd.nextInt(2 * humanWiggle);
                    wiggleTimer = wiggleFrequency;
                }
            } else {
                wiggleTimer -= 1;
            }
            moveMouse(D);
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
            }
        }
        moveMouse(new Point((int) B.x, (int) B.y));
    }

    private static void moveMouse(Point p) {
        try {
            Robot bot = new Robot();
            bot.mouseMove(p.x, p.y);
        }catch (AWTException e) {
        }
    }
avatar
Bnoit
Administrizzy & Bot Programmer
Administrizzy & Bot Programmer

Posts : 85
Join date : 2010-10-04
Age : 28
Location : Belgium

View user profile http://hackforlife.highforum.net

Back to top Go down

Re: Anti-Ban for bots HUMAN MOUSE MOVEMENT

Post by rutger48 on February 8th 2011, 2:50 pm

What scripting language is this?
avatar
rutger48
Global Moderator

Posts : 5
Join date : 2011-01-30

View user profile

Back to top Go down

Re: Anti-Ban for bots HUMAN MOUSE MOVEMENT

Post by Bnoit on February 8th 2011, 5:38 pm

rutger48 wrote:What scripting language is this?

Well since its posted in the JAVA forums, I think its JAVA Smile xP
avatar
Bnoit
Administrizzy & Bot Programmer
Administrizzy & Bot Programmer

Posts : 85
Join date : 2010-10-04
Age : 28
Location : Belgium

View user profile http://hackforlife.highforum.net

Back to top Go down

Re: Anti-Ban for bots HUMAN MOUSE MOVEMENT

Post by Gungho on February 8th 2011, 6:31 pm

Wow, this is great. Going to add this to a few bots.

_________________
Private First Class
US Tennessee Army National Guard
278th Armored Calvary Regiment
avatar
Gungho
Administrizzy
Administrizzy

Posts : 5
Join date : 2011-01-22
Age : 26
Location : Tennessee

View user profile

Back to top Go down

Re: Anti-Ban for bots HUMAN MOUSE MOVEMENT

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


LetMeBot :: Coding :: Java

 
Permissions in this forum:
You cannot reply to topics in this forum