Skip to content

Commit ffa6b65

Browse files
authored
Feat: Necromancy, Sailing, missing hiscores endpoints (#72)
Feat: Necromancy, Sailing, missing hiscores endpoints, this PR introduces the following changes: **RS3:** - Necromancy Skill - Leagues hiscores endpoint **OSRS:** - Sailing Skill - Tournaments hiscores endpoint - Fresh Start Worlds hiscores endpoint - Grid points to activities - Deadman points to activities - Legacy bounty hunter points to activities - PvP Arena to activities - Soul Wars to activities - GOTR rifts closed to activities - Colosseum Glory to activities - Collections logged to activities - Bosses: - Amoxliatl - Araxxor - Artio - Cal Varion - Doom of Mokhaiotl - Duke Sucellus - Nex - Phosanis_Nightmare - Phantom Muspah - Scurrius - Shellbane Gryphon - Sol Heredit - Spindel - Tempeross - The Hueycoatl - The Leviathan - The Royal Titans - The Whisperer - Theatre of Blood Hard Mode - Tombs of Amascut - Tombs of Amascut: Expert Mode - Vardorvis - Yama - Brutus
1 parent b4b4202 commit ffa6b65

File tree

5 files changed

+99
-3
lines changed

5 files changed

+99
-3
lines changed

src/__tests__/oldschool/hiscores.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,18 @@ test("Fetch ultimate ironman player by name (string)", async () => {
3030
expect(data).toBeDefined()
3131
expect(data).toBeInstanceOf(Player)
3232
})
33+
})
34+
35+
test("Fetch tournament player by name (string)", async () => {
36+
return hiscores.getPlayer("240", "tournament").then(data => {
37+
expect(data).toBeDefined()
38+
expect(data).toBeInstanceOf(Player)
39+
})
40+
})
41+
42+
test("Fetch fresh start world player by name (string)", async () => {
43+
return hiscores.getPlayer("Gulag", "fresh_start").then(data => {
44+
expect(data).toBeDefined()
45+
expect(data).toBeInstanceOf(Player)
46+
})
3347
})

src/__tests__/runescape/hiscores.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,11 @@ test("Fetch hardcore player by name (string)", async () => {
2020
expect(data).toBeDefined()
2121
expect(data).toBeInstanceOf(Player)
2222
})
23+
})
24+
25+
test("Fetch Leagues player by name (string)", async () => {
26+
return hiscores.getPlayer("Astrect", "leagues").then(data => {
27+
expect(data).toBeDefined()
28+
expect(data).toBeInstanceOf(Player)
29+
})
2330
})

