diff --git a/README.md b/README.md index b52ecbc..359b797 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses | PvP Arena - Rank | `pvpArena` | | Soul Wars Zeal | `soulWarsZeal` | | Rifts closed | `riftsClosed` | +| Colosseum Glory | `colosseumGlory` | ### Points @@ -143,6 +144,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses | Kraken | `kraken` | | Kreearra | `kreeArra` | | K'ril Tsutsaroth | `krilTsutsaroth` | +| Lunar Chests | `lunarChests` | | Mimic | `mimic` | | Nex | `nex` | | Nightmare | `nightmare` | @@ -153,6 +155,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses | Scorpia | `scorpia` | | Scurrius | `scurrius` | | Skotizo | `skotizo` | +| Sol Heredit | `solHeredit` | | Spindel | `spindel` | | Tempoross | `tempoross` | | The Gauntlet | `gauntlet` | @@ -199,6 +202,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses pvpArena: {}, soulWarsZeal: {}, riftsClosed: {}, + colosseumGlory: {}, bosses: {} } } diff --git a/__tests__/b0atyStats.csv b/__tests__/b0atyStats.csv index 388c5bc..ab477f0 100644 --- a/__tests__/b0atyStats.csv +++ b/__tests__/b0atyStats.csv @@ -39,6 +39,7 @@ -1,-1 6776,14780 4773,1060 +5,24522 2741,2192 90203,594 29573,143 @@ -68,6 +69,7 @@ 115056,1908 10406,920 2196,1444 +-1,-1 1005,33 28413,620 4157,744 @@ -78,6 +80,7 @@ 108898,26 23958,90 373975,9 +-1,-1 2005,1569 40001,273 192608,7 diff --git a/__tests__/b0atyStats.json b/__tests__/b0atyStats.json index 1f91974..d622b38 100644 --- a/__tests__/b0atyStats.json +++ b/__tests__/b0atyStats.json @@ -119,84 +119,87 @@ { "id": 14, "name": "PvP Arena - Rank", "rank": -1, "score": -1 }, { "id": 15, "name": "Soul Wars Zeal", "rank": 6776, "score": 14780 }, { "id": 16, "name": "Rifts closed", "rank": 4773, "score": 1060 }, - { "id": 17, "name": "Abyssal Sire", "rank": 2741, "score": 2192 }, - { "id": 18, "name": "Alchemical Hydra", "rank": 90203, "score": 594 }, - { "id": 19, "name": "Artio", "rank": 29573, "score": 143 }, - { "id": 20, "name": "Barrows Chests", "rank": 3668, "score": 1830 }, - { "id": 21, "name": "Bryophyta", "rank": 206778, "score": 5 }, - { "id": 22, "name": "Callisto", "rank": 32897, "score": 293 }, - { "id": 23, "name": "Calvar'ion", "rank": 64112, "score": 58 }, - { "id": 24, "name": "Cerberus", "rank": 18492, "score": 1905 }, - { "id": 25, "name": "Chambers of Xeric", "rank": 178941, "score": 34 }, - { - "id": 26, + { "id": 17, "name": "Colosseum Glory", "rank": 5, "score": 24522 }, + { "id": 18, "name": "Abyssal Sire", "rank": 2741, "score": 2192 }, + { "id": 19, "name": "Alchemical Hydra", "rank": 90203, "score": 594 }, + { "id": 20, "name": "Artio", "rank": 29573, "score": 143 }, + { "id": 21, "name": "Barrows Chests", "rank": 3668, "score": 1830 }, + { "id": 22, "name": "Bryophyta", "rank": 206778, "score": 5 }, + { "id": 23, "name": "Callisto", "rank": 32897, "score": 293 }, + { "id": 24, "name": "Calvar'ion", "rank": 64112, "score": 58 }, + { "id": 25, "name": "Cerberus", "rank": 18492, "score": 1905 }, + { "id": 26, "name": "Chambers of Xeric", "rank": 178941, "score": 34 }, + { + "id": 27, "name": "Chambers of Xeric: Challenge Mode", "rank": 2379, "score": 501 }, - { "id": 27, "name": "Chaos Elemental", "rank": 82902, "score": 50 }, - { "id": 28, "name": "Chaos Fanatic", "rank": 147358, "score": 26 }, - { "id": 29, "name": "Commander Zilyana", "rank": 51973, "score": 287 }, - { "id": 30, "name": "Corporeal Beast", "rank": 2377, "score": 2000 }, - { "id": 31, "name": "Crazy Archaeologist", "rank": 147406, "score": 41 }, - { "id": 32, "name": "Dagannoth Prime", "rank": 32225, "score": 707 }, - { "id": 33, "name": "Dagannoth Rex", "rank": 42229, "score": 698 }, - { "id": 34, "name": "Dagannoth Supreme", "rank": 32212, "score": 714 }, - { "id": 35, "name": "Deranged Archaeologist", "rank": 79605, "score": 25 }, - { "id": 36, "name": "Duke Sucellus", "rank": 9517, "score": 688 }, - { "id": 37, "name": "General Graardor", "rank": 19125, "score": 1228 }, - { "id": 38, "name": "Giant Mole", "rank": 65849, "score": 474 }, - { "id": 39, "name": "Grotesque Guardians", "rank": 2080, "score": 2140 }, - { "id": 40, "name": "Hespori", "rank": 16433, "score": 182 }, - { "id": 41, "name": "Kalphite Queen", "rank": 2006, "score": 2046 }, - { "id": 42, "name": "King Black Dragon", "rank": 48575, "score": 580 }, - { "id": 43, "name": "Kraken", "rank": 115056, "score": 1908 }, - { "id": 44, "name": "Kree'Arra", "rank": 10406, "score": 920 }, - { "id": 45, "name": "K'ril Tsutsaroth", "rank": 2196, "score": 1444 }, - { "id": 46, "name": "Mimic", "rank": 1005, "score": 33 }, - { "id": 47, "name": "Nex", "rank": 28413, "score": 620 }, - { "id": 48, "name": "Nightmare", "rank": 4157, "score": 744 }, - { "id": 49, "name": "Phosani's Nightmare", "rank": 4261, "score": 500 }, - { "id": 50, "name": "Obor", "rank": 993, "score": 217 }, - { "id": 51, "name": "Phantom Muspah", "rank": 21848, "score": 251 }, - { "id": 52, "name": "Sarachnis", "rank": 66260, "score": 119 }, - { "id": 53, "name": "Scorpia", "rank": 108898, "score": 26 }, - { "id": 54, "name": "Scurrius", "rank": 23958, "score": 90 }, - { "id": 55, "name": "Skotizo", "rank": 373975, "score": 9 }, - { "id": 56, "name": "Spindel", "rank": 2005, "score": 1569 }, - { "id": 57, "name": "Tempoross", "rank": 40001, "score": 273 }, - { "id": 58, "name": "The Gauntlet", "rank": 192608, "score": 7 }, - { "id": 59, "name": "The Corrupted Gauntlet", "rank": 78367, "score": 201 }, - { "id": 60, "name": "The Leviathan", "rank": 5679, "score": 583 }, - { "id": 61, "name": "The Whisperer", "rank": 478, "score": 1760 }, - { "id": 62, "name": "Theatre of Blood", "rank": 22932, "score": 250 }, - { - "id": 63, + { "id": 28, "name": "Chaos Elemental", "rank": 82902, "score": 50 }, + { "id": 29, "name": "Chaos Fanatic", "rank": 147358, "score": 26 }, + { "id": 30, "name": "Commander Zilyana", "rank": 51973, "score": 287 }, + { "id": 31, "name": "Corporeal Beast", "rank": 2377, "score": 2000 }, + { "id": 32, "name": "Crazy Archaeologist", "rank": 147406, "score": 41 }, + { "id": 33, "name": "Dagannoth Prime", "rank": 32225, "score": 707 }, + { "id": 34, "name": "Dagannoth Rex", "rank": 42229, "score": 698 }, + { "id": 35, "name": "Dagannoth Supreme", "rank": 32212, "score": 714 }, + { "id": 36, "name": "Deranged Archaeologist", "rank": 79605, "score": 25 }, + { "id": 37, "name": "Duke Sucellus", "rank": 9517, "score": 688 }, + { "id": 38, "name": "General Graardor", "rank": 19125, "score": 1228 }, + { "id": 39, "name": "Giant Mole", "rank": 65849, "score": 474 }, + { "id": 40, "name": "Grotesque Guardians", "rank": 2080, "score": 2140 }, + { "id": 41, "name": "Hespori", "rank": 16433, "score": 182 }, + { "id": 42, "name": "Kalphite Queen", "rank": 2006, "score": 2046 }, + { "id": 43, "name": "King Black Dragon", "rank": 48575, "score": 580 }, + { "id": 44, "name": "Kraken", "rank": 115056, "score": 1908 }, + { "id": 45, "name": "Kree'Arra", "rank": 10406, "score": 920 }, + { "id": 46, "name": "K'ril Tsutsaroth", "rank": 2196, "score": 1444 }, + { "id": 47, "name": "Lunar Chests", "rank": -1, "score": -1 }, + { "id": 48, "name": "Mimic", "rank": 1005, "score": 33 }, + { "id": 49, "name": "Nex", "rank": 28413, "score": 620 }, + { "id": 50, "name": "Nightmare", "rank": 4157, "score": 744 }, + { "id": 51, "name": "Phosani's Nightmare", "rank": 4261, "score": 500 }, + { "id": 52, "name": "Obor", "rank": 993, "score": 217 }, + { "id": 53, "name": "Phantom Muspah", "rank": 21848, "score": 251 }, + { "id": 54, "name": "Sarachnis", "rank": 66260, "score": 119 }, + { "id": 55, "name": "Scorpia", "rank": 108898, "score": 26 }, + { "id": 56, "name": "Scurrius", "rank": 23958, "score": 90 }, + { "id": 57, "name": "Skotizo", "rank": 373975, "score": 9 }, + { "id": 58, "name": "Sol Heredit", "rank": -1, "score": -1 }, + { "id": 59, "name": "Spindel", "rank": 2005, "score": 1569 }, + { "id": 60, "name": "Tempoross", "rank": 40001, "score": 273 }, + { "id": 61, "name": "The Gauntlet", "rank": 192608, "score": 7 }, + { "id": 62, "name": "The Corrupted Gauntlet", "rank": 78367, "score": 201 }, + { "id": 63, "name": "The Leviathan", "rank": 5679, "score": 583 }, + { "id": 64, "name": "The Whisperer", "rank": 478, "score": 1760 }, + { "id": 65, "name": "Theatre of Blood", "rank": 22932, "score": 250 }, + { + "id": 66, "name": "Theatre of Blood: Hard Mode", "rank": 15059, "score": 7 }, { - "id": 64, + "id": 67, "name": "Thermonuclear Smoke Devil", "rank": 7161, "score": 3066 }, - { "id": 65, "name": "Tombs of Amascut", "rank": 101555, "score": 35 }, + { "id": 68, "name": "Tombs of Amascut", "rank": 101555, "score": 35 }, { - "id": 66, + "id": 69, "name": "Tombs of Amascut: Expert Mode", "rank": 610, "score": 933 }, - { "id": 67, "name": "TzKal-Zuk", "rank": 15733, "score": 2 }, - { "id": 68, "name": "TzTok-Jad", "rank": -1, "score": -1 }, - { "id": 69, "name": "Vardorvis", "rank": 2051, "score": 2078 }, - { "id": 70, "name": "Venenatis", "rank": 194, "score": 7096 }, - { "id": 71, "name": "Vet'ion", "rank": 69260, "score": 51 }, - { "id": 72, "name": "Vorkath", "rank": 14039, "score": 2780 }, - { "id": 73, "name": "Wintertodt", "rank": 876367, "score": 62 }, - { "id": 74, "name": "Zalcano", "rank": 165341, "score": 25 }, - { "id": 75, "name": "Zulrah", "rank": 226318, "score": 275 } + { "id": 70, "name": "TzKal-Zuk", "rank": 15733, "score": 2 }, + { "id": 71, "name": "TzTok-Jad", "rank": -1, "score": -1 }, + { "id": 72, "name": "Vardorvis", "rank": 2051, "score": 2078 }, + { "id": 73, "name": "Venenatis", "rank": 194, "score": 7096 }, + { "id": 74, "name": "Vet'ion", "rank": 69260, "score": 51 }, + { "id": 75, "name": "Vorkath", "rank": 14039, "score": 2780 }, + { "id": 76, "name": "Wintertodt", "rank": 876367, "score": 62 }, + { "id": 77, "name": "Zalcano", "rank": 165341, "score": 25 }, + { "id": 78, "name": "Zulrah", "rank": 226318, "score": 275 } ] } diff --git a/__tests__/hiscores.test.ts b/__tests__/hiscores.test.ts index 6e18904..4f024d0 100644 --- a/__tests__/hiscores.test.ts +++ b/__tests__/hiscores.test.ts @@ -102,6 +102,7 @@ test('Parse CSV to json', () => { 13,4057 37,225 25,1110 + 90,12148 382,2780 944,3000 704,892 @@ -131,6 +132,7 @@ test('Parse CSV to json', () => { 41643,1477 625,2391 120,2981 + 15,69 1,109 99,39002 3,22666 @@ -141,6 +143,7 @@ test('Parse CSV to json', () => { 82,3404 555,7079 5085,61 + 57,40 678,903 18823,23 63,375 @@ -201,6 +204,7 @@ test('Parse CSV to json', () => { pvpArena: { rank: 13, score: 4057 }, soulWarsZeal: { rank: 37, score: 225 }, riftsClosed: { rank: 25, score: 1110 }, + colosseumGlory: { rank: 90, score: 12148 }, clues: { all: { rank: 32, score: 12148 }, beginner: { rank: 3105, score: 76 }, @@ -240,6 +244,7 @@ test('Parse CSV to json', () => { kraken: { rank: 41643, score: 1477 }, kreeArra: { rank: 625, score: 2391 }, krilTsutsaroth: { rank: 120, score: 2981 }, + lunarChests: { rank: 15, score: 69 }, mimic: { rank: 1, score: 109 }, nex: { rank: 99, score: 39002 }, nightmare: { rank: 3, score: 22666 }, @@ -250,6 +255,7 @@ test('Parse CSV to json', () => { scorpia: { rank: 82, score: 3404 }, scurrius: { rank: 555, score: 7079 }, skotizo: { rank: 5085, score: 61 }, + solHeredit: { rank: 57, score: 40 }, spindel: { rank: 678, score: 903 }, tempoross: { rank: 18823, score: 23 }, gauntlet: { rank: 63, score: 375 }, diff --git a/src/hiscores.ts b/src/hiscores.ts index fce4459..148ff73 100644 --- a/src/hiscores.ts +++ b/src/hiscores.ts @@ -44,6 +44,7 @@ import { FORMATTED_PVP_ARENA, FORMATTED_SOUL_WARS, FORMATTED_RIFTS_CLOSED, + FORMATTED_COLOSSEUM_GLORY, FORMATTED_DEADMAN_POINTS } from './utils'; @@ -162,6 +163,7 @@ export function parseJsonStats(json: HiscoresResponse): Stats { const pvpArena = getActivity(FORMATTED_PVP_ARENA); const soulWarsZeal = getActivity(FORMATTED_SOUL_WARS); const riftsClosed = getActivity(FORMATTED_RIFTS_CLOSED); + const colosseumGlory = getActivity(FORMATTED_COLOSSEUM_GLORY); const stats: Stats = { skills, @@ -172,6 +174,7 @@ export function parseJsonStats(json: HiscoresResponse): Stats { pvpArena, soulWarsZeal, riftsClosed, + colosseumGlory, clues, bosses }; @@ -221,8 +224,8 @@ export function parseStats(csv: string): Stats { const [leaguePoints, deadmanPoints] = activityObjects.splice(0, 2); const bhObjects = activityObjects.splice(0, BH_MODES.length); const clueObjects = activityObjects.splice(0, CLUES.length); - const [lastManStanding, pvpArena, soulWarsZeal, riftsClosed] = - activityObjects.splice(0, 4); + const [lastManStanding, pvpArena, soulWarsZeal, riftsClosed, colosseumGlory] = + activityObjects.splice(0, 5); const bossObjects = activityObjects.splice(0, BOSSES.length); const skills: Skills = skillObjects.reduce((prev, curr, index) => { @@ -258,6 +261,7 @@ export function parseStats(csv: string): Stats { pvpArena, soulWarsZeal, riftsClosed, + colosseumGlory, clues, bosses }; diff --git a/src/types.ts b/src/types.ts index a5ab330..5176b50 100644 --- a/src/types.ts +++ b/src/types.ts @@ -96,6 +96,7 @@ export type Boss = | 'kraken' | 'kreeArra' | 'krilTsutsaroth' + | 'lunarChests' | 'mimic' | 'nex' | 'nightmare' @@ -106,6 +107,7 @@ export type Boss = | 'scorpia' | 'scurrius' | 'skotizo' + | 'solHeredit' | 'spindel' | 'tempoross' | 'gauntlet' @@ -140,6 +142,7 @@ export type ActivityName = | 'pvpArena' | 'soulWarsZeal' | 'riftsClosed' + | 'colosseumGlory' | 'allClues' | 'beginnerClues' | 'easyClues' @@ -165,6 +168,7 @@ export interface Stats { pvpArena: Activity; soulWarsZeal: Activity; riftsClosed: Activity; + colosseumGlory: Activity; bosses: Bosses; } export type Modes = { [M in Gamemode]?: Stats }; diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 2e01be8..28c8524 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -103,6 +103,7 @@ export const BOSSES: Boss[] = [ 'kraken', 'kreeArra', 'krilTsutsaroth', + 'lunarChests', 'mimic', 'nex', 'nightmare', @@ -113,6 +114,7 @@ export const BOSSES: Boss[] = [ 'scorpia', 'scurrius', 'skotizo', + 'solHeredit', 'spindel', 'tempoross', 'gauntlet', @@ -152,6 +154,7 @@ export const ACTIVITIES: ActivityName[] = [ 'pvpArena', 'soulWarsZeal', 'riftsClosed', + 'colosseumGlory', ...BOSSES ]; @@ -189,6 +192,7 @@ export const FORMATTED_BOSS_NAMES: FormattedBossNames = { kraken: 'Kraken', kreeArra: "Kree'Arra", krilTsutsaroth: "K'ril Tsutsaroth", + lunarChests: 'Lunar Chests', mimic: 'Mimic', nex: 'Nex', nightmare: 'Nightmare', @@ -199,6 +203,7 @@ export const FORMATTED_BOSS_NAMES: FormattedBossNames = { scorpia: 'Scorpia', scurrius: 'Scurrius', skotizo: 'Skotizo', + solHeredit: 'Sol Heredit', spindel: 'Spindel', tempoross: 'Tempoross', gauntlet: 'The Gauntlet', @@ -283,6 +288,7 @@ export const FORMATTED_SOUL_WARS = 'Soul Wars Zeal'; export const FORMATTED_LEAGUE_POINTS = 'League Points'; export const FORMATTED_DEADMAN_POINTS = 'Deadman Points'; export const FORMATTED_RIFTS_CLOSED = 'Rifts closed'; +export const FORMATTED_COLOSSEUM_GLORY = 'Colosseum Glory'; export const INVALID_FORMAT_ERROR = 'Invalid hiscores format'; export const PLAYER_NOT_FOUND_ERROR = 'Player not found';