Skip to content

🎮 Lets you use IRC to send inputs to a program and stream it, Twitch Plays Pokemon style. (Windows, Linux, OSX)

License

Notifications You must be signed in to change notification settings

bef0re/TwitchPlaysX

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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

####Misc#### 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###

Setup

###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)
{
    
    "TWITCH_OAUTH": "OAUTH_HERE",
    "TWITCH_USERNAME": "TWITCH_NAME_HERE",
    "TWITCH_CHANNEL": "#CHANNEL_HERE",
    "CONFIG_OS": "windows",
    "CONFIG_PROGRAM_NAME": "VBA",
    "CONFIG_MAX_CHAR_NAME": 8,
    "CONFIG_MAX_CHAR_COMMAND": 20,
    "CONFIG_SEND_KEY": true,
    "CONFIG_FILTERED_COMMANDS": [],
    "CONFIG_THROTTLED_COMMANDS": []
}

##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

##Method##

  • 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!

Contributions

Feel free to give suggestions or report bugs

About

🎮 Lets you use IRC to send inputs to a program and stream it, Twitch Plays Pokemon style. (Windows, Linux, OSX)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.3%
  • Python 10.7%