Skip to content

Commit

Permalink
feat(legacy/KillAura): GenerateSpotBasedOnDistance option.
Browse files Browse the repository at this point in the history
  • Loading branch information
mems01 committed Jan 10, 2025
1 parent e6cfb06 commit 3bc8cab
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import net.ccbluex.liquidbounce.utils.attack.EntityUtils.isSelected
import net.ccbluex.liquidbounce.utils.extensions.*
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.coerceBodyPoint
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.currentRotation
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.isFaced
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.performAngleChange
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.rotationDifference
Expand All @@ -35,6 +36,10 @@ object Aimbot : Module("Aimbot", Category.COMBAT, hideModule = false) {
private val legitimize by boolean("Legitimize", true) { horizontalAim || verticalAim }
private val maxAngleChange by float("MaxAngleChange", 10f, 1F..180F) { horizontalAim || verticalAim }
private val inViewMaxAngleChange by float("InViewMaxAngleChange", 35f, 1f..180f) { horizontalAim || verticalAim }
private val generateSpotBasedOnDistance by boolean(
"GenerateSpotBasedOnDistance",
false
) { horizontalAim || verticalAim }
private val predictClientMovement by int("PredictClientMovement", 2, 0..5)
private val predictEnemyPosition by float("PredictEnemyPosition", 1.5f, -1f..2f)
private val highestBodyPointToTargetValue: ListValue =
Expand Down Expand Up @@ -101,7 +106,7 @@ object Aimbot : Module("Aimbot", Category.COMBAT, hideModule = false) {
if (mc.gameSettings.keyBindAttack.isKeyDown) clickTimer.reset()

if (onClick && (clickTimer.hasTimePassed(150) ||
!mc.gameSettings.keyBindAttack.isKeyDown && AutoClicker.handleEvents())
!mc.gameSettings.keyBindAttack.isKeyDown && AutoClicker.handleEvents())
) {
return@handler
}
Expand Down Expand Up @@ -146,9 +151,12 @@ object Aimbot : Module("Aimbot", Category.COMBAT, hideModule = false) {
val boundingBox = entity.hitBox.offset(prediction)
val (currPos, oldPos) = player.currPos to player.prevPos

val simPlayer = SimulatedPlayer.fromClientPlayer(player.movementInput)
val simPlayer =
SimulatedPlayer.fromClientPlayer(RotationUtils.modifiedInput)

repeat(predictClientMovement + 1) {
simPlayer.rotationYaw = (currentRotation ?: player.rotation).yaw

repeat(predictClientMovement) {
simPlayer.tick()
}

Expand All @@ -161,6 +169,7 @@ object Aimbot : Module("Aimbot", Category.COMBAT, hideModule = false) {
} else {
searchCenter(
boundingBox,
generateSpotBasedOnDistance,
outborder = false,
predict = true,
lookRange = range,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R, hideModule
private val useHitDelay by boolean("UseHitDelay", false)
private val hitDelayTicks by int("HitDelayTicks", 1, 1..5) { useHitDelay }

private val generateSpotBasedOnDistance by boolean("GenerateSpotBasedOnDistance", false) { options.rotationsActive }

private val randomization = RandomizationSettings(this) { options.rotationsActive }
private val outborder by boolean("Outborder", false) { options.rotationsActive }

Expand Down Expand Up @@ -885,11 +887,14 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R, hideModule
val boundingBox = entity.hitBox.offset(prediction)
val (currPos, oldPos) = player.currPos to player.prevPos

val simPlayer = SimulatedPlayer.fromClientPlayer(player.movementInput)
val simPlayer =
SimulatedPlayer.fromClientPlayer(RotationUtils.modifiedInput)

simPlayer.rotationYaw = (currentRotation ?: player.rotation).yaw

var pos = currPos

(0..predictClientMovement + 1).forEach { i ->
repeat(predictClientMovement) {
val previousPos = simPlayer.pos

simPlayer.tick()
Expand All @@ -907,7 +912,7 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R, hideModule
pos = simPlayer.pos

if (currDist <= range && currDist <= prevDist) {
return@forEach
return@repeat
}
}

Expand All @@ -918,6 +923,7 @@ object KillAura : Module("KillAura", Category.COMBAT, Keyboard.KEY_R, hideModule

val rotation = searchCenter(
boundingBox,
generateSpotBasedOnDistance,
outborder && !attackTimer.hasTimePassed(attackDelay / 2),
randomization,
predict = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ object ProjectileAimbot : Module("ProjectileAimbot", Category.COMBAT, hideModule
searchCenter(
it,
outborder = false,
randomization,
randomization = this.randomization,
predict = true,
lookRange = range,
attackRange = range,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ object RotationUtils : MinecraftInstance, Listenable {
* @return center
*/
fun searchCenter(
bb: AxisAlignedBB, outborder: Boolean, randomization: RandomizationSettings? = null, predict: Boolean,
bb: AxisAlignedBB, distanceBasedSpot: Boolean = false, outborder: Boolean,
randomization: RandomizationSettings? = null, predict: Boolean,
lookRange: Float, attackRange: Float, throughWallsRange: Float = 0f,
bodyPoints: List<String> = listOf("Head", "Feet"), horizontalSearch: ClosedFloatingPointRange<Float> = 0f..1f,
): Rotation? {
Expand All @@ -243,7 +244,11 @@ object RotationUtils : MinecraftInstance, Listenable {

val eyes = mc.thePlayer.eyes

val currRotation = Rotation.ZERO.plus(currentRotation ?: mc.thePlayer.rotation)
val preferredRotation = toRotation(getNearestPointBB(eyes, bb), predict).takeIf {
distanceBasedSpot
} ?: currentRotation ?: mc.thePlayer.rotation

val currRotation = Rotation.ZERO.plus(preferredRotation)

var attackRotation: Pair<Rotation, Float>? = null
var lookRotation: Pair<Rotation, Float>? = null
Expand Down

0 comments on commit 3bc8cab

Please sign in to comment.