Anti-Ban for bots HUMAN MOUSE MOVEMENT
3 posters
Anti-Ban for bots HUMAN MOUSE MOVEMENT
Use this instead of the mouse jumps this is an antiban
- 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) {
}
}
Re: Anti-Ban for bots HUMAN MOUSE MOVEMENT
What scripting language is this?
rutger48- Global Moderator
- Posts : 5
Join date : 2011-01-30
Re: Anti-Ban for bots HUMAN MOUSE MOVEMENT
rutger48 wrote:What scripting language is this?
Well since its posted in the JAVA forums, I think its JAVA xP
Re: Anti-Ban for bots HUMAN MOUSE MOVEMENT
Wow, this is great. Going to add this to a few bots.
Gungho- Administrizzy
- Posts : 5
Join date : 2011-01-22
Age : 32
Location : Tennessee
Permissions in this forum:
You cannot reply to topics in this forum