Привет, столкнулся с такой проблемой: пытаюсь написать ротацию под SpookyTime. У них обновили античит на ИИ — Mx-Project Noad. Я написал ротацию с помощью чата лгбт (пожалуйста, не пишите плохих слов), и спустя примерно 60 ударов меня банит. Не можете подсказать, в чём дело и что стоит поменять?
private float smoothDriftX = 0f;
private float smoothDriftY = 0f;
private long lastItemUseTime = 0;
private long serverRotationShockTime = 0;
private float lastMicroX = 0f;
private float lastMicroY = 0f;
private int hitsCount = 0;
private void spookyTimeRotation() {
if (target == null || mc.player == null) return;
if (System.currentTimeMillis() < serverRotationShockTime) {
return;
}
isRotated = true;
smoothDriftX += (ThreadLocalRandom.current().nextFloat() - 0.5f) * 0.15f;
smoothDriftY += (ThreadLocalRandom.current().nextFloat() - 0.5f) * 0.15f;
float maxWidth = target.getWidth() * 0.5f;
float maxHeight = target.getHeight() * 0.4f;
smoothDriftX = MathHelper.clamp(smoothDriftX, -maxWidth, maxWidth);
smoothDriftY = MathHelper.clamp(smoothDriftY, -maxHeight, maxHeight);
Vector3d targetCenter = target.getPositionVec().add(0, target.getHeight() / 1.4, 0);
Vector3d aimPoint = targetCenter.add(smoothDriftX, smoothDriftY, 0);
Vector3d diff = aimPoint.subtract(mc.player.getEyePosition(1.0F));
float targetYaw = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0F);
float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, Math.hypot(diff.x, diff.z)));
float yawDelta = MathHelper.wrapDegrees(targetYaw - rotate.x);
float pitchDelta = targetPitch - rotate.y;
float maxYawDelta = 60.0f + (ThreadLocalRandom.current().nextFloat() * 1.0329834f);
float maxPitchDelta = ThreadLocalRandom.current().nextFloat(23.133f, 26.477f);
yawDelta = MathHelper.clamp(yawDelta, -maxYawDelta, maxYawDelta);
pitchDelta = MathHelper.clamp(pitchDelta, -maxPitchDelta, maxPitchDelta);
if (Math.abs(yawDelta) < 0.01f && Math.abs(pitchDelta) > 0) {
yawDelta += ThreadLocalRandom.current().nextFloat(0.1f, 0.5f) + 0.1f * 1.0313f;
}
if (Math.abs(pitchDelta) < 0.01f && Math.abs(yawDelta) > 0) {
pitchDelta += ThreadLocalRandom.current().nextFloat(0.1f, 0.5f) + 0.1f * 1.0313f;
}
boolean isHovering = Math.abs(yawDelta) < 4.0f && Math.abs(pitchDelta) < 4.0f;
if (!isHovering) {
float gcd = SensUtil.getGCDValue();
if (gcd == 0) gcd = 0.15f;
float speed = ThreadLocalRandom.current().nextFloat(0.65f, 0.75f);
float moveYaw = yawDelta * speed;
float movePitch = pitchDelta * speed;
int dx = Math.round(moveYaw / gcd);
int dy = Math.round(movePitch / gcd);
float actualMoveYaw = dx * gcd;
float actualMovePitch = dy * gcd;
rotate = new Vector2f(rotate.x + actualMoveYaw, MathHelper.clamp(rotate.y + actualMovePitch, -90.0f, 90.0f));
} else {
if (ThreadLocalRandom.current().nextFloat() < 0.05f) {
float gcd = SensUtil.getGCDValue();
if (gcd == 0) gcd = 0.15f;
lastMicroX += ThreadLocalRandom.current().nextFloat(-0.5f, 0.5f);
lastMicroY += ThreadLocalRandom.current().nextFloat(-0.5f, 0.5f);
lastMicroX = MathHelper.clamp(lastMicroX, -1.5f, 1.5f);
lastMicroY = MathHelper.clamp(lastMicroY, -1.5f, 1.5f);
int dx = Math.round(lastMicroX);
int dy = Math.round(lastMicroY);
rotate = new Vector2f(rotate.x + dx * gcd, MathHelper.clamp(rotate.y + dy * gcd, -90.0f, 90.0f));
}
}
mc.player.rotationYawOffset = rotate.x;
}
private float smoothDriftX = 0f;
private float smoothDriftY = 0f;
private long lastItemUseTime = 0;
private long serverRotationShockTime = 0;
private float lastMicroX = 0f;
private float lastMicroY = 0f;
private int hitsCount = 0;
private void spookyTimeRotation() {
if (target == null || mc.player == null) return;
if (System.currentTimeMillis() < serverRotationShockTime) {
return;
}
isRotated = true;
smoothDriftX += (ThreadLocalRandom.current().nextFloat() - 0.5f) * 0.15f;
smoothDriftY += (ThreadLocalRandom.current().nextFloat() - 0.5f) * 0.15f;
float maxWidth = target.getWidth() * 0.5f;
float maxHeight = target.getHeight() * 0.4f;
smoothDriftX = MathHelper.clamp(smoothDriftX, -maxWidth, maxWidth);
smoothDriftY = MathHelper.clamp(smoothDriftY, -maxHeight, maxHeight);
Vector3d targetCenter = target.getPositionVec().add(0, target.getHeight() / 1.4, 0);
Vector3d aimPoint = targetCenter.add(smoothDriftX, smoothDriftY, 0);
Vector3d diff = aimPoint.subtract(mc.player.getEyePosition(1.0F));
float targetYaw = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0F);
float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, Math.hypot(diff.x, diff.z)));
float yawDelta = MathHelper.wrapDegrees(targetYaw - rotate.x);
float pitchDelta = targetPitch - rotate.y;
float maxYawDelta = 60.0f + (ThreadLocalRandom.current().nextFloat() * 1.0329834f);
float maxPitchDelta = ThreadLocalRandom.current().nextFloat(23.133f, 26.477f);
yawDelta = MathHelper.clamp(yawDelta, -maxYawDelta, maxYawDelta);
pitchDelta = MathHelper.clamp(pitchDelta, -maxPitchDelta, maxPitchDelta);
if (Math.abs(yawDelta) < 0.01f && Math.abs(pitchDelta) > 0) {
yawDelta += ThreadLocalRandom.current().nextFloat(0.1f, 0.5f) + 0.1f * 1.0313f;
}
if (Math.abs(pitchDelta) < 0.01f && Math.abs(yawDelta) > 0) {
pitchDelta += ThreadLocalRandom.current().nextFloat(0.1f, 0.5f) + 0.1f * 1.0313f;
}
boolean isHovering = Math.abs(yawDelta) < 4.0f && Math.abs(pitchDelta) < 4.0f;
if (!isHovering) {
float gcd = SensUtil.getGCDValue();
if (gcd == 0) gcd = 0.15f;
float speed = ThreadLocalRandom.current().nextFloat(0.65f, 0.75f);
float moveYaw = yawDelta * speed;
float movePitch = pitchDelta * speed;
int dx = Math.round(moveYaw / gcd);
int dy = Math.round(movePitch / gcd);
float actualMoveYaw = dx * gcd;
float actualMovePitch = dy * gcd;
rotate = new Vector2f(rotate.x + actualMoveYaw, MathHelper.clamp(rotate.y + actualMovePitch, -90.0f, 90.0f));
} else {
if (ThreadLocalRandom.current().nextFloat() < 0.05f) {
float gcd = SensUtil.getGCDValue();
if (gcd == 0) gcd = 0.15f;
lastMicroX += ThreadLocalRandom.current().nextFloat(-0.5f, 0.5f);
lastMicroY += ThreadLocalRandom.current().nextFloat(-0.5f, 0.5f);
lastMicroX = MathHelper.clamp(lastMicroX, -1.5f, 1.5f);
lastMicroY = MathHelper.clamp(lastMicroY, -1.5f, 1.5f);
int dx = Math.round(lastMicroX);
int dy = Math.round(lastMicroY);
rotate = new Vector2f(rotate.x + dx * gcd, MathHelper.clamp(rotate.y + dy * gcd, -90.0f, 90.0f));
}
}
mc.player.rotationYawOffset = rotate.x;
}