Skip to content

Commit

Permalink
Merge pull request #5 from dmadison/pre-release
Browse files Browse the repository at this point in the history
Pre-release updates
  • Loading branch information
dmadison authored Mar 9, 2018
2 parents 383ecb9 + b3a1b0e commit 8021487
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 7 additions & 5 deletions OBS_ChatSpam.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ def new_position(self, pos):
self.position = pos
self.register_hotkey()

def load_hotkey(self):
self.hotkey_saved_key = obs.obs_data_get_array(self.obs_data, "chat_hotkey_" + str(self.position))

def register_hotkey(self):
if len(self.text) > ChatMessage.max_description_length:
key_description = self.text[:ChatMessage.max_description_length - 3] + "..."
Expand All @@ -214,6 +211,9 @@ def register_hotkey(self):
def deregister_hotkey(self):
obs.obs_hotkey_unregister(self.callback)

def load_hotkey(self):
self.hotkey_saved_key = obs.obs_data_get_array(self.obs_data, "chat_hotkey_" + str(self.position))

def save_hotkey(self):
self.hotkey_saved_key = obs.obs_hotkey_save(self.hotkey_id)
obs.obs_data_set_array(self.obs_data, "chat_hotkey_" + str(self.position), self.hotkey_saved_key)
Expand Down Expand Up @@ -296,9 +296,11 @@ def script_description():
"<hr>" + \
"Python script for sending messages to Twitch chat using OBS hotkeys." + \
"<br/><br/>" + \
"Made by David Madison" + \
"Made by David Madison, © 2018" + \
"<br/><br/>" + \
"github.com/dmadison/OBS-ChatSpam" + \
"<br/>" + \
"www.partsnotincluded.com"
"partsnotincluded.com"

def script_update(settings):
twitch.channel = obs.obs_data_get_string(settings, "channel").lower()
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# OBS Chat Spam Script
This is a small Python script for OBS Studio that allows you to post messages in Twitch chat using OBS hotkeys. This can be used for posting general chat messages, spamming emotes, or triggering chat bot commands.
This is a Python script for OBS Studio that allows you to post messages in Twitch chat using OBS hotkeys. This can be used for posting general chat messages, spamming emotes, or triggering chat bot commands.

More information is available [on my website](http://www.partsnotincluded.com/programming/obs-studio-chat-hotkey/).

## Installation
The script only works with OBS Studio versions 21.x and later. If you have an older version you will need to update.

You need [Python 3](https://www.python.org/downloads/) installed on your PC. The bit version of your Python installation must match your OBS installation (e.g. 64-bit OBS requires 64-bit Python). In the menu in OBS Studio, go to `Tools` and then `Scripts`. Then in the "Python Settings" tab, set the path to point to the Python installation folder.
You need [Python 3](https://www.python.org/downloads/) installed on your PC. The bit version of your Python installation must match your OBS installation - use "x86-64" for 64 bit OBS Studio and "x86" for 32 bit OBS Studio. In the menu in OBS Studio, go to `Tools` and then `Scripts`. Then in the "Python Settings" tab, set the path to point to the Python installation folder.

Add the chat spam script to the "Scripts" window using the '+' icon on the bottom left. Select the script in the "Loaded Scripts" panel, and if everything is set up correctly you should see the script properties show up on the right.

Expand All @@ -18,5 +20,8 @@ Add messages to the message list for things you want to say in chat. Each messag

You can test the script by using the "Test Authentication" and "Test Message #1" buttons. These will raise an exception if there is any sort of issue.

## Disclaimer
This is an unofficial 3rd party script for OBS. The author has no affiliation or endorsement as a developer from either Twitch or OBS.

## License
This script is licensed under the terms of the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).

0 comments on commit 8021487

Please sign in to comment.