From c861901b5e224526c55291dda9c49db6502e74ef Mon Sep 17 00:00:00 2001 From: Nishant Date: Mon, 11 Dec 2023 09:17:26 +0530 Subject: [PATCH] added win probability --- Steal/Steal_StreamlabsSystem.py | 7 +++++-- Steal/UI_Config.json | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Steal/Steal_StreamlabsSystem.py b/Steal/Steal_StreamlabsSystem.py index d6443c8..1598e1f 100644 --- a/Steal/Steal_StreamlabsSystem.py +++ b/Steal/Steal_StreamlabsSystem.py @@ -30,6 +30,7 @@ def Init(): "command": "!steal", "permission": "Everyone", "cost": 5, + "winProbability":30, "minReward": 10, "maxReward": 20, "useCooldown": True, @@ -67,7 +68,9 @@ def Execute(data): outputMessage = "" else: Parent.RemovePoints(userId, username, settings["costs"]) - isStealing = Parent.GetRandom(0, 2) + currentChance = Parent.GetRandom(0, 100) + winProbablity = settings["winProbability"] + lossProbability = 100 - winProbablity userList = Parent.GetViewerList() while True: @@ -82,7 +85,7 @@ def Execute(data): if reward > points: reward = points - if isStealing == 1: + if currentChance>lossProbability: Parent.AddPoints(userId, username, reward) Parent.RemovePoints(victimId, victim, reward) diff --git a/Steal/UI_Config.json b/Steal/UI_Config.json index 451a26a..140618f 100644 --- a/Steal/UI_Config.json +++ b/Steal/UI_Config.json @@ -30,6 +30,13 @@ "tooltip": "Set the default cost for this command.", "group": "General" }, + "winProbability": { + "type": "numberbox", + "value": 30, + "label": "Percentage Win Rate", + "tooltip": "Set the default cost for this command.", + "group": "General" + }, "minReward": { "type": "numberbox", "value": 10,