Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
NoHitDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
Nilsen84 committed Aug 1, 2023
1 parent 131c934 commit f25a884
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions agent/src/main/kotlin/io/github/nilsen84/lcqt/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ class Config {
val cosmeticsEnabled: Boolean = false
val freelookEnabled: Boolean = false
val crackedEnabled: Boolean = false
val noHitDelayEnabled: Boolean = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ object LcqtPatcher {
if (config.cosmeticsEnabled) patches += CosmeticsPatch()
if (config.freelookEnabled) patches += FreelookPatch()
if (config.crackedEnabled) patches += CrackedAccountPatch()
if (config.noHitDelayEnabled) patches += NoHitDelayPatch()

println("RUNNING LCQT WITH PATCHES: " + patches.joinToString {
it::class.simpleName!!
})


inst.addTransformer(Transformer(patches))
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.github.nilsen84.lcqt.patches

import io.github.nilsen84.lcqt.Patch
import org.objectweb.asm.Opcodes
import org.objectweb.asm.tree.ClassNode
import org.objectweb.asm.tree.FieldInsnNode
import org.objectweb.asm.tree.IntInsnNode

class NoHitDelayPatch : Patch() {
override fun transform(cn: ClassNode): Boolean {
if (cn.name != "net/minecraft/client/Minecraft") {
return false
}

val clickMouse = cn.methods.find { it.name == "clickMouse" } ?: return false

val instructions = clickMouse.instructions
.filterIsInstance<IntInsnNode>()
.filter {
it.opcode == Opcodes.BIPUSH && it.operand == 10 && it.next.let {
it is FieldInsnNode && it.name == "leftClickCounter"
}
}
.onEach { it.operand = 0 }

return instructions.isNotEmpty()
}
}
6 changes: 6 additions & 0 deletions gui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
freelookEnabled: boolean,
noHitDelayEnabled: boolean,
jvmEnabled: boolean,
customJvm: boolean,
customJvmPath: string,
Expand All @@ -27,6 +29,8 @@
freelookEnabled: false,
noHitDelayEnabled: false,
jvmEnabled: true,
customJvm: false,
customJvmPath: '',
Expand Down Expand Up @@ -96,6 +100,8 @@

<Module name="Freelook Enable" bind:enabled={config.freelookEnabled}></Module>

<Module name="NoHitDelay" bind:enabled={config.noHitDelayEnabled}></Module>

<Module name="JVM" bind:enabled={config.jvmEnabled}>
<div class="flex flex-row items-center gap-4">
<Switch bind:enabled={config.customJvm}></Switch>
Expand Down

0 comments on commit f25a884

Please sign in to comment.