diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-06-23 07:45:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-23 13:45:28 +0200 |
commit | 7ff28af498fdba6e5a2a1150c3e2620c613c2c48 (patch) | |
tree | 84082f6f1233d119f5e8b06b3f52037c120ef8db /src/main | |
parent | 8b51cb356a7e03f28a2cf41442d0c7e02f760607 (diff) | |
download | skyhanni-7ff28af498fdba6e5a2a1150c3e2620c613c2c48.tar.gz skyhanni-7ff28af498fdba6e5a2a1150c3e2620c613c2c48.tar.bz2 skyhanni-7ff28af498fdba6e5a2a1150c3e2620c613c2c48.zip |
Feature & Fix: Powder Tracker Hard Stone & Goblin Eggs (#2138)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/mining/PowderTrackerConfig.java | 8 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt | 37 |
2 files changed, 39 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/mining/PowderTrackerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/mining/PowderTrackerConfig.java index 2f277d925..1c32cabc2 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/mining/PowderTrackerConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/mining/PowderTrackerConfig.java @@ -22,6 +22,7 @@ import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.P import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.FTX; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.GEMSTONE_POWDER; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.GOLD_ESSENCE; +import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.HARD_STONE; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.JADE; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.MITHRIL_POWDER; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.ROBOTRON; @@ -29,6 +30,7 @@ import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.P import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.SAPPHIRE; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.SPACER_1; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.SPACER_2; +import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.SPACER_3; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.TOPAZ; import static at.hannibal2.skyhanni.config.features.mining.PowderTrackerConfig.PowderDisplayEntry.TOTAL_CHESTS; @@ -60,6 +62,8 @@ public class PowderTrackerConfig { DIAMOND_ESSENCE, GOLD_ESSENCE, SPACER_2, + HARD_STONE, + SPACER_3, RUBY, SAPPHIRE, AMBER, @@ -80,6 +84,8 @@ public class PowderTrackerConfig { DIAMOND_ESSENCE("§b129 §bDiamond Essence §7(600/h)", 7), GOLD_ESSENCE("§b234 §6Gold Essence §7(700/h)", 8), SPACER_2("", 9), + HARD_STONE("§b1000 §fHard Stone §bCompacted §7(500/h)"), + SPACER_3(""), RUBY("§50§7-§90§7-§a0§f-0 §cRuby Gemstone", 10), SAPPHIRE("§50§7-§90§7-§a0§f-0 §bSapphire Gemstone", 11), AMBER("§50§7-§90§7-§a0§f-0 §6Amber Gemstone", 12), @@ -93,7 +99,7 @@ public class PowderTrackerConfig { CONTROL_SWITCH("§b14 §9Control Switch", 20), SYNTHETIC_HEART("§b14 §9Synthetic Heart", 21), TOTAL_ROBOT_PARTS("§b14 §9Total Robot Parts", 22), - GOBLIN_EGGS("§90§7-§a0§7-§c0§f-§e0§f-§30 §fGoblin Egg", 23), + GOBLIN_EGGS("§30§7-§c0§7-§e0§f-§a0§f-§90 §fGoblin Egg", 23), WISHING_COMPASS("§b12 §aWishing Compass", 24), SLUDGE_JUICE("§b320 §aSludge Juice", 25), ASCENSION_ROPE("§b2 §9Ascension Rope", 26), diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt index a936f9636..f302b669b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt @@ -57,6 +57,14 @@ object PowderTracker { "§e§lPASSIVE EVENT §b§l2X POWDER §e§lRUNNING FOR §a§l(?<time>.*)§r" ) + /** + * REGEX-TEST: §b§lCOMPACT! §r§fYou found an §r§aEnchanted Hard Stone§r§f! + */ + private val compactedPattern by patternGroup.pattern( + "compacted", + "§b§lCOMPACT! §r§fYou found an §r§aEnchanted Hard Stone§r§f!", + ) + private var lastChestPicked = SimpleTimeMark.farPast() private var isGrinding = false private val gemstoneInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf()) @@ -64,6 +72,7 @@ object PowderTracker { private val diamondEssenceInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf()) private val goldEssenceInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf()) private val chestInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf()) + private val hardStoneInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf()) private var doublePowder = false private var powderTimer = "" private val gemstones = listOf( @@ -87,6 +96,7 @@ object PowderTracker { calculateResourceHour(diamondEssenceInfo) calculateResourceHour(goldEssenceInfo) calculateResourceHour(chestInfo) + calculateResourceHour(hardStoneInfo) doublePowder = powderBossBarPattern.matcher(BossbarData.getBossbar()).find() powderBossBarPattern.matchMatcher(BossbarData.getBossbar()) { @@ -109,12 +119,16 @@ object PowderTracker { override fun reset() { rewards.clear() totalChestPicked = 0 + totalHardStoneCompacted = 0 } @Expose var totalChestPicked = 0 @Expose + var totalHardStoneCompacted = 0 + + @Expose var rewards: MutableMap<PowderChestReward, Long> = mutableMapOf() } @@ -153,6 +167,12 @@ object PowderTracker { powderStartedPattern.matchMatcher(msg) { doublePowder = true } powderEndedPattern.matchMatcher(msg) { doublePowder = false } + compactedPattern.matchMatcher(msg) { + tracker.modify { + it.totalHardStoneCompacted += 1 + } + } + for (reward in PowderChestReward.entries) { reward.chatPattern.matchMatcher(msg) { tracker.modify { @@ -192,6 +212,9 @@ object PowderTracker { chestInfo.perHour = 0.0 chestInfo.stoppedChecks = 0 chestInfo.perMin.clear() + hardStoneInfo.perHour = 0.0 + hardStoneInfo.stoppedChecks = 0 + hardStoneInfo.perMin.clear() doublePowder = false tracker.update() } @@ -240,6 +263,7 @@ object PowderTracker { calculate(data, diamondEssenceInfo, PowderChestReward.DIAMOND_ESSENCE) calculate(data, goldEssenceInfo, PowderChestReward.GOLD_ESSENCE) calculateChest(data) + calculateHardStone(data) val chestPerHour = format(chestInfo.perHour) addAsSingletonList("§d${data.totalChestPicked.addSeparators()} Total Chests Picked §7($chestPerHour/h)") @@ -252,11 +276,10 @@ object PowderTracker { addAsSingletonList("") addPerHour(rewards, entries[46], diamondEssenceInfo) addPerHour(rewards, entries[47], goldEssenceInfo) - - addAsSingletonList("") - - + val hardStonePerHour = format(hardStoneInfo.perHour) + addAsSingletonList("§b${data.totalHardStoneCompacted.addSeparators()} §fHard Stone §bCompacted §7($hardStonePerHour/h)") + addAsSingletonList("") for ((gem, color) in gemstones) { var totalGemstone = 0L @@ -289,7 +312,7 @@ object PowderTracker { val redEgg = rewards.getOrDefault(PowderChestReward.RED_GOBLIN_EGG, 0) val yellowEgg = rewards.getOrDefault(PowderChestReward.YELLOW_GOBLIN_EGG, 0) val blueEgg = rewards.getOrDefault(PowderChestReward.BLUE_GOBLIN_EGG, 0) - addAsSingletonList("§9$goblinEgg§7-§a$greenEgg§7-§c$redEgg§f-§e$yellowEgg§f-§3$blueEgg §fGoblin Egg") + addAsSingletonList("§3$blueEgg§7-§c$redEgg§7-§e$yellowEgg§f-§a$greenEgg§f-§9$goblinEgg §fGoblin Egg") for (reward in entries.subList(37, 46)) { val count = rewards.getOrDefault(reward, 0).addSeparators() @@ -341,6 +364,10 @@ object PowderTracker { chestInfo.estimated = data.totalChestPicked.toLong() } + private fun calculateHardStone(data: Data) { + hardStoneInfo.estimated = data.totalHardStoneCompacted.toLong() + } + private fun convert(roughCount: Long): Gem { val flawlessRatio = 512000 val fineRatio = 6400 |