aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/stats.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-20 22:54:05 -0500
committermat <github@matdoes.dev>2022-05-20 22:54:05 -0500
commiteb13e07305169c0f19ee87e2516005eb5c0ef3c9 (patch)
tree79ce5d5b0af95d65881ef4bf231de34e5ac456c1 /src/cleaners/skyblock/stats.ts
parent3d1506341d77e9271df9ec1091b4871d61544a67 (diff)
downloadskyblock-api-eb13e07305169c0f19ee87e2516005eb5c0ef3c9.tar.gz
skyblock-api-eb13e07305169c0f19ee87e2516005eb5c0ef3c9.tar.bz2
skyblock-api-eb13e07305169c0f19ee87e2516005eb5c0ef3c9.zip
fastest_target_practice stat & leaderboard
Diffstat (limited to 'src/cleaners/skyblock/stats.ts')
-rw-r--r--src/cleaners/skyblock/stats.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts
index 8105f26..a89bdd2 100644
--- a/src/cleaners/skyblock/stats.ts
+++ b/src/cleaners/skyblock/stats.ts
@@ -85,6 +85,9 @@ export interface StatItem {
}
export function getStatUnit(name: string): string | null {
+ if (name === 'fastest_target_practice')
+ return 'time'
+
for (const [unitName, statMatchers] of Object.entries(statUnits)) {
for (const statMatch of statMatchers) {
let trailingEnd = statMatch[0] === '_'
@@ -118,5 +121,15 @@ export function cleanProfileStats(data: typedHypixelApi.SkyBlockProfileMember):
})
}
+ if (data.fastest_target_practice !== undefined)
+ stats.push({
+ categorizedName: 'fastest_target_practice',
+ // the api gives it in seconds, we want milliseconds
+ value: data.fastest_target_practice * 1000,
+ rawName: 'fastest_target_practice',
+ category: 'misc',
+ unit: 'time'
+ })
+
return stats
}