Skip to content

Commit 58020a4

Browse files
BaitinqAvanatiker
andauthored
AutoOffhand: Show remaining items (#453)
* AutoOffhand: Add "Show Remaining" option This option shows the remaining number of items of type AutoOffhandType in the inventory next to the module name in the HUD. * Cleanup Co-authored-by: Constructor <[email protected]>
1 parent 2b22f51 commit 58020a4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/kotlin/com/lambda/client/module/modules/combat/AutoOffhand.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ object AutoOffhand : Module(
6767
private val priority by setting("Priority", Priority.HOTBAR)
6868
private val switchMessage by setting("Switch Message", true)
6969

70+
// Represents the remaining number of items of type AutoOffhandType in the inventory
71+
private var hudInfo = ""
72+
7073
private enum class Type(val filter: (ItemStack) -> Boolean) {
7174
TOTEM({ it.item.id == 449 }),
7275
GAPPLE({ it.item is ItemAppleGold }),
@@ -98,9 +101,13 @@ object AutoOffhand : Module(
98101
updateDamage()
99102

100103
switchToType(getType(), true)
104+
105+
hudInfo = player.allSlots.countByStack { type.filter(it) }.toString()
101106
}
102107
}
103108

109+
override fun getHudInfo() = hudInfo
110+
104111
private fun SafeClientEvent.getType() = when {
105112
checkTotem() -> Type.TOTEM
106113
checkStrength() -> Type.STRENGTH

0 commit comments

Comments
 (0)