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

Update Steal_StreamlabsSystem.py #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions Steal/Steal_StreamlabsSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def Init():
"onUserCooldown": "$user $command is still on user cooldown for $cd minutes!",
"responseWon": "$user stole $reward $currency from $victim",
"responseLost": "$user couldn't steal any $currency from $victim and lost $reward $currency",
"responseNotEnoughPoints": "$user you need $cost $currency to steal."
"responseNotEnoughPoints": "$user you need $cost $currency to steal from $msg."
}

def Execute(data):
Expand All @@ -49,6 +49,8 @@ def Execute(data):
userId = data.User
username = data.UserName
points = Parent.GetPoints(userId)
victimId = Parent.GetDisplayName("targetid")
victim = Parent.GetDisplayName(victimId)

if points < settings["costs"]:
outputMessage = settings["responseNotEnoughPoints"]
Expand All @@ -71,7 +73,7 @@ def Execute(data):
userList = Parent.GetViewerList()

while True:
victimId = userList[Parent.GetRandom(0, len(userList))]
victim = Parent.GetDisplayName(victimId)

if victimId != userId:
break
Expand All @@ -93,6 +95,7 @@ def Execute(data):

outputMessage = settings["responseLost"]

outputMessage = outputMessage.replace("$victim", Parent.GetDisplayName("$targetid"))
outputMessage = outputMessage.replace("$victim", victim)
outputMessage = outputMessage.replace("$reward", str(reward))

Expand All @@ -107,6 +110,8 @@ def Execute(data):
outputMessage = outputMessage.replace("$cost", str(settings["costs"]))
outputMessage = outputMessage.replace("$minReward", str(settings["minReward"]))
outputMessage = outputMessage.replace("$maxReward", str(settings["maxReward"]))
outputMessage = outputMessage.replace("$victim", Parent.GetDisplayName("$targetid"))
outputMessage = outputMessage.replace("$victim", victim)

Parent.SendStreamMessage(outputMessage)
return
Expand Down