A Twitch Plays Code. Connect to your channel and play! Coded in Python!
In order to get started. Open the "Twitch_Control.py" script in an editor, define your channel and allowed controls, and save! Then run this file! This is the only file you need to run. Be sure all three scripts are in the same directory!
(You may need to install the dependencies!!!) --> See the package imports.
This code handles the connection to Twitch. You should not need to edit this code at all! Logs into a twitch channel anonymously using JustinFan### account generation
The main code used to define inputs and your channel. A few things to do here:
TWITCH_CHANNEL = 'enterchannelhere' # Define the twitch channel [ Replace with you twitch channel in lowercase ]
Within the Twitch_Control.py script, there is this variable. Change the 'enterchannelhere' part with your channel name (in lowercase letters).
Example:
TWITCH_CHANNEL = 'xqcow'
There will be a section where you can define commands. There are three different types of commands you can use:
This will let you define a key to hold and a time to hold it! Follow this syntax:
Example:
HoldAndReleaseKey(W, 2) ## This will hold the W key for 2 second
You can find a list of useable keys in the Twitch_KeyCommands.py script!
This will hold the key indefinitely. Define the key only
Example:
HoldKey(w) ## This will hold the W key
This will Release any previously held Key. Use in conjunction with the HoldKey() function
Example:
ReleaseKey(w) ## This will release the W key
This script holds all the available key commands you can program. I will update this with the full keyboard soon.