Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove points functionality #1

Open
wants to merge 1 commit into
base: ver1_0_1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sounds_list/ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Example path: G:\chatbot_sounds\mp3\
All sound commands will be the name with a ! at the start. For example a sound named:
"shouting" will become a command "!shouting".
===============================================================================

Added functionality by ni6hant:
Remove points from user.
5 changes: 4 additions & 1 deletion sounds_list/SoundsList_StreamlabsSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, SettingsFile=None):
self.perSoundCooldown = 60
self.perUserSoundCooldown = 120
self.EnableDebug = False
self.cost = 100

def Reload(self, jsondata):
self.__dict__ = json.loads(jsondata, encoding="utf-8")
Expand Down Expand Up @@ -90,7 +91,9 @@ def Execute(data):
if potentialCommand in Sounds:
debug_log("Successfully found '" + potentialCommand + "' in Sounds")
PlaySound(potentialCommand, 100, username)

#Remove costs
if Parent.RemovePoints(data.User, username, ScriptSettings.cost):
debug_log("Removed Points for " + str(data.User) + " " + str(username) + " " + str(ScriptSettings.cost) )
# Apply both global and user cooldowns
Parent.AddCooldown(ScriptName, "!"+potentialCommand, ScriptSettings.perSoundCooldown)
Parent.AddUserCooldown(ScriptName, "!"+potentialCommand, data.User, ScriptSettings.perUserSoundCooldown)
Expand Down
7 changes: 7 additions & 0 deletions sounds_list/UI_Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
"tooltip": "Specify the folder to the sounds to trigger. (Include the '/' at the end)",
"group": "General"
},
"cost": {
"type": "numberbox",
"value": 120,
"label": "Cost to play a sound",
"tooltip": "The cost to play a sound. Duh!",
"group": "General"
},
"soundListCooldown": {
"type": "numberbox",
"value": 600,
Expand Down