Skip to content

valknight/livesplit-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveSplit-Python

LiveSplit-Python is a Python library for communicating with LiveSplit Server.

Requirements

The latest dev builds of Livesplit come with LiveSplit server pre-packaged. Otherwise, follow the instructions here to install LiveSplit server.

Once it's installed, add it to your Livesplit layout, and right click LiveSplit, go to "Control" and click "Start Server".

Installation

Use the package manager pip to install LiveSplit-Python.

pip install livesplit

Usage

Example

import livesplit
import time

# Create our livesplit object
# On connection, your timer won't be reset by default
# To read more, take a look at options later.

l = livesplit.Livesplit()

# Start our timer

l.startTimer()
l.startGameTimer()

# Wait one second
time.sleep(1)

# Stop the game timer 1 second in
l.pauseGameTimer()

time.sleep(1)

# Stop the timer
l.pause()

# Wait one second again
time.sleep(1)

# Reset the timer

l.reset()

Commands

Supported commands are as followed:

  • pauseGameTimer
  • startGameTimer
  • initGameTimer
  • startTimer
  • startOrSplit
  • split
  • unsplit
  • skipSplit
  • pause
  • resume
  • reset

Helpers

  • setupGameTimer

This will initialise the game timer, then immediately pause it to stop it from running. Helps if you are going to be using it, just, later!

Livesplit Parameters

Parameter Type Description Default
ip String IP address / hostname the Livesplit Server can be located at. "127.0.0.1"
port Integer Port that the Livesplit Server is listening on. 16834
reset Boolean Whether to reset the timer when creating this object False
setupGameTimer Boolean Whether to setup and pause the game timer when creating this object. Value of reset

Projects using LiveSplit-Python

Using LiveSplit-Python yourself? Make a PR, and add it here!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT license. To read more, open up the license file.

About

Livesplit-python is a Python library for communicating with Livesplit Server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages