Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Tickbase): breakEarly option #4948

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package net.ccbluex.liquidbounce.features.module.modules.combat

import net.ccbluex.liquidbounce.config.types.NamedChoice
import net.ccbluex.liquidbounce.config.types.ToggleableConfigurable
import net.ccbluex.liquidbounce.event.events.*
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.event.tickHandler
Expand Down Expand Up @@ -66,7 +67,11 @@ internal object ModuleTickBase : ClientModule("TickBase", Category.COMBAT) {
private val lineColor by color("Line", Color4b.WHITE)
.doNotIncludeAlways()

private val requiresKillAura by boolean("RequiresKillAura", true)
private object RequiresKillAura : ToggleableConfigurable(this, "RequiesKillAura", true) {
val breakEarly by boolean("BreakEarly", true)
}

private val requiresKillAura = tree(RequiresKillAura)

private var ticksToSkip = 0
private var tickBalance = 0f
Expand Down Expand Up @@ -126,14 +131,18 @@ internal object ModuleTickBase : ClientModule("TickBase", Category.COMBAT) {

// We do not want to tickbase if killaura is not ready to attack
val breakRequirement = {
requiresKillAura && !(ModuleKillAura.running &&
ModuleKillAura.clickScheduler.isClickOnNextTick(bestTick))
requiresKillAura.enabled && requiresKillAura.breakEarly &&
!ModuleKillAura.clickScheduler.isClickOnNextTick(bestTick)
}

if (breakRequirement()) {
return@tickHandler
}

if (requiresKillAura.enabled && !ModuleKillAura.running) {
return@tickHandler
}

when (mode) {
TickBaseMode.PAST -> {
ticksToSkip = bestTick + pause
Expand Down
Loading