Skip to content

Commit

Permalink
random sens
Browse files Browse the repository at this point in the history
  • Loading branch information
aesthetic0001 authored Mar 13, 2024
1 parent 066e104 commit 3659f2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const PI = Math.PI
const PI_2 = Math.PI * 2
const PHYSICS_INTERVAL_MS = 50
const PHYSICS_TIMESTEP = PHYSICS_INTERVAL_MS / 1000 // 0.05
const randomSens = (Math.random() * 0.1) + 0.05

function inject(bot, {physicsEnabled, maxCatchupTicks}) {
const PHYSICS_CATCHUP_TICKS = maxCatchupTicks ?? 4
Expand Down Expand Up @@ -335,7 +336,7 @@ function inject(bot, {physicsEnabled, maxCatchupTicks}) {

// this is done to bypass certain anticheat checks that detect the player's sensitivity
// by calculating the gcd of how much they move the mouse each tick
const sensitivity = conv.fromNotchianPitch(0.15) // this is equal to 100% sensitivity in vanilla
const sensitivity = conv.fromNotchianPitch(randomSens)
const yawChange = Math.round((yaw - bot.entity.yaw) / sensitivity) * sensitivity
const pitchChange = Math.round((pitch - bot.entity.pitch) / sensitivity) * sensitivity

Expand Down

0 comments on commit 3659f2c

Please sign in to comment.