Skip to content

Python app to allow TikTok live viewers to control Gameboy games

License

Notifications You must be signed in to change notification settings

IvanVeridian/LiveStreamGamer

Repository files navigation

TikTok Live Gaming Integration

This repository contains a set of Python scripts designed to integrate TikTok Live streaming with a PyBoy Gameboy emulator, allowing for interactive game sessions through TikTok comments.

Description

The project is structured into several key components:

  1. tiktokclient.py: Connects to a TikTok Live session and listens for events such as comments, likes, and gifts. It sends specific commands to the PyBoy emulator based on these interactions.

  2. server_pyboy.py: A server that receives commands from the TikTok client and processes them in the PyBoy emulator to simulate game actions.

  3. mock_tiktokclient.py: A mock implementation of the TikTok client for testing purposes without connecting to an actual live session.

  4. mock_server_pyboy.py: Similar to server_pyboy.py but designed for use with the mock TikTok client.

  5. mockcomment_client.py: Used to simulate a live TikTok session by sending comments to the TikTok client.

  6. main_gui_mock.py: A GUI application to control and configure the mock setup, allowing users to define the PyBoy ROM location and simulate comments through an interactive interface.

  7. main_gui.py: A GUI application to control and configure the live setup.

Requirements

  • Python 3.x
  • PyBoy emulator
  • TikTokLive Python library
  • asyncio, socket, threading, logging, queue libraries
  • tkinter (for GUI)

Setup and Usage

  1. Setting up the environment:

    • Ensure Python 3.x is installed.
    • Install required Python libraries:
      pip install -r requirements.txt
  2. Running Main Gui for Live:

    • Run main_gui.py to start listening to a live TikTok session.
    • Ensure to complete the config setup, under the config button.
  3. Testing with Mock Client Using GUI:

    • Use main_gui_mock.py for a GUI-based interface to run and control the mock setup.
    • Run the GUI script using:
      python main_gui.py
    • In the GUI, use the "Config" button to select the PyBoy ROM file.
    • Start the server and client processes through the GUI buttons.
    • Simulate comments directly from the GUI.

GUI Instructions

  1. Start the GUI:

    • Run python main_gui_mock.py or python main_gui.py to start the GUI application.
  2. Config Setup:

    • Click on the "Config" button to open the configuration window.
    • Browse and select the PyBoy ROM file location.
    • Enter tiktok username if using main_gui, pull the username from their main profile page (@username without the @ symbol)
  3. Starting and Stopping the Server:

    • Use the "Start Server" button to start the mock server and client processes.
    • Use the "Stop Server" button to stop all running processes.
  4. Submitting Comments:

    • Enter a comment in the input field and click "Submit" to send the comment.
    • The submitted comments and server outputs will be displayed in the output area.

Screenshots

Example using a streamer and configuing the app to connect to that streamer's session. Note, Midnight club and the pyboy game are unrelated. This is just an example of how you would set it up and what you see in the GUI. image unnamed

Contributing

Feel free to fork this repository and contribute to the development. Pull requests are welcome.

License

MIT

Shoutouts

Huge thanks to the developers of Pyboy and TikTokLive. It's due to their foundation that this project was made possible.

About

Python app to allow TikTok live viewers to control Gameboy games

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages