mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
added all deadman modes, getHiscores returns dead bool for hardcores
This commit is contained in:
@@ -29,6 +29,9 @@ Regular | `main`
|
||||
Ironman | `iron`
|
||||
Hardcore Ironman | `hc`
|
||||
Ultimate Ironman | `ult`
|
||||
Deadman Mode | `dmm`
|
||||
Seasonal Deadman | `sdmm`
|
||||
DMM Tournament | `dmmt`
|
||||
|
||||
`getHiscores` requires a game mode and optionally a category and page:
|
||||
```javascript
|
||||
|
@@ -3,6 +3,9 @@ const URLs = {
|
||||
iron: 'http://services.runescape.com/m=hiscore_oldschool_ironman/',
|
||||
ult: 'http://services.runescape.com/m=hiscore_oldschool_ultimate/',
|
||||
hc: 'http://services.runescape.com/m=hiscore_oldschool_hardcore_ironman/',
|
||||
dmm: 'http://services.runescape.com/m=hiscore_oldschool_deadman/',
|
||||
sdmm: 'http://services.runescape.com/m=hiscore_oldschool_seasonal/',
|
||||
dmmt: 'http://services.runescape.com/m=hiscore_oldschool_tournament/',
|
||||
stats: 'index_lite.ws?player=',
|
||||
scores: 'overall.ws?'
|
||||
},
|
||||
@@ -44,7 +47,7 @@ const URLs = {
|
||||
'masterclues'
|
||||
]
|
||||
},
|
||||
validModes = ['full', 'main', 'iron', 'hc', 'ult']
|
||||
validModes = ['full', 'main', 'iron', 'hc', 'ult', 'dmm', 'sdmm', 'dmmt']
|
||||
|
||||
async function getStats (rsn, mode = 'full') {
|
||||
if(typeof rsn !== 'string') {
|
||||
@@ -205,6 +208,10 @@ async function getHiscoresPage(mode, category, page) {
|
||||
xp: attributes[3].innerHTML.slice(1, -1)}, playerInfo) :
|
||||
playerInfo.score = attributes[2].innerHTML.slice(1, -1)
|
||||
|
||||
if(mode === 'hc') {
|
||||
playerInfo.dead = attributes[1].childElementCount > 1
|
||||
}
|
||||
|
||||
players.push(playerInfo)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user