| src | ||
| .gitignore | ||
| install.sh | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| update.sh | ||
scores-board-generator
Simple Typescript script to generate a leaderboard, with scores to beat
How to use
Cloning
git clone https://git.greensky.tf/Greensky/scores-board-generator && cd scores-board-generator
Quick setup
Run ./install.sh and follow instructions
The external ip and user refer to the other machine informations
Setup
First, you need to setup a few files.
- Config folder. You need a
./configfolder. Assuming you use linux :mkdir config - Background. In order to use the config, you need to symlink a file to
./config/background.img. For instance :ln -sf ~/Downloads/Lite-Background.png ./config/background.img - Categories name. Create a
./config/categories.jsonfile containing every category. For instance, you can have :
[
"Easy",
"Hard",
"Expert"
]
- You can eventually modify the
./src/parameters/params.tsfile, if you want to tweak some values.
That is all for the setup, now see the scores part
Scores
To modify the scores, modify the ./config/scores.csv file. It must start like this :
nickname,category,score
Then, every row will contain : the nickname of the player, the category in wich he competed, being the index of one of the categories defined in setup, and his score. It does not need to be sorted, it will be sorted by the script
For instance, you can have something like this :
nickname,category,score
Alpha,0,180
Lorem,1,821
Beta,0,182
Gamma,0,145
Ipsum,1,432,
Greensky,2,2341
Pi,2,3141592
Then you can run the script
Run
For the first run, use yarn launch, afterwards you can run yarn start
The image will be outputed in ./out.png
Remote update
Use the ./update.sh script