🎮 Lets you use IRC to send inputs to a program and stream it, Twitch Plays Pokemon style. (Windows, Linux, OSX)
Switch branches/tags
Nothing to show
Clone or download
Latest commit 3fa4b21 Feb 13, 2018


Twitch Plays X

(inspired by TwitchPlaysPokemon)

Lets you use IRC to send inputs to a program and stream it, TwitchPlaysPokemon style.

Tested on Windows 8, Ubuntu 13.10. Should work on a Mac as well - just change the config file.

on Windows, the program has to be focused in order to send keyboard inputs so you won't be able to use your computer at the same time unless you run the program in a virtual machine.

In Action

Pokemon Red running in a Ubuntu 13.10 VM


https://github.com/hzoo/ChatPlays/ used MutationObservers in the browser

Using IRC lets you get all the messages; you can't always get all messages through the browser (quickly or consistently) so this is a better approach overall as others have done.

Installation (node, etc)

If Linux

# node.js: can use nvm, apt-get, the ppa below, or https://nodejs.org/download/
sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
# repo
git clone https://github.com/hzoo/TwitchPlaysX.git
cd TwitchPlaysX
# node packages (irc, printf)
npm install
# xdotool or go to http://www.semicomplete.com/projects/xdotool/
apt-get install xdotool

If Windows


Create config.json

  • CONFIG_PROGRAM_NAME: Find out the title of the window
    • Ex: VisualBoyAdvance, Desmume
      • for notepad.exe it would be "Notepad" or "Untitled - Notepad"

Create a config.json file (to store your twitch name and oauth token) go to http://www.twitchapps.com/tmi to get your token

More explanations of the config options in the config.js file

// example config.json
// you can also set the environment variables in node (for heroku)
    "CONFIG_OS": "windows",
    "CONFIG_SEND_KEY": true,

Running It!

Setup Program

  • Open program to send keys to (VisualBoyAdvance, Desmume)
  • Optionally, change the controls (in the program itself, defaultKeyMap in keyHandler.js, keys.py for windows)
  • Optionally, find the option to allow program to receive background inputs (linux)

Run Server

# go to the root folder, make sure you did `npm install`, then
npm start


  • Connect to IRC
  • Use regex to match for certain commands
    • print out username/message
  • Hook up to a program/emulator
    • if on windows: probably uses the win32 api
      • window has to take focus
    • otherwise: xdotool
  • Stream it!


Feel free to give suggestions or report bugs