Skip to content

Commit

Permalink
fix(KillAura/AutoBlock): auto block tick off (#5482)
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 authored Jan 28, 2025
1 parent c2bbaf0 commit 991566f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,11 @@ object ModuleKillAura : ClientModule("KillAura", Category.COMBAT) {
true
}
}
} else if (KillAuraAutoBlock.tickOff > 0 && clickScheduler.isClickOnNextTick(KillAuraAutoBlock.tickOff)
&& KillAuraAutoBlock.shouldUnblockToHit) {
KillAuraAutoBlock.stopBlocking(pauses = true)
} else {
if (clickScheduler.isClickOnNextTick(KillAuraAutoBlock.tickOff) && KillAuraAutoBlock.shouldUnblockToHit) {
KillAuraAutoBlock.stopBlocking(pauses = true)
} else {
KillAuraAutoBlock.startBlocking()
}
KillAuraAutoBlock.startBlocking()
}
}

Expand Down Expand Up @@ -508,9 +507,7 @@ object ModuleKillAura : ClientModule("KillAura", Category.COMBAT) {
network.sendPacket(CloseHandledScreenC2SPacket(0))
}

val wasBlocking = player.isBlockAction

if (wasBlocking) {
if (player.isBlockAction) {
if (!KillAuraAutoBlock.enabled && !ModuleMultiActions.mayCurrentlyAttackWhileUsing()) {
return
}
Expand Down Expand Up @@ -545,7 +542,7 @@ object ModuleKillAura : ClientModule("KillAura", Category.COMBAT) {
}

// If the player was blocking before, we start blocking again after the attack if the tick on is 0
if (wasBlocking && KillAuraAutoBlock.blockImmediate) {
if (KillAuraAutoBlock.blockImmediate) {
KillAuraAutoBlock.startBlocking()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ object KillAuraAutoBlock : ToggleableConfigurable(ModuleKillAura, "AutoBlocking"
var blockingStateEnforced = false
set(value) {
ModuleDebug.debugParameter(this, "BlockingStateEnforced", value)
ModuleDebug.debugParameter(this, if (value) {
"Block Age"
} else {
"Unblock Age"
}, player.age)

field = value
}

Expand Down Expand Up @@ -204,7 +210,7 @@ object KillAuraAutoBlock : ToggleableConfigurable(ModuleKillAura, "AutoBlocking"
}

// We do not want the player to stop eating or else. Only when he blocks.
if (!player.isBlockAction || mc.options.useKey.isPressed) {
if (!player.isBlockAction) {
return false
}

Expand All @@ -219,11 +225,8 @@ object KillAuraAutoBlock : ToggleableConfigurable(ModuleKillAura, "AutoBlocking"
unblockMode == UnblockMode.CHANGE_SLOT -> {
val currentSlot = player.inventory.selectedSlot
val nextSlot = (currentSlot + 1) % 8

// todo: add support for tick-off delay, since this is a bit too fast
network.sendPacket(UpdateSelectedSlotC2SPacket(nextSlot))
network.sendPacket(UpdateSelectedSlotC2SPacket(currentSlot))

blockingStateEnforced = false
true
}
Expand Down

0 comments on commit 991566f

Please sign in to comment.