Skip to content

Commit b1ca0d8

Browse files
committed
TargetStrafe improvements
1 parent 5c258b8 commit b1ca0d8

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

common/src/main/kotlin/com/lambda/module/modules/movement/Speed.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ object Speed : Module(
4545
private val grimEntityBoost by setting("Entity Boost", 1.0, 0.0..2.0, 0.01) { mode == Mode.GRIM_STRAFE }
4646
private val grimCollideMultiplier by setting("Entity Collide Multiplier", 0.5, 0.0..1.0, 0.01) { mode == Mode.GRIM_STRAFE && grimEntityBoost > 0.0}
4747
private val grimBoatBoost by setting("Boat Boost", 0.4, 0.0..1.0, 0.01) { mode == Mode.GRIM_STRAFE }
48+
private val grimMaxSpeed by setting("Max Speed", 1.0, 0.2..1.0, 0.01) { mode == Mode.GRIM_STRAFE }
4849

4950
// NCP
5051
private val strict by setting("Strict", true) { mode == Mode.NCP_STRAFE }
@@ -141,6 +142,7 @@ object Speed : Module(
141142

142143
private fun SafeContext.handleGrim() {
143144
if (!isInputting) return
145+
if (player.moveDelta > grimMaxSpeed) return
144146

145147
var boostAmount = 0.0
146148

common/src/main/kotlin/com/lambda/module/modules/movement/TargetStrafe.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ object TargetStrafe : Module(
2323
description = "Automatically strafes around entities",
2424
defaultTags = setOf(ModuleTag.MOVEMENT)
2525
) {
26-
private val range by setting("Range", 6.0, 2.0..10.0, 0.5)
27-
private val targetDistance by setting("Target Distance", 1.0, 0.0..5.0, 0.5)
26+
private val range by setting("Range", 6.0, 2.0..10.0, 0.1)
27+
private val targetDistance by setting("Target Distance", 1.0, 0.0..5.0, 0.1)
2828
private val jitterCompensation by setting("Jitter Compensation", 0.0, 0.0..1.0, 0.1)
2929
private val stabilize by setting("Stabilize", StabilizationMode.NORMAL)
3030

@@ -85,15 +85,18 @@ object TargetStrafe : Module(
8585
else -> forwardDirection
8686
}
8787

88-
val shouldStabilize = when (stabilize) {
88+
// Premium code, do not touch it bites
89+
var shouldStabilize = when (stabilize) {
8990
StabilizationMode.NONE -> false
90-
StabilizationMode.WEAK -> player.age % 3 == 0
91-
StabilizationMode.NORMAL -> player.age % 2 == 0
92-
StabilizationMode.STRONG -> true
91+
StabilizationMode.WEAK -> player.age % 4 == 0 // 1/4
92+
StabilizationMode.NORMAL -> player.age % 2 == 0 // 2/4
93+
StabilizationMode.STRONG -> player.age % 4 != 0 // 3/4
9394
}
9495

96+
shouldStabilize = shouldStabilize && distSq > (targetDistance + 0.5).pow(2)
97+
9598
var strafe = strafeDirection.toDouble()
96-
if (shouldStabilize && distSq > (targetDistance + 0.5).pow(2)) strafe = 0.0
99+
if (shouldStabilize) strafe = 0.0
97100

98101
event.input.mergeFrom(
99102
buildMovementInput(

0 commit comments

Comments
 (0)