From 1fa1c0f27c764ff7f55512e342f7a98b48812c0d Mon Sep 17 00:00:00 2001 From: Doogie13 <62295632+doogie13@users.noreply.github.com> Date: Sun, 15 Jan 2023 13:15:27 +0000 Subject: [PATCH 1/2] Added Criticals -> Strict setting for packet crits --- .../client/module/modules/combat/Criticals.kt | 69 ++++++++++++++----- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt b/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt index d1b8473ae..3aa5af284 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt @@ -5,6 +5,7 @@ import com.lambda.client.event.SafeClientEvent import com.lambda.client.event.events.CriticalsUpdateWalkingEvent import com.lambda.client.event.events.PacketEvent import com.lambda.client.event.events.PlayerAttackEvent +import com.lambda.client.event.events.PlayerMoveEvent import com.lambda.client.mixin.extension.isInWeb import com.lambda.client.mixin.extension.playerIsOnGround import com.lambda.client.mixin.extension.playerMoving @@ -32,6 +33,7 @@ object Criticals : Module( private val mode by setting("Mode", Mode.EDIT) private val jumpMotion by setting("Jump Motion", 0.25, 0.1..0.5, 0.01, { mode == Mode.MINI_JUMP }, fineStep = 0.001) private val attackFallDistance by setting("Attack Fall Distance", 0.1, 0.05..1.0, 0.05, { mode == Mode.MINI_JUMP || mode == Mode.JUMP }) + private val strict by setting("Strict", true, visibility = { mode == Mode.PACKET }) private enum class Mode(override val displayName: String) : DisplayEnum { PACKET("Packet"), @@ -43,6 +45,7 @@ object Criticals : Module( private var delayTick = -1 private var target: Entity? = null private var spoofedY = -1337.0 + private var moveTick = 69 override fun isActive(): Boolean { return isEnabled && !delaying() @@ -66,30 +69,32 @@ object Criticals : Module( safeListener { if (it.packet is CPacketAnimation - && mode != Mode.PACKET + && mode == Mode.MINI_JUMP || mode == Mode.JUMP && delayTick > -1 ) { it.cancel() return@safeListener } - if (it.packet is CPacketPlayer - && mode == Mode.EDIT - ) { - // the advantage of this is that it doesn't delay anything and doesn't send extra packets - if (player.onGround) { - if (spoofedY <= 0) { - spoofedY = .01 - } else { - spoofedY -= .00001 + if (it.packet is CPacketPlayer) { + if (mode == Mode.EDIT) { + // the advantage of this is that it doesn't delay anything and doesn't send extra packets + if (player.onGround) { + if (spoofedY <= 0) { + spoofedY = .01 + } else { + spoofedY -= .00001 + } + } else spoofedY = -1337.0 + + it.packet.playerMoving = true + it.packet.playerIsOnGround = false + + if (spoofedY >= 0) { + it.packet.playerY += spoofedY } - } else spoofedY = -1337.0 - - it.packet.playerMoving = true - it.packet.playerIsOnGround = false - - if (spoofedY >= 0) { - it.packet.playerY += spoofedY + } else if (mode == Mode.PACKET && strict && moveTick < 0) { + it.cancel() } } } @@ -103,8 +108,23 @@ object Criticals : Module( Mode.PACKET -> { if (!cooldownReady) return@safeListener - connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 0.1, player.posZ, false)) - connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY, player.posZ, false)) + if (strict) { + + connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 0.11, player.posZ, false)) + connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 0.1100013579, player.posZ, false)) + connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 1.3579E-6, player.posZ, false)) + + player.motionX = .0 + player.motionZ = .0 + + moveTick = -3 + + } else { + + connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 0.1, player.posZ, false)) + connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY, player.posZ, false)) + + } } Mode.JUMP -> { jumpAndCancel(it, cooldownReady, null) @@ -116,6 +136,16 @@ object Criticals : Module( } } + safeListener { + + if (++moveTick < 0) { + player.motionX = .0 + player.motionY = .0 + player.motionZ = .0 + } + + } + safeListener { event -> if (event.phase != TickEvent.Phase.END || mode == Mode.PACKET @@ -139,6 +169,7 @@ object Criticals : Module( private fun reset() { delayTick = -1 + moveTick = 69 target = null } From b257bcaf5b1ca699d538f6f1925dc28530837740 Mon Sep 17 00:00:00 2001 From: Constructor Date: Mon, 16 Jan 2023 03:43:13 +0100 Subject: [PATCH 2/2] Sorry Doogie but i dont like so many empty lines :D --- .../com/lambda/client/module/modules/combat/Criticals.kt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt b/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt index 3aa5af284..e1dcb85f4 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/combat/Criticals.kt @@ -109,7 +109,6 @@ object Criticals : Module( if (!cooldownReady) return@safeListener if (strict) { - connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 0.11, player.posZ, false)) connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 0.1100013579, player.posZ, false)) connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 1.3579E-6, player.posZ, false)) @@ -118,12 +117,9 @@ object Criticals : Module( player.motionZ = .0 moveTick = -3 - } else { - connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY + 0.1, player.posZ, false)) connection.sendPacket(CPacketPlayer.Position(player.posX, player.posY, player.posZ, false)) - } } Mode.JUMP -> { @@ -137,13 +133,11 @@ object Criticals : Module( } safeListener { - if (++moveTick < 0) { player.motionX = .0 player.motionY = .0 player.motionZ = .0 } - } safeListener { event ->