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

fix(AutoClicker/Left): Wawit block break #5270

Open
wants to merge 1 commit into
base: nextgen
Choose a base branch
from
Open
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 @@ -47,7 +47,7 @@ object ModuleAutoClicker : ClientModule("AutoClicker", Category.COMBAT, aliases
val clickScheduler = tree(ClickScheduler(this, true))
internal val requiresNoInput by boolean("RequiresNoInput", false)
private val objectiveType by enumChoice("Objective", ObjectiveType.ANY)
private val onItemUse by enumChoice("OnItemUse", Use.WAIT)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove On Item Use? This is really needed for blocking during combat.

private val onBlockBreaking by enumChoice("OnBlockBreaking", Breaking.WAIT)
private val weapon by enumChoice("Weapon", Weapon.ANY)
private val delayPostStopUse by int("DelayPostStopUse", 0, 0..20, "ticks")

Expand All @@ -65,9 +65,8 @@ object ModuleAutoClicker : ClientModule("AutoClicker", Category.COMBAT, aliases
ANY("Any")
}

enum class Use(override val choiceName: String) : NamedChoice {
enum class Breaking(override val choiceName: String) : NamedChoice {
WAIT("Wait"),
STOP("Stop"),
IGNORE("Ignore")
}

Expand All @@ -94,9 +93,9 @@ object ModuleAutoClicker : ClientModule("AutoClicker", Category.COMBAT, aliases
}

suspend fun Sequence<*>.encounterItemUse(): Boolean {
return when (onItemUse) {
Use.WAIT -> {
this.waitUntil { !player.isUsingItem }
return when (onBlockBreaking) {
Breaking.WAIT -> {
this.waitUntil { !interaction.isBreakingBlock }

if (delayPostStopUse > 0) {
waitTicks(delayPostStopUse)
Expand All @@ -105,17 +104,7 @@ object ModuleAutoClicker : ClientModule("AutoClicker", Category.COMBAT, aliases
true
}

Use.STOP -> {
interaction.stopUsingItem(player)

if (delayPostStopUse > 0) {
waitTicks(delayPostStopUse)
}

true
}

Use.IGNORE -> false
Breaking.IGNORE -> false
}
}

Expand Down Expand Up @@ -157,10 +146,8 @@ object ModuleAutoClicker : ClientModule("AutoClicker", Category.COMBAT, aliases
}
}

if (player.usingItem) {
val encounterItemUse = encounterItemUse()

if (encounterItemUse) {
if (interaction.isBreakingBlock) {
if (encounterItemUse()) {
return@tickHandler
}
}
Expand Down
Loading