Highscores command line tool

I’ve been playing around with a python command line tool that I’d thought I share with people. My initial desire was to compare players but also wanted to be able to track players and compare specific account builds.

https://gitlab.com/limeysardine/lostcity.hs/-/blob/release/0001/04hs.py?ref_type=heads

It’s quick and dirty but others might find it useful.

Quickstart with python and python venv

$ git clone [email protected]:limeysardine/lostcity.hs.git
$ cd lostcity.hs
$ git switch release/0001
$ python -m venv .venv
$ . .venv/bin/activate
$ pip install --upgrade pip requests colorama
$ python 04hs.py --help
usage: 04hs.py [-h] [–api-url API_URL] {lookup,compare,trends,rankings,populate,update,account-types,skills} …

RuneScape 2004 Highscore CLI Tool

positional arguments:
{lookup,compare,trends,rankings,populate,update,account-types,skills}
Available commands
lookup Lookup a player’s stats
compare Compare two players
trends Show player trends over time
rankings Show rankings from saved data
populate Populate database by paging through API
update Update all existing players with fresh data
account-types List all account types
skills List all skills with their IDs

options:
-h, --help show this help message and exit
–api-url API_URL Base URL for the API (default: https://2004.lostcity.rs)

Examples:
04hs.py lookup PlayerName
04hs.py compare Player1 Player2
04hs.py trends PlayerName
04hs.py trends PlayerName --start “2024-01-01” --end “2024-12-31”
04hs.py trends PlayerName --start “2024-01-01 12:00” --show-levels
04hs.py rankings
04hs.py rankings --skill Attack --types “Skiller” “Defence Pure”
04hs.py rankings --skill 1 --limit 50
04hs.py rankings --skill Overall --sort-by-xp
04hs.py rankings --skill Attack --types “One-defence pure” --sort-by-xp --limit 30
04hs.py lookup PlayerName --no-save
04hs.py populate --skill Overall --max-pages 10 --delay 0.5
04hs.py populate --skill Attack --max-pages 5 --no-skip-existing
04hs.py update --delay 0.5
04hs.py update --types “Skiller” “Defence Pure”
04hs.py update --types “One-defence pure” --delay 2.0
04hs.py update --order-by total_xp --limit 50
04hs.py update --order-by total_level --types “Skiller” --limit 20
04hs.py update --order-by skill --skill Attack --limit 10
04hs.py account-types
04hs.py skills

The idea is that after you lookup whoever you want to track you have a local json that you can update as needed or just use it for one offs.

In the future I might add some actual python project structure and put it into pypi but for now it’s good enough as a script.

Example compare

$ python 04hs.py compare dog buckodabo

Ranking and Trends are based on local JSON data.

3 Likes