src/configs/oldschool.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ export const hiscores = {
66
ultimate: `http://services.runescape.com/m=hiscore_oldschool_ultimate/index_lite.ws?player=`,
77
deadman: `http://services.runescape.com/m=hiscore_oldschool_deadman/index_lite.ws?player=`,
88
seasonal: `http://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws?player=`,
9+
tournament: `http://services.runescape.com/m=hiscore_oldschool_tournament/index_lite.ws?player=`,
10+
fresh_start: `http://services.runescape.com/m=hiscore_oldschool_fresh_start/index_lite.ws?player=`
911
},
1012
activities: [
13+
"grid_points",
1114
"league_points",
15+
"deadman_points",
1216
"bounty_hunter_hunter",
1317
"bounty_hunter_rogue",
18+
"bounty_hunter_hunter_legacy",
19+
"bounty_hunter_rogue_legacy",
1420
"clue_scrolls_all",
1521
"clue_scrolls_beginner",
1622
"clue_scrolls_easy",
@@ -19,13 +25,23 @@ export const hiscores = {
1925
"clue_scrolls_elite",
2026
"clue_scrolls_master",
2127
"last_man_standing",
28+
"pvp_arena",
29+
"soul_wars",
30+
"rifts_closed",
31+
"colosseum_glory",
32+
"collections_logged"
2233
] as const,
2334
bosses: [
2435
"abyssal_sire",
2536
"alchemical_hydra",
37+
"amoxliatl",
38+
"araxxor",
39+
"artio",
2640
"barrows_chests",
41+
"brutus",
2742
"bryophyta",
2843
"callisto",
44+
"cal_varion",
2945
"cerberus",
3046
"chambers_of_xeric",
3147
"chambers_of_xeric_challenge_mode",
@@ -38,6 +54,8 @@ export const hiscores = {
3854
"dagannoth_rex",
3955
"dagannoth_supreme",
4056
"deranged_archaeologist",
57+
"doom_of_Mokhaiotl",
58+
"duke_sucellus",
4159
"general_graardor",
4260
"giant_mole",
4361
"grotesque_guardians",
@@ -48,21 +66,38 @@ export const hiscores = {
4866
"kreearra",
4967
"kril_tsutsaroth",
5068
"mimic",
69+
"nex",
5170
"nightmare",
71+
"phosanis_nightmare",
5272
"obor",
73+
"phantom_muspah",
5374
"sarachnis",
5475
"scorpia",
76+
"scurrius",
77+
"shellbane_gryphon",
5578
"skotizo",
79+
"sol_heredit",
80+
"spindel",
81+
"tempeross",
5682
"the_gauntlet",
5783
"the_corrupted_gauntlet",
84+
"the_hueycoatl",
85+
"the_leviathan",
86+
"the_royal_titans",
87+
"the_whisperer",
5888
"theatre_of_blood",
89+
"theatre_of_blood_hard_mode",
5990
"thermonuclear_smoke_devil",
91+
"tombs_of_amascut",
92+
"tombs_of_amascut_expert_mode",
6093
"tzkal_zuk",
6194
"tztok_jad",
95+
"vardorvis",
6296
"venenatis",
6397
"vetion",
6498
"vorkath",
6599
"wintertodt",
100+
"yama",
66101
"zalcano",
67102
"zulrah",
68103
] as const,
@@ -73,6 +108,8 @@ export const hiscores = {
73108
"ultimate",
74109
"deadman",
75110
"seasonal",
111+
"tournament",
112+
"fresh_start"
76113
] as const,
77114
skills: [
78115
"overall",
@@ -99,6 +136,7 @@ export const hiscores = {
99136
"runecrafting",
100137
"hunter",
101138
"construction",
139+
"sailing"
102140
] as const,
103141
}
104142
export const grandexchange = {

src/configs/runescape.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ export const hiscores = {
272272
normal: `http://services.runescape.com/m=hiscore/index_lite.ws`,
273273
ironman: `http://services.runescape.com/m=hiscore_ironman/index_lite.ws`,
274274
hardcore: `http://services.runescape.com/m=hiscore_hardcore_ironman/index_lite.ws`,
275+
leagues: `https://secure.runescape.com/m=hiscore_leagues/index_lite.ws`
275276
},
276277
activities: [
277278
"bounty_hunters",
@@ -305,7 +306,7 @@ export const hiscores = {
305306
"clue_scrolls_elite",
306307
"clue_scrolls_master",
307308
] as const,
308-
gamemodes: ["normal", "ironman", "hardcore"] as const,
309+
gamemodes: ["normal", "ironman", "hardcore", "leagues"] as const,
309310
skills: [
310311
"overall",
311312
"attack",
@@ -336,6 +337,7 @@ export const hiscores = {
336337
"divination",
337338
"invention",
338339
"archaeology",
340+
"necromancy"
339341
] as const,
340342
}
341343
export const miscellaneous = {

src/utils/Jagex.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const defaultSkillTree: Jagex.Hiscores.PlayerSkills = {
3535
divination: { rank: 0, level: 1, experience: 0 },
3636
invention: { rank: 0, level: 1, experience: 0 },
3737
archaeology: { rank: 0, level: 1, experience: 0 },
38+
necromancy: { rank: 0, level: 1, experience: 0 },
3839
}
3940
const separateIntoLines = (jagexPlayer: string): string[] => {
4041
return jagexPlayer.split("\n")
@@ -172,6 +173,7 @@ const formatOSRSSkills = (skillsArray: string[]) => {
172173
runecrafting: { rank: 0, level: 1, experience: 0 },
173174
hunter: { rank: 0, level: 1, experience: 0 },
174175
construction: { rank: 0, level: 1, experience: 0 },
176+
sailing: { rank: 0, level: 1, experience: 0 },
175177
}
176178

177179
osrs.hiscores.skills.map((skillName, index) => {
@@ -187,9 +189,13 @@ const formatOSRSSkills = (skillsArray: string[]) => {
187189
}
188190
const formatOSRSActivities = (activitiesArray: string[]) => {
189191
const activities: Jagex.Hiscores.OSRSPlayerActivites = {
192+
grid_points: { rank: 0, count: 0 },
190193
league_points: { rank: 0, count: 0 },
194+
deadman_points: { rank: 0, count: 0 },
191195
bounty_hunter_hunter: { rank: 0, count: 0 },
192196
bounty_hunter_rogue: { rank: 0, count: 0 },
197+
bounty_hunter_hunter_legacy: { rank: 0, count: 0 },
198+
bounty_hunter_rogue_legacy: { rank: 0, count: 0 },
193199
clue_scrolls_all: { rank: 0, count: 0 },
194200
clue_scrolls_beginner: { rank: 0, count: 0 },
195201
clue_scrolls_easy: { rank: 0, count: 0 },
@@ -198,6 +204,11 @@ const formatOSRSActivities = (activitiesArray: string[]) => {
198204
clue_scrolls_elite: { rank: 0, count: 0 },
199205
clue_scrolls_master: { rank: 0, count: 0 },
200206
last_man_standing: { rank: 0, count: 0 },
207+
pvp_arena: { rank: 0, count: 0 },
208+
soul_wars: { rank: 0, count: 0 },
209+
rifts_closed: { rank: 0, count: 0 },
210+
colosseum_glory: { rank: 0, count: 0 },
211+
collections_logged: { rank: 0, count: 0 },
201212
}
202213

203214
osrs.hiscores.activities.map((activityName, index) => {
@@ -211,9 +222,14 @@ const formatOSRSBosses = (activitiesArray: string[]) => {
211222
const bosses: Jagex.Hiscores.OSRSPlayerBosses = {
212223
abyssal_sire: { rank: 0, count: 0 },
213224
alchemical_hydra: { rank: 0, count: 0 },
225+
amoxliatl: { rank: 0, count: 0 },
226+
araxxor: { rank: 0, count: 0 },
227+
artio: { rank: 0, count: 0 },
214228
barrows_chests: { rank: 0, count: 0 },
229+
brutus: { rank: 0, count: 0 },
215230
bryophyta: { rank: 0, count: 0 },
216231
callisto: { rank: 0, count: 0 },
232+
cal_varion: { rank: 0, count: 0 },
217233
cerberus: { rank: 0, count: 0 },
218234
chambers_of_xeric: { rank: 0, count: 0 },
219235
chambers_of_xeric_challenge_mode: { rank: 0, count: 0 },
@@ -226,6 +242,8 @@ const formatOSRSBosses = (activitiesArray: string[]) => {
226242
dagannoth_rex: { rank: 0, count: 0 },
227243
dagannoth_supreme: { rank: 0, count: 0 },
228244
deranged_archaeologist: { rank: 0, count: 0 },
245+
doom_of_Mokhaiotl: { rank: 0, count: 0 },
246+
duke_sucellus: { rank: 0, count: 0 },
229247
general_graardor: { rank: 0, count: 0 },
230248
giant_mole: { rank: 0, count: 0 },
231249
grotesque_guardians: { rank: 0, count: 0 },
@@ -236,21 +254,38 @@ const formatOSRSBosses = (activitiesArray: string[]) => {
236254
kreearra: { rank: 0, count: 0 },
237255
kril_tsutsaroth: { rank: 0, count: 0 },
238256
mimic: { rank: 0, count: 0 },
257+
nex: { rank: 0, count: 0 },
239258
nightmare: { rank: 0, count: 0 },
259+
phosanis_nightmare: { rank: 0, count: 0 },
240260
obor: { rank: 0, count: 0 },
261+
phantom_muspah: { rank: 0, count: 0 },
241262
sarachnis: { rank: 0, count: 0 },
242263
scorpia: { rank: 0, count: 0 },
264+
scurrius: { rank: 0, count: 0 },
265+
shellbane_gryphon: { rank: 0, count: 0 },
243266
skotizo: { rank: 0, count: 0 },
267+
sol_heredit: { rank: 0, count: 0 },
268+
spindel: { rank: 0, count: 0 },
269+
tempeross: { rank: 0, count: 0 },
244270
the_gauntlet: { rank: 0, count: 0 },
245271
the_corrupted_gauntlet: { rank: 0, count: 0 },
272+
the_hueycoatl: { rank: 0, count: 0 },
273+
the_leviathan: { rank: 0, count: 0 },
274+
the_royal_titans: { rank: 0, count: 0 },
275+
the_whisperer: { rank: 0, count: 0 },
246276
theatre_of_blood: { rank: 0, count: 0 },
277+
theatre_of_blood_hard_mode: { rank: 0, count: 0 },
247278
thermonuclear_smoke_devil: { rank: 0, count: 0 },
279+
tombs_of_amascut: { rank: 0, count: 0 },
280+
tombs_of_amascut_expert_mode: { rank: 0, count: 0 },
248281
tzkal_zuk: { rank: 0, count: 0 },
249282
tztok_jad: { rank: 0, count: 0 },
283+
vardorvis: { rank: 0, count: 0 },
250284
venenatis: { rank: 0, count: 0 },
251285
vetion: { rank: 0, count: 0 },
252286
vorkath: { rank: 0, count: 0 },
253287
wintertodt: { rank: 0, count: 0 },
288+
yama: { rank: 0, count: 0 },
254289
zalcano: { rank: 0, count: 0 },
255290
zulrah: { rank: 0, count: 0 },
256291
}
@@ -274,8 +309,8 @@ export const parseJagexOSRSPlayerToJSON = (
274309
const [bossesStartIndex, bossesEndIndex] = [
275310
osrs.hiscores.skills.length + osrs.hiscores.activities.length,
276311
osrs.hiscores.skills.length +
277-
osrs.hiscores.activities.length +
278-
osrs.hiscores.bosses.length,
312+
osrs.hiscores.activities.length +
313+
osrs.hiscores.bosses.length,
279314
]
280315

281316
const activities = formatOSRSActivities([

0 commit comments

Comments
 (0)