Code Monkey home page Code Monkey logo

haxballparser's Introduction

HaxballParser

Parses Haxball replays and outputs them in a human readable format.

Python port of https://github.com/jonnyynnoj/haxball-replay-parser


Installation

python setup.py install

Usage

Make sure Scripts/ is in PATH
haxballparser # Will parse hbr files in current directory
haxballparser C:/Path/to/folder/with/hbr/files/
haxballparser C:/Path/to/hbr/file/

Embedding

from HaxballParser import dump
file = "C:/Path/to/file"
dumpresp = dump(file)
dumpraw = dumpresp.result
prettyres = dumpresp.prettify()

Short example of a result (dumpraw):

{'Version': 12,
 'Replay length': '00:18:02',
 'Room Name': 'POATTAO RUSLTERS SEALS',
 'Locked': True,
 'Score Limit': 0,
 'Time Limit': 7,
 'Red score': 0,
 'Blue score': 0,
 'Current match time': '00:00:00',
 'Paused': False,
 'Stadium': 'Big Easy',
 'In progress': True,
 'Players': [Player(ID=2, name=scotta\a, country=us, team=Spectator, admin=True, avatar=o7),
             Player(ID=13, name=qt stream, country=us, team=Spectator, admin=False, avatar=:),
             Player(ID=8, name=texas, country=us, team=Blue, admin=False, avatar=yo),
             ...],
 'Actions': [Action(time=00:00:00, senderID=6, action=playerChat, parsed=Said: GL DIAF),
             Action(time=00:00:00, senderID=15, action=playerChat, parsed=Said: I will type),
             ...]}

Short example of a pretty output (prettyres):

REPLAY INFO
  Version 12
  Length: 00:18:02

ROOM INFO
  Room name: POATTAO RUSLTERS SEALS
  Scores: Red 0 - 0 Blue
  Time limit: 7 - Score limit: 0
  Current match time: 00:00:00
  Match in progress: True

PLAYERS LIST
  Red:
    Prizzle
    Ben Roethlisberger
    Justin (-09)
    trololo
  Blue:
    texas
    {c}row 
    dr feli
    yew
  Spectators:
    scotta\a
    qt stream
    GReddy
    Scooter
  Throughout the replay:
    Joined:
      tgfp
    Left/Kicked/Banned:
      tgfp

ACTION LIST
(00:00:00) Ben Roethlisberger -> Said: GL DIAF
(00:00:00) Justin (-09) -> Said: I will type
(00:00:01) scotta\a -> Said: good luck
(00:00:01) Ben Roethlisberger -> Said: HARF HARF HARF
...

haxballparser's People

Contributors

ivanfeli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.