Skip to content

Commit

Permalink
FIINALLY
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspw-w committed Mar 8, 2024
1 parent d17786c commit 7073f65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class LegitAura : Module() {
private val clickTimer = MSTimer()
var isBlocking = false
private var lastTarget: EntityLivingBase? = null

private var thread: Thread? = null
private var attackDelay = 0L

override fun onDisable() {
Expand Down Expand Up @@ -95,8 +95,11 @@ class LegitAura : Module() {

if (!clickTimer.hasTimePassed(attackDelay)) return

runAttack()
clickTimer.reset()
if (thread == null || !thread!!.isAlive) {
thread = Thread { runAttack() }
thread!!.start()
clickTimer.reset()
} else clickTimer.reset()
}

private fun runAttack() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class TPAura : Module() {
private val clickTimer = MSTimer()
var isBlocking = false
private var lastTarget: EntityLivingBase? = null
private var thread: Thread? = null

private val attackDelay: Long
get() = 1000L / apsValue.get().toLong()
Expand All @@ -70,8 +71,11 @@ class TPAura : Module() {

if (!clickTimer.hasTimePassed(attackDelay)) return

runAttack()
clickTimer.reset()
if (thread == null || !thread!!.isAlive) {
thread = Thread { runAttack() }
thread!!.start()
clickTimer.reset()
} else clickTimer.reset()
}

private fun runAttack() {
Expand Down

0 comments on commit 7073f65

Please sign in to comment.