Before we get started, this is a modified ojsama version to calculate Akatsuki's Relax PP Otherwise, everything is working like ojsama :)
this is free and unencumbered software released into the public
domain. refer to the attached UNLICENSE or http://unlicense.org/
pure javascript implementation of
https://github.com/Francesco149/oppai-ng intended to be easier
to use and set up for js developers as well as more portable
than straight up bindings at the cost of some performance
installation:
since this is a single-file library, you can just drop the file
into your project:
cd my/project curl https://waa.ai/ojsama > rx-akatsuki-pp.js
it's also available as a npm package:
npm install rx-akatsuki-pp
you can find full documentation of the code at
http://hnng.moe/stuff/ojsama.html or simply read rx-akatsuki-pp.js
usage (nodejs):
(change ./rx-akatsuki-pp to rx-akatsuki-pp if you installed through npm)
var readline = ; var osu = ; var parser = ; readline ;
$ curl https://osu.ppy.sh/osu/67079 | node minexample.js 133.24 pp
advanced usage (nodejs with acc, mods, combo...):
var readline = ; var osu = ; var mods = osumodbitsnone; var acc_percent; var combo; var nmiss; // get mods, acc, combo, misses from command line arguments // format: +HDDT 95% 300x 1m var argv = processargv; for var i = 2; i < argvlength; ++i if argvi mods = osumodbits; else if argvi acc_percent = ; else if argvi combo = ; else if argvi nmiss = ; var parser = ; readline ;
$ curl https://osu.ppy.sh/osu/67079 | node example.js TERRA - Tenjou no Hoshi ~Reimeiki~ [BMax] mapped by ouranhshc AR5 OD8 CS4 HP8 262 circles, 69 sliders, 5 spinners 469 max combo 4.33 stars 100.00% 0x100 0x50 0xmiss 469/469x 133.24 pp $ curl https://osu.ppy.sh/osu/67079 \ | node example.js +HDDT 98% 400x 1m ... +HDDT 6.13 stars 97.92% 9x100 0x50 1xmiss 400/469x 266.01 pp