From 11391c90f26b36584dcf97e2e29498492051735a Mon Sep 17 00:00:00 2001 From: David Meredith Date: Wed, 24 May 2023 08:48:46 -0500 Subject: [PATCH 1/2] Add support for the Legacy Bounty Hunter minigame --- README.md | 18 +- __tests__/b0atyNamePage.html | 533 +++++++++++++++++-------------- __tests__/hiscores.test.ts | 15 +- __tests__/lynxTitanNamePage.html | 297 ++++++++++------- __tests__/lynxTitanStats.csv | 2 + src/types.ts | 4 +- src/utils/constants.ts | 8 +- 7 files changed, 501 insertions(+), 376 deletions(-) diff --git a/README.md b/README.md index 061defa..c75217e 100644 --- a/README.md +++ b/README.md @@ -104,14 +104,16 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses ### Minigames -| Minigame | Param | -| ---------------------- | :---------------: | -| Bounty Hunter (Rogue) | `rogueBH` | -| Bounty Hunter (Hunter) | `hunterBH` | -| Last Man Standing | `lastManStanding` | -| PvP Arena | `pvpArena` | -| Soul Wars Zeal | `soulWarsZeal` | -| Rifts Closed | `riftsClosed` | +| Minigame | Param | +| ------------------------------- | :---------------: | +| Bounty Hunter (Rogue) | `rogueBH` | +| Bounty Hunter (Hunter) | `hunterBH` | +| Bounty Hunter (Legacy - Rogue) | `rogueLegacyBH` | +| Bounty Hunter (Legacy - Hunter) | `hunterLegacyBH` | +| Last Man Standing | `lastManStanding` | +| PvP Arena | `pvpArena` | +| Soul Wars Zeal | `soulWarsZeal` | +| Rifts Closed | `riftsClosed` | ### Leagues diff --git a/__tests__/b0atyNamePage.html b/__tests__/b0atyNamePage.html index 7e5980c..48acb55 100644 --- a/__tests__/b0atyNamePage.html +++ b/__tests__/b0atyNamePage.html @@ -9,7 +9,7 @@ Old School Hiscores @@ -86,7 +86,7 @@ property="og:image" content="https://www.runescape.com/img/rsp777/social-share-fb.jpg?1" /> - + - + Log in @@ -396,7 +420,7 @@
Old School Hiscores
- Home + Home

