@@ -5,6 +5,7 @@ import com.lambda.client.event.SafeClientEvent
5
5
import com.lambda.client.event.events.CriticalsUpdateWalkingEvent
6
6
import com.lambda.client.event.events.PacketEvent
7
7
import com.lambda.client.event.events.PlayerAttackEvent
8
+ import com.lambda.client.event.events.PlayerMoveEvent
8
9
import com.lambda.client.mixin.extension.isInWeb
9
10
import com.lambda.client.mixin.extension.playerIsOnGround
10
11
import com.lambda.client.mixin.extension.playerMoving
@@ -32,6 +33,7 @@ object Criticals : Module(
32
33
private val mode by setting(" Mode" , Mode .EDIT )
33
34
private val jumpMotion by setting(" Jump Motion" , 0.25 , 0.1 .. 0.5 , 0.01 , { mode == Mode .MINI_JUMP }, fineStep = 0.001 )
34
35
private val attackFallDistance by setting(" Attack Fall Distance" , 0.1 , 0.05 .. 1.0 , 0.05 , { mode == Mode .MINI_JUMP || mode == Mode .JUMP })
36
+ private val strict by setting(" Strict" , true , visibility = { mode == Mode .PACKET })
35
37
36
38
private enum class Mode (override val displayName : String ) : DisplayEnum {
37
39
PACKET (" Packet" ),
@@ -43,6 +45,7 @@ object Criticals : Module(
43
45
private var delayTick = - 1
44
46
private var target: Entity ? = null
45
47
private var spoofedY = - 1337.0
48
+ private var moveTick = 69
46
49
47
50
override fun isActive (): Boolean {
48
51
return isEnabled && ! delaying()
@@ -66,30 +69,32 @@ object Criticals : Module(
66
69
67
70
safeListener<PacketEvent .Send > {
68
71
if (it.packet is CPacketAnimation
69
- && mode != Mode .PACKET
72
+ && mode == Mode .MINI_JUMP || mode == Mode . JUMP
70
73
&& delayTick > - 1
71
74
) {
72
75
it.cancel()
73
76
return @safeListener
74
77
}
75
78
76
- if (it.packet is CPacketPlayer
77
- && mode == Mode .EDIT
78
- ) {
79
- // the advantage of this is that it doesn't delay anything and doesn't send extra packets
80
- if (player.onGround) {
81
- if (spoofedY <= 0 ) {
82
- spoofedY = .01
83
- } else {
84
- spoofedY - = .00001
79
+ if (it.packet is CPacketPlayer ) {
80
+ if (mode == Mode .EDIT ) {
81
+ // the advantage of this is that it doesn't delay anything and doesn't send extra packets
82
+ if (player.onGround) {
83
+ if (spoofedY <= 0 ) {
84
+ spoofedY = .01
85
+ } else {
86
+ spoofedY - = .00001
87
+ }
88
+ } else spoofedY = - 1337.0
89
+
90
+ it.packet.playerMoving = true
91
+ it.packet.playerIsOnGround = false
92
+
93
+ if (spoofedY >= 0 ) {
94
+ it.packet.playerY + = spoofedY
85
95
}
86
- } else spoofedY = - 1337.0
87
-
88
- it.packet.playerMoving = true
89
- it.packet.playerIsOnGround = false
90
-
91
- if (spoofedY >= 0 ) {
92
- it.packet.playerY + = spoofedY
96
+ } else if (mode == Mode .PACKET && strict && moveTick < 0 ) {
97
+ it.cancel()
93
98
}
94
99
}
95
100
}
@@ -103,8 +108,19 @@ object Criticals : Module(
103
108
Mode .PACKET -> {
104
109
if (! cooldownReady) return @safeListener
105
110
106
- connection.sendPacket(CPacketPlayer .Position (player.posX, player.posY + 0.1 , player.posZ, false ))
107
- connection.sendPacket(CPacketPlayer .Position (player.posX, player.posY, player.posZ, false ))
111
+ if (strict) {
112
+ connection.sendPacket(CPacketPlayer .Position (player.posX, player.posY + 0.11 , player.posZ, false ))
113
+ connection.sendPacket(CPacketPlayer .Position (player.posX, player.posY + 0.1100013579 , player.posZ, false ))
114
+ connection.sendPacket(CPacketPlayer .Position (player.posX, player.posY + 1 .3579E- 6 , player.posZ, false ))
115
+
116
+ player.motionX = .0
117
+ player.motionZ = .0
118
+
119
+ moveTick = - 3
120
+ } else {
121
+ connection.sendPacket(CPacketPlayer .Position (player.posX, player.posY + 0.1 , player.posZ, false ))
122
+ connection.sendPacket(CPacketPlayer .Position (player.posX, player.posY, player.posZ, false ))
123
+ }
108
124
}
109
125
Mode .JUMP -> {
110
126
jumpAndCancel(it, cooldownReady, null )
@@ -116,6 +132,14 @@ object Criticals : Module(
116
132
}
117
133
}
118
134
135
+ safeListener<PlayerMoveEvent > {
136
+ if (++ moveTick < 0 ) {
137
+ player.motionX = .0
138
+ player.motionY = .0
139
+ player.motionZ = .0
140
+ }
141
+ }
142
+
119
143
safeListener<TickEvent .ClientTickEvent > { event ->
120
144
if (event.phase != TickEvent .Phase .END
121
145
|| mode == Mode .PACKET
@@ -139,6 +163,7 @@ object Criticals : Module(
139
163
140
164
private fun reset () {
141
165
delayTick = - 1
166
+ moveTick = 69
142
167
target = null
143
168
}
144
169
0 commit comments