Git Product home page Git Product logo

comment-game-controller's Introduction


Comment Game Controller 🎮

Plays games from live stream user comments!

Python script to control games using YouTube and TikTok comments

DescriptionPrerequisitesImportant InformationSetupHow To UseContributingLicenseDisclaimer

Description

This Python script allows you to control games, such as Pokémon, using comments from YouTube and TikTok videos. It captures the comments from both platforms and maps them to keypresses that are then used to control the game.

Prerequisites

To clone and run this application, you'll need -

  • Python 3.6 or higher
  • keyboard library

pip install keyboard

  • TikTokLive library

pip install TikTokLive

  • pytchat library

pip install pytchat

Important Information

  • The script uses the keyboard library to simulate keypresses. Ensure that the game you want to control is compatible with keypress inputs.

  • The script utilizes the TikTokLive library to capture TikTok comments and the pytchat library to capture YouTube comments.

  • Comments containing the specified key events ("up", "down", "left", "right", "a", "b") will be detected and used for game control.

Setup

  1. Clone the repository or download the script file to your local machine.

git clone https://github.com/maddox05/Comment-Game-Controller.git

  1. Install the required libraries using the commands mentioned in the "Prerequisites" section.

How To Use

  1. Run the script using the command python game_controller.py

  2. If you want to use comments from

    • TikTok -

      • Obtain the TikTok username that you want to use for the live comments. Enter it when prompted by the script.
    • YouTube -

      • Provide the URL of the YouTube video (End ID) that you want to capture comments from. Enter it when prompted by the script.
  3. The script will start capturing comments from chosen platforms.

  4. Whenever a comment containing a specific key event (e.g., "up", "down", "left", "right", "a", "b") is detected, the corresponding key will be simulated as a keypress.

  5. The simulated keypress will be sent to the game, allowing you to control it using the comments.

  6. The script will display the name of the user and the comment for each detected key event.

Note: Make sure the game window is active and in focus while running the script for the keypresses to be recognized correctly.

Contributing

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

License

Apache License 2.0

Disclaimer

This script is provided as-is, without any warranty or guarantee. Use it at your own risk. The author is not responsible for any damages or consequences caused by using this script.

Note: Please ensure that you comply with the terms of service of YouTube and TikTok when using this script.


GitHub @maddox05

comment-game-controller's People

Contributors

maddox05 avatar nirvanaruns avatar sahil-kumar-ee 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.