@@ -412,17 +436,17 @@
Ironman Ultimate Ironman Hardcore Ironman
@@ -434,17 +458,17 @@
Deadman Mode Leagues Tournament
@@ -456,12 +480,12 @@
Group Ironman Hardcore Group Ironman
@@ -469,11 +493,28 @@
Fresh Start Worlds
+
+ + Account Builds + + +
- - - + + + - diff --git a/__tests__/hiscores.test.ts b/__tests__/hiscores.test.ts index 8467d47..354ef6f 100644 --- a/__tests__/hiscores.test.ts +++ b/__tests__/hiscores.test.ts @@ -12,7 +12,8 @@ import { getSkillPageURL, getStatsURL, BOSSES, - INVALID_FORMAT_ERROR + INVALID_FORMAT_ERROR, + BH_MODES } from '../src/index'; const B0ATY_NAME = 'B0ATY'; @@ -79,6 +80,8 @@ test('Parse CSV to json', () => { 23423,478 99831,23 89912,37 + 89914,35 + 99834,25 32,12148 3105,76 1997,505 @@ -175,7 +178,9 @@ test('Parse CSV to json', () => { leaguePoints: { rank: 23423, score: 478 }, bountyHunter: { hunter: { rank: 99831, score: 23 }, - rogue: { rank: 89912, score: 37 } + rogue: { rank: 89912, score: 37 }, + legacyHunter: { rank: 89914, score: 35 }, + legacyRogue: { rank: 99834, score: 25 } }, lastManStanding: { rank: 4814, score: 898 }, pvpArena: { rank: 13, score: 4057 }, @@ -475,7 +480,7 @@ test('Get non-existent player', async () => { }); test('Get stats by gamemode', async () => { - const { skills, bosses } = await getStatsByGamemode( + const { skills, bosses, bountyHunter } = await getStatsByGamemode( LYNX_TITAN_FORMATTED_NAME ); @@ -508,8 +513,10 @@ test('Get stats by gamemode', async () => { const bossKeys = Object.keys(bosses); expect(bossKeys).toStrictEqual(BOSSES); + const bountyHunterKeys = Object.keys(bountyHunter); + expect(bountyHunterKeys).toStrictEqual(BH_MODES); - expect.assertions(2); + expect.assertions(3); }); describe('Get stats options', () => { diff --git a/__tests__/lynxTitanNamePage.html b/__tests__/lynxTitanNamePage.html index dc50a23..a00639e 100644 --- a/__tests__/lynxTitanNamePage.html +++ b/__tests__/lynxTitanNamePage.html @@ -9,7 +9,7 @@ Old School Hiscores @@ -86,7 +86,7 @@ property="og:image" content="https://www.runescape.com/img/rsp777/social-share-fb.jpg?1" /> - + - + Log in @@ -396,7 +420,7 @@
Old School Hiscores
- Home + Home

@@ -412,17 +436,17 @@
Ironman Ultimate Ironman Hardcore Ironman
@@ -434,17 +458,17 @@
Deadman Mode Leagues Tournament
@@ -456,12 +480,12 @@
Group Ironman Hardcore Group Ironman
@@ -469,11 +493,28 @@
Fresh Start Worlds
+
+ + Account Builds + + +
Click here @@ -1246,7 +1317,7 @@ alt="Jagex Software" />

- This website and its contents are copyright © 1999 - 2022 Jagex + This website and its contents are copyright © 1999 - 2023 Jagex Ltd, 220 Science Park, Cambridge, CB4 0WA, United Kingdom.
Use of this website is subject to our OSRS RSS Feed - - - + + + diff --git a/__tests__/lynxTitanStats.csv b/__tests__/lynxTitanStats.csv index a17fc2b..092879b 100644 --- a/__tests__/lynxTitanStats.csv +++ b/__tests__/lynxTitanStats.csv @@ -29,6 +29,8 @@ -1,-1 -1,-1 -1,-1 +-1,-1 +-1,-1 347584,22 -1,-1 -1,-1 diff --git a/src/types.ts b/src/types.ts index 7677cd4..e25b219 100644 --- a/src/types.ts +++ b/src/types.ts @@ -60,7 +60,7 @@ export type ClueType = export type Clues = { [Type in ClueType]: Activity }; -export type BHType = 'rogue' | 'hunter'; +export type BHType = 'rogue' | 'hunter' | 'legacyRogue' | 'legacyHunter'; export type BH = { [Type in BHType]: Activity }; @@ -126,6 +126,8 @@ export type ActivityName = | 'leaguePoints' | 'hunterBH' | 'rogueBH' + | 'hunterLegacyBH' + | 'rogueLegacyBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 1a13b2d..5ccd0ce 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -62,7 +62,7 @@ export const CLUES: ClueType[] = [ 'elite', 'master' ]; -export const BH_MODES: BHType[] = ['hunter', 'rogue']; +export const BH_MODES: BHType[] = ['hunter', 'rogue', 'legacyHunter', 'legacyRogue']; export const GAMEMODES: Gamemode[] = [ 'main', 'ironman', @@ -132,6 +132,8 @@ export const ACTIVITIES: ActivityName[] = [ 'leaguePoints', 'hunterBH', 'rogueBH', + 'hunterLegacyBH', + 'rogueLegacyBH', 'allClues', 'beginnerClues', 'easyClues', @@ -258,7 +260,9 @@ export type FormattedBHNames = { export const FORMATTED_BH_NAMES: FormattedBHNames = { rogue: 'Bounty Hunter - Rogue', - hunter: 'Bounty Hunter - Hunter' + hunter: 'Bounty Hunter - Hunter', + legacyRogue: 'Bounty Hunter (Legacy) - Rogue', + legacyHunter: 'Bounty Hunter (Legacy) - Hunter' }; export const FORMATTED_LMS = 'Last Man Standing'; From a8cf1713afa64eea438ecd4118af8a5f1108025b Mon Sep 17 00:00:00 2001 From: David Meredith Date: Thu, 25 May 2023 09:37:30 -0500 Subject: [PATCH 2/2] Change approach to tracking the new Bounty Hunter stats --- README.md | 8 ++++---- __tests__/hiscores.test.ts | 8 ++++---- src/types.ts | 6 +++--- src/utils/constants.ts | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c75217e..e62d6a1 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,10 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses | Minigame | Param | | ------------------------------- | :---------------: | -| Bounty Hunter (Rogue) | `rogueBH` | -| Bounty Hunter (Hunter) | `hunterBH` | -| Bounty Hunter (Legacy - Rogue) | `rogueLegacyBH` | -| Bounty Hunter (Legacy - Hunter) | `hunterLegacyBH` | +| Bounty Hunter (Legacy - Rogue) | `rogueBH` | +| Bounty Hunter (Legacy - Hunter) | `hunterBH` | +| Bounty Hunter (Rogue) | `rogueBHV2` | +| Bounty Hunter (Hunter) | `hunterBHV2` | | Last Man Standing | `lastManStanding` | | PvP Arena | `pvpArena` | | Soul Wars Zeal | `soulWarsZeal` | diff --git a/__tests__/hiscores.test.ts b/__tests__/hiscores.test.ts index 354ef6f..2aa2143 100644 --- a/__tests__/hiscores.test.ts +++ b/__tests__/hiscores.test.ts @@ -78,10 +78,10 @@ test('Parse CSV to json', () => { 810,99,37688883 92,99,32005622 23423,478 - 99831,23 - 89912,37 89914,35 99834,25 + 99831,23 + 89912,37 32,12148 3105,76 1997,505 @@ -177,10 +177,10 @@ test('Parse CSV to json', () => { }, leaguePoints: { rank: 23423, score: 478 }, bountyHunter: { + hunterV2: { rank: 89914, score: 35 }, + rogueV2: { rank: 99834, score: 25 }, hunter: { rank: 99831, score: 23 }, rogue: { rank: 89912, score: 37 }, - legacyHunter: { rank: 89914, score: 35 }, - legacyRogue: { rank: 99834, score: 25 } }, lastManStanding: { rank: 4814, score: 898 }, pvpArena: { rank: 13, score: 4057 }, diff --git a/src/types.ts b/src/types.ts index e25b219..e13c387 100644 --- a/src/types.ts +++ b/src/types.ts @@ -60,7 +60,7 @@ export type ClueType = export type Clues = { [Type in ClueType]: Activity }; -export type BHType = 'rogue' | 'hunter' | 'legacyRogue' | 'legacyHunter'; +export type BHType = 'rogue' | 'hunter' | 'rogueV2' | 'hunterV2'; export type BH = { [Type in BHType]: Activity }; @@ -124,10 +124,10 @@ export type Bosses = { [Type in Boss]: Activity }; export type ActivityName = | 'leaguePoints' + | 'hunterBHV2' + | 'rogueBHV2' | 'hunterBH' | 'rogueBH' - | 'hunterLegacyBH' - | 'rogueLegacyBH' | 'lastManStanding' | 'pvpArena' | 'soulWarsZeal' diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 5ccd0ce..0cb42d3 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -62,7 +62,7 @@ export const CLUES: ClueType[] = [ 'elite', 'master' ]; -export const BH_MODES: BHType[] = ['hunter', 'rogue', 'legacyHunter', 'legacyRogue']; +export const BH_MODES: BHType[] = ['hunterV2', 'rogueV2', 'hunter', 'rogue']; export const GAMEMODES: Gamemode[] = [ 'main', 'ironman', @@ -130,10 +130,10 @@ export const BOSSES: Boss[] = [ ]; export const ACTIVITIES: ActivityName[] = [ 'leaguePoints', + 'hunterBHV2', + 'rogueBHV2', 'hunterBH', 'rogueBH', - 'hunterLegacyBH', - 'rogueLegacyBH', 'allClues', 'beginnerClues', 'easyClues', @@ -259,10 +259,10 @@ export type FormattedBHNames = { }; export const FORMATTED_BH_NAMES: FormattedBHNames = { - rogue: 'Bounty Hunter - Rogue', - hunter: 'Bounty Hunter - Hunter', - legacyRogue: 'Bounty Hunter (Legacy) - Rogue', - legacyHunter: 'Bounty Hunter (Legacy) - Hunter' + rogue: 'Bounty Hunter (Legacy) - Rogue', + hunter: 'Bounty Hunter (Legacy) - Hunter', + rogueV2: 'Bounty Hunter - Rogue', + hunterV2: 'Bounty Hunter - Hunter' }; export const FORMATTED_LMS = 'Last Man Standing';