From 170322d2943e26c6755dfd5d907dc9318cb900ec Mon Sep 17 00:00:00 2001 From: Luna <62033805+Luna5ama@users.noreply.github.com> Date: Thu, 19 Jan 2023 23:47:30 -0500 Subject: [PATCH] AutoPot weakness friend range --- .../me/luna/trollhack/module/modules/combat/AutoPot.kt | 5 +++++ src/main/kotlin/me/luna/trollhack/util/ClassUtils.kt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/me/luna/trollhack/module/modules/combat/AutoPot.kt b/src/main/kotlin/me/luna/trollhack/module/modules/combat/AutoPot.kt index 5f12351e..d17bc1b9 100644 --- a/src/main/kotlin/me/luna/trollhack/module/modules/combat/AutoPot.kt +++ b/src/main/kotlin/me/luna/trollhack/module/modules/combat/AutoPot.kt @@ -50,6 +50,7 @@ internal object AutoPot : Module( private val healHealth by setting("Heal Health", 12.0f, 0.0f..20.0f, 0.5f, ::heal) private val healDelay by setting("Heal Delay", 500, 0..10000, 50, ::heal) private val weakness by setting("Weakness", false) + private val weaknessFriendRange by setting("Weakness Friend Range", 5.0f, 0.0f..10.0f, 0.5f, ::weakness) private val weaknessRange by setting("Weakness Range", 1.8f, 0.0f..4.0f, 0.1f, ::weakness) private val weaknessDelay by setting("Weakness Delay", 1500, 0..10000, 50, ::weakness) private val speed by setting("Speed", true) @@ -186,6 +187,10 @@ internal object AutoPot : Module( return weakness && timer.tick(weaknessDelay) && super.check(event) + && (weaknessFriendRange == 0.0f || EntityManager.players.asSequence() + .filterNot { it.isFakeOrSelf } + .filter { it.isFriend } + .all { event.player.getDistanceSq(it) > weaknessFriendRange * weaknessFriendRange }) && EntityManager.players.asSequence() .filterNot { it.isFriend } .filterNot { it.isFakeOrSelf } diff --git a/src/main/kotlin/me/luna/trollhack/util/ClassUtils.kt b/src/main/kotlin/me/luna/trollhack/util/ClassUtils.kt index e5637269..41848641 100644 --- a/src/main/kotlin/me/luna/trollhack/util/ClassUtils.kt +++ b/src/main/kotlin/me/luna/trollhack/util/ClassUtils.kt @@ -23,7 +23,7 @@ object ClassUtils { } else { classLoader.getResource(packagePath)!! } - println(root) + val isJar = root.toString().startsWith("jar") val classes = ArrayList>()