Skip to content

A nodeJS program to control a game using Youtube Chat

Notifications You must be signed in to change notification settings

XLuma/YoutubePlays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YoutubePlays

A nodeJS program to control a game using Youtube Chat. Works the same way as Twitch Plays programs, without using Google's shitty API (no limitations !)

Setup

  • Clone the repository (or download with the green button)
  • Install NodeJS (version 16 and up)
  • Open a terminal, and use the cd command with the path to access the folder containing the project. example: cd C:/Users/XLuma/Desktop/YoutubePlays (hint: you can right click the folder selector in Window's file explorer, and copy the path as text and paste it)
  • In your terminal, run npm install. It may take a couple minutes to finish.
  • Run npx tsc --p tsconfig.json. A new file main.js will be created.
  • Edit the file in the config folder to your liking, and configure your game's button mapping.
  • Run node main.js.
  • Soon messages will start appearing in the terminal, this is your chat. Configure your game's input, leave the window in focus, and sit back :)

Making the program receive messages faster

Because the program is essentially fetching messages the same way a normal viewer would, sometimes the program will hang a bit before receiving more data (about a couple seconds). This might break the immersion. To fix this, a patch is included that when applied, virtually makes the program 20x faster. I highly recommend this, but be warned it will also consume a lot more bandwidth. This should not be an issue for most people, unless you have slow internet or plan to run this on a server (which you shouldnt). To apply the patch, simply open a terminal in the project's directory, and run these commands:

  • npx patch-package
  • npx tsc --p tsconfig.json
  • node main.js

Config

A configuration file is present in the config folder. This file allows you to change a few settings like the message/button mapping, live id's and such. Here is a table:

liveId: Before starting the program, paste your liveId in this field. It will be used at startup to fetch messages.
streamerName: Type your YOUTUBE username in this field. In doing so, you can type "control" in chat to switch between chat control or your control
delayStartButton: Set to false by default. Set it to true if you want to apply a restriction on the start button to avoid chat spamming start and doing shit.
buttons: This is the message and button layout. Editing the left side allows to edit messages to analyze (must be lowercase), the right side if to set which keys should be pressed when the associated message is processed.

TODO

  • Add configuration files for button layouts and other important settings(High prio, getting it done asap) DONE
  • Add options to configure how many messages to process, the timing per batch... Controlling the chat chaos essentially (High prio)
  • Integrate the whole thing with Truffle.vip
  • Try and include a patch that removes the modifications
  • Joysticks ?? (unlikely)

Credits

About

A nodeJS program to control a game using Youtube Chat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published