Skip to content

Commit

Permalink
Fix stats reporting due to new stats format
Browse files Browse the repository at this point in the history
  • Loading branch information
waicool20 committed Jul 25, 2018
1 parent cf3052a commit c083068
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/kotlin/com/waicool20/kaga/kcauto/KCAutoStats.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ object KCAutoStatsTracker {
currentStats().pvpsDone = it.groupValues[1].toInt()
}

// Track buckets used
subscribe(Regex(".*Resupplies: $stat \\|\\| Repairs: $stat \\|\\| Buckets: $stat.*")) {
// Track resupplies
subscribe(Regex(".*Resupplies: $stat \\|\\| Fairy resupplies: $stat.*")) {
currentStats().resupplies = it.groupValues[1].toInt() + it.groupValues[2].toInt()
}

// Track repairs and buckets
subscribe(Regex(".*Repairs: $stat \\|\\| Buckets: $stat.*")) {
currentStats().apply {
resupplies = it.groupValues[1].toInt()
repairs = it.groupValues[2].toInt()
bucketsUsed = it.groupValues[3].toInt()
repairs = it.groupValues[1].toInt()
bucketsUsed = it.groupValues[2].toInt()
}
}

Expand All @@ -86,7 +90,7 @@ object KCAutoStatsTracker {
}

// Track recoveries
subscribe(Regex(".*Recoveries done: (\\d+).*")) {
subscribe(Regex(".*Recoveries done: $stat.*")) {
currentStats().recoveries = it.groupValues[1].toInt()
}

Expand Down

0 comments on commit c083068

Please sign in to comment.