Skip to content
Merged
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 @@ -67,6 +67,9 @@ object AutoOffhand : Module(
private val priority by setting("Priority", Priority.HOTBAR)
private val switchMessage by setting("Switch Message", true)

// Represents the remaining number of items of type AutoOffhandType in the inventory
private var hudInfo = ""

private enum class Type(val filter: (ItemStack) -> Boolean) {
TOTEM({ it.item.id == 449 }),
GAPPLE({ it.item is ItemAppleGold }),
Expand Down Expand Up @@ -98,9 +101,13 @@ object AutoOffhand : Module(
updateDamage()

switchToType(getType(), true)

hudInfo = player.allSlots.countByStack { type.filter(it) }.toString()
}
}

override fun getHudInfo() = hudInfo

private fun SafeClientEvent.getType() = when {
checkTotem() -> Type.TOTEM
checkStrength() -> Type.STRENGTH
Expand Down