More documentation in the central wiki.
The script that allows controlling of a pc remotely through a Twitch chat. Started as an overhaul update to DougDoug TwitchPlays script.
(Note: It is recommended that you know how to use the Terminal of your OS and that you have basic knowledge of the Git CLI.)
-
In order to run you must download a 3.X.X version of Python (https://www.python.org/downloads/). The script is normally run on python version
3.8
-3.9
. The current recommended python version runtime.txt using the heroku style. -
To install you can either do one of 2 things.
- Clone using Git
- Download the Zip file
- After downloading open a terminal of your choice, and run these commands to install the script's dependencies (using a virtualenv or other virtual environment can be a good idea)::
python -m pip install --upgrade pip wheel
python -m pip install -r requirements.txt
-
Create
config/config.toml
based onconfig/config.example.toml
with your Twitch username, oauth key, and other info and settings. (you can generate a blank config.toml withconfig/create_empty_config.py
and get a Twitch oauth token withnew_oauth_key.py
). -
Run
TwitchPlays.py
usingpython TwitchPlays.py
- You can do this as a command on most environments asTwitchPlays
.
Docker allows for easier installation of required packages. In order to set it up:
- Download the source by:
- Cloning using Git
- Downloading the Zip file
- Install Docker: https://docs.docker.com/get-docker
- Run
docker build -t control-my-pc
to build the image - This next step varies depending on your OS.
Note: You will need to install an X server to use this, a popular one is VcxSrv
4a) Find your ".Xauthority" file, for VcxSrv users, it's in %XAUTHORITY%
, if you aren't using VcxSrv, find your .Xauthority
file, and run set XAUTHORITY /path/to/xauthority
5a) Then, to run it, type docker run -e DISPLAY=:0.0 -h %COMPUTERNAME% -v %XAUTHORIY%:/home/server/.Xauthority control-my-pc
Not much is needed! All you need to do is run docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -h $HOSTNAME -v $HOME/.Xauthority:/home/server/.Xauthority control-my-pc
"I don't have all this fancy stuff (Discord webhooks, API for moderator lists, etc.), what can I do?"
- No API ) If you don't have a Webserver or CDN hosting your config, you can modify
TwitchPlays.py (Line 137)
to use a static user list. Leaving out config values is a wanted feature and may be added in the future
Example static user list.
{
"devlist" : [
"developers here"
],
"modlist" : [
"moderators here"
]
}
- No Webhooks: If you don't know how to make a discord webhook, there are plenty of guides online. Without a webhook most commands do absolutely nothing. If you would like to send webhooks to a different service (I.E: Slack), you can modify some of the webhook code (
./cmpc/utils.py
handles most webhooks.). You can use 1 webhook for the entire script, but it is not recommended.
Close individual instances if multiple are running by accident, using the new ../script id
and ../script stop <id>
commands.
For more, see the changelog.