python osu! replay helper
Go to file
Emily 088674041a Dont use scuffed method
it makes no sense to do what I did before
2019-09-01 13:44:47 +00:00
osuRepy Dont use scuffed method 2019-09-01 13:44:47 +00:00
.gitignore README 2019-03-13 10:59:06 +01:00
LICENSE Initial commit 2019-03-13 04:42:11 +00:00
README.md Update 'README.md' 2019-08-25 15:39:04 +00:00
test.py Fixed replay length (it is not ULEB) 2019-03-17 02:57:48 +01:00

osu-repy

osu! replay helper in python

Sample

from osuRepy.frame import ReplayFrame # ReplayFrame
from osuRepy.replay import Replay # Replay instance

from osuRepy.helpers import osuButtons, osuMods # Enum helpers

replay = Replay(beatmap_hash = "9e66c0a0eadced7d07f06b3968a74cc0") # Create replay instance

replay.write( ReplayFrame(2, 256, 192, osuButtons.M1) ) # Add replay frame (time, x, y, buttons)

replay.set_score(score = 29284624,
		s300 = 416,
		s50 = 2,
		miss = 1,
		combo = 358) # Set score info

replay.set_mods(osuMods.HIDDEN | osuMods.DOUBLETIME) # Enable HDDT mods
replay.set_timestamp(1552466941) # Set unix timestamp

replay.save("myReplay.osr") # Export replay to file

Enums (from helpers)

osuButtons

Name Value
NONE 0
LEFTMOUSE 1
RIGHTMOUSE 2
LEFTKEY 4
RIGHTKEY 8
SMOKE 16
M1 1
M2 2
K1 5
K2 10

osuModes

Name Value
STANDARD 0
TAIKO 1
CATCH_THE_BEAT 2
MANIA 3

osuMods

Name Value
NOMOD 0
NOFAIL 1
EASY 2
TOUCHSCREEN 4
HIDDEN 8
HARDROCK 16
SUDDENDEATH 32
DOUBLETIME 64
RELAX 128
HALFTIME 256
NIGHTCORE 512
FLASHLIGHT 1024
AUTOPLAY 2048
SPUNOUT 4096
AUTOPILOT 8192
PERFECT 16384
KEY4 32768
KEY5 65536
KEY6 131072
KEY7 262144
KEY8 524288
KEYMOD 1048576
FADEIN 2097152
RANDOM 4194304
LASTMOD 8388608
KEY9 16777216
KEY10 33554432
KEY1 67108864
KEY3 134217728
KEY2 268435456
SCOREV2 536870912

osuRanks

Name Value
SSH 0
SH 1
SS 2
S 3
A 4
B 5
C 6
D 7
F 8
N 9

(We dont speak of typeSerializer)

Tips

if you.style is 'passing arrays of information':
frames = [
	ReplayFrame(0, 256, 192, osuButtons.NONE),
	ReplayFrame(8, 258, 191, osuButtons.NONE),
	ReplayFrame(13, 257, 198, osuButtons.M1 | osuButtons.SMOKE)
]

replay = Replay()
replay.write( frames )