Skip to content

Yardanico/nim-osureplay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osureplay, a parser for osu replays in Nim Build Status

This is a parser for osu! rhythm game replay files as described by https://osu.ppy.sh/wiki/Osr_(file_format).

Originally this parser was ported from this Python replay parser

Installation

To install osureplay, simply run:

$ nimble install osureplay

Documentation

To parse a replay from a filepath:

import osureplay

let replay = parseReplayFile("replay.osr")

To parse a replay from a string which contains replay data:

import osureplay

let replay = parseReplay(data)

Replay objects provide these fields

replay.gameMode # GameMode enum
replay.gameVersion # Integer
replay.beatmapHash # String
replay.playerName # String
replay.replayHash # String
replay.number300s # Integer
replay.number100s # Integer
replay.number50s # Integer
replay.gekis # Integer
replay.katus # Integer
replay.misses # Integer
replay.score # Integer
replay.maxCombo # Integer
replay.isPerfectCombo # Boolean
replay.mods # set of Mods
replay.lifeBarGraph # String, unparsed as of now
replay.timestamp # TimeInfo object
replay.playEvents # Sequence of ReplayEvent tuples

ReplayEvent tuples provide these fields

event.timeSincePreviousAction # Integer representing time in milliseconds
event.x # X axis location
event.y # Y axis location
event.keysPressed # Bitwise sum of keys pressed, documented in OSR format page.
event.timestamp # Absolute timestamp (from replay start)