forked from osufx/catch-the-pp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.py
executable file
·30 lines (25 loc) · 1000 Bytes
/
sample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
from osu_parser.beatmap import Beatmap
from osu.ctb.difficulty import Difficulty
from ppCalc import calculate_pp
if len(sys.argv) <= 1:
with open("test.osu") as file:
beatmap = Beatmap(file.read()) #Yes... this be my test file (Will remove when project is done)
else:
with open(sys.argv[1]) as file:
beatmap = Beatmap(file.read())
if len(sys.argv) >= 3:
mods = int(sys.argv[2])
else:
mods = 0
difficulty = Difficulty(beatmap, mods)
print("Calculation:")
print("Stars: {}, PP: {}, MaxCombo: {}\n".format(difficulty.star_rating, calculate_pp(difficulty, 1, beatmap.max_combo, 0), beatmap.max_combo))
"""
m = {"NOMOD": 0, "EASY": 2, "HIDDEN": 8, "HARDROCK": 16, "DOUBLETIME": 64, "HALFTIME": 256, "FLASHLIGHT": 1024}
for key in m.keys():
difficulty = Difficulty(beatmap, m[key])
print("Mods: {}".format(key))
print("Stars: {}".format(difficulty.star_rating))
print("PP: {}\n".format(calculate_pp(difficulty, 1, beatmap.max_combo, 0)))
"""