How To Add Commands To Revlobot

how to add commands to revlobot
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
“””Gamble game with lot of variation and customization to fit most streamers”””
#—————————————
# Libraries and references
#—————————————
import codecs
import json
import os
import winsound
how to add commands to revlobot check more how to add commands to revlobot
import ctypes
#—————————————
# [Required] Script information
#—————————————
ScriptName = “Gamble”
Website = “https://www.twitch.tv/castorr91″
Creator = “Castorr91”
Version = “2.0.5”
Description = “Gamble minigame”
#—————————————
how to add commands to revlobot informational how to add commands to revlobot
# Versions
#—————————————
“”” Releases (open README.txt for full release notes)
2.0.5 – Fixed cost for random game mode!
2.0.4 – Code cleanup, improved usage stability
2.0.3 – Fixed max roll value
2.0.2 – Fixed negative rolling for revlo gamemode, fixed min roll value, changed version system.
2.0.1.0 – Updated for Streamlabs Chatbot, ui tweaking
2.0.0.9 – Added more usage options
2.0.0.8 – Bugfix for cooldown messages
how to add commands to revlobot informational how to add commands to revlobot
2.0.0.7 – Bugfixes and fixed typos
2.0.0.6 – Usage options
2.0.0.5 – Jackpot updates & UI buttons
2.0.0.4 – Bugfix introduced in 2.0.0.3
2.0.0.3 – Bugfix for gamble all
2.0.0.2 – Bugfix for random gamemode
2.0.0.1 – Bugfix for percentage gamemode
2.0.0.0 – Added gamemodes and lots of options
1.2.0.1 – Bugfix & added min bet setting
1.2.0.0 – Fixed textbox info & cleaned code
how to add commands to revlobot informational how to add commands to revlobot
1.1.0.2 – Added max bet setting
1.1.0.1 – Updated to work with AnkhBot 1.0.2.1
1.1.0.0 – Bugfixes
1.0.1.0 – Bugfix
1.0.0.0 – Initial Release
“””
#—————————————
# Variables
#—————————————
settingsFile = os.path.join(os.path.dirname(__file__), “settings.json”)
how to add commands to revlobot how to add commands to revlobot
jackpotFile = os.path.join(os.path.dirname(__file__), “jackpot.txt”)
#—————————————
# Classes
#—————————————
class Settings:
“””” Loads settings from file if file is found if not uses default values”””

# The ‘default’ variable names need to match UI_Config
def __init__(self, settingsFile=None):
if settingsFile and os.path.isfile(settingsFile):
how to add commands to revlobot best of how to add commands to revlobot
with codecs.open(settingsFile, encoding=’utf-8-sig’, mode=’r’) as f:
self.__dict__ = json.load(f, encoding=’utf-8-sig’)

else: #set variables if no custom settings file is found
self.OnlyLive = False
self.Command = “!gamble”
self.Permission = “Everyone”
self.PermissionInfo = “”
self.Mode = “Revlo”
self.Usage = “Twitch Chat”
how to add commands to revlobot informational how to add commands to revlobot
self.AllWord = “all”
self.ForceAll = False
self.UseRandom = False
self.RandomMax = 1
self.RandomMin = 100
self.Jackpot = 500
self.JackpotEnabled = False
self.JackpotNumber = 100
self.JackpotPercentage = 50
self.JackpotBase = 500
how to add commands to revlobot informational how to add commands to revlobot
self.JackpotCheck = True
self.JackpotWord = “jackpot”
self.UseCD = True
self.Cooldown = 5
self.OnCooldown = “{0} the command is still on cooldown for {1} seconds!”
self.UserCooldown = 10
self.OnUserCooldown = “{0} the command is still on user cooldown for {1} seconds!”
self.CasterCD = True
self.BaseResponse = “Rolled {0}. ”
self.NotEnoughResponse = “{0} you don’t have that many {1} to gamble! ”
how to add commands to revlobot how to add commands to revlobot
self.WinResponse = “{0} won {1} {3} and now has {2} {3} ”
self.LoseResponse = “{0} lost {1} {3} and now has {2} {3} ”
self.TooMuchResponse = “{0} you can’t gamble more than {1} {2}”
self.TooLowResponse = “{0} you can’t gamble less than {1} {2}”
self.InfoResponse = “To gamble use !gamble ”
self.JackpotWin = “{0} won the jackpot of {1} {3} and now has a total of {2} {3}”
self.JackpotResponse = “There’s currently {0} {1} in the jackpot!”
self.MinValue = 0
self.MaxValue = 100
self.WinChance = 40
how to add commands to revlobot informational how to add commands to revlobot
self.TrippleWinEnabled = True
self.TrippleChance = 2
self.MinBet = 1
self.MaxBet = 9999
self.RMinValue = 1
self.RMaxValue = 100
self.RWinChance = 40
self.RMinBet = 1
self.RMaxBet = 9999
self.PMinValue = 0
how to add commands to revlobot how to add commands to revlobot
self.PMaxValue = 100
self.PMinBet = 1
self.PMaxBet = 9999
self.SMinValue = 0
self.SMaxValue = 100
self.SMinBet = 1
self.SMaxBet = 9999
self.SWinNumbers = “42 69 100”
self.SMultiplier = 30
self.CMaxBet = 0
how to add commands to revlobot best of how to add commands to revlobot
self.CMinBet = 0
self.NoZero = “{0} -> You are not allowed to roll anything less than 1!”

# Reload settings on save through UI
def ReloadSettings(self, data):
“””Reload settings on save through UI”””
self.__dict__ = json.loads(data, encoding=’utf-8-sig’)
return

# Save settings to files (json and js)
how to add commands to revlobot best of how to add commands to revlobot
def SaveSettings(self, settingsFile):
“””Save settings to files (json and js)”””
with codecs.open(settingsFile, encoding=’utf-8-sig’, mode=’w+’) as f:
json.dump(self.__dict__, f, encoding=’utf-8-sig’)
with codecs.open(settingsFile.replace(“json”, “js”), encoding=’utf-8-sig’, mode=’w+’) as f:
f.write(“var settings = {0};”.format(json.dumps(self.__dict__, encoding=’utf-8-sig’)))
return
#—————————————
# Settings functions
#—————————————
how to add commands to revlobot how to add commands to revlobot
def UpdateSettings():
“””Update settings”””
with open(m_ConfigFile) as ConfigFile:
MySet.__dict__ = json.load(ConfigFile)
return

def SetDefaults():
“””Set default settings function”””

winsound.MessageBeep()
how to add commands to revlobot informational how to add commands to revlobot
MessageBox = ctypes.windll.user32.MessageBoxW
returnValue = MessageBox(0, u”You are about to reset the settings, ”
“are you sure you want to contine?”
, u”Reset settings file?”, 4)
if returnValue == 6:

MessageBox = ctypes.windll.user32.MessageBoxW
returnValue = MessageBox(0, u”Settings successfully restored to default values”
, u”Reset complete!”, 0)

how to add commands to revlobot check more how to add commands to revlobot
# Set defaults by not supplying a settings file
MySet = Settings()

# Save defaults back to file
MySet.SaveSettings(settingsFile)

# End of SetDefaults
return

def ReloadSettings(jsondata):
how to add commands to revlobot check more how to add commands to revlobot
“””Reload settings on Save”””

# Globals
global MySet

# Reload saved settings
MySet.ReloadSettings(jsondata)

# End of ReloadSettings
return
how to add commands to revlobot how to add commands to revlobot

def SaveSettings(self, settingsFile):
“””Save settings to files (json and js)”””
with codecs.open(settingsFile, encoding=’utf-8-sig’, mode=’w+’) as f:
json.dump(self.__dict__, f, encoding=’utf-8-sig’)
with codecs.open(settingsFile.replace(“json”, “js”), encoding=’utf-8-sig’, mode=’w+’) as f:
f.write(“var settings = {0};”.format(json.dumps(self.__dict__, encoding=’utf-8-sig’)))
return

#—————————————
how to add commands to revlobot informational how to add commands to revlobot
# Optional functions
#—————————————
def OpenReadMe():
“””Open the readme.txt in the scripts folder”””
location = os.path.join(os.path.dirname(__file__), “README.txt”)
os.startfile(location)
return

def SendResp(data, rUsage, sendMessage):
“””Sends message to twitch or discord chat depending on settings”””
how to add commands to revlobot check more how to add commands to revlobot

#Set a list with all possible usage options that would trigger twitch chat message
l = [“Twitch Chat”, “Chat Both”, “All”, “Twitch Both”]

#check if message is from twitch, from chat and if chosen usage is in the list above
if data.IsFromTwitch() and data.IsChatMessage and (rUsage in l):

#send twitch message
Parent.SendTwitchMessage(sendMessage)

how to add commands to revlobot informational how to add commands to revlobot
#Set a list with all possible usage options that would trigger twitch whisper
l = [“Twitch Whisper”, “Whisper Both”, “All”, “Twitch Both”]

#check if message is from twitch, from whisper and if chosen usage is in the list above
if data.IsFromTwitch() and data.IsWhisper() and (rUsage in l):

#send twitch whisper
Parent.SendTwitchWhisper(data.User, sendMessage)

#Set a list with all possible usage options that would trigger discord message
how to add commands to revlobot informational how to add commands to revlobot
l = [“Discord Chat”, “Chat Both”, “All”, “Discord Both”]

#check if message is from discord
if data.IsFromDiscord() and not data.IsWhisper() and (rUsage in l):

#send Discord message
Parent.SendDiscordMessage(sendMessage)

#Set a list with all possible usage options that would trigger discord DM
l = [“Discord Whisper”, “Whisper Both”, “All”, “Discord Both”]
how to add commands to revlobot informational how to add commands to revlobot

#check if message is from discord, from DM and if chosen usage is in the list above
if data.IsFromDiscord() and data.IsWhisper() and (rUsage in l):

#send Discord whisper
Parent.SendDiscordDM(data.User, sendMessage)

return

def CheckUsage(data, rUsage):
how to add commands to revlobot best of how to add commands to revlobot
“””Return true or false depending on the message is sent from
a source that’s in the usage setting or not”””
#check if message is from twitch
if data.IsFromTwitch():

#check if any of the following usages is set
l = [“Twitch Chat”, “Chat Both”, “All”, “Twitch Both”]
if not data.IsWhisper() and (rUsage in l):
return True

how to add commands to revlobot how to add commands to revlobot
#check if any of the following usagess is set
l = [“Twitch Whisper”, “Whisper Both”, “All”, “Twitch Both”]
if data.IsWhisper() and (rUsage in l):
return True

#check if message is from discord
if data.IsFromDiscord():

#check if any of the following usages is set
l = [“Discord Chat”, “Chat Both”, “All”, “Discord Both”]
how to add commands to revlobot informational how to add commands to revlobot
if not data.IsWhisper() and (rUsage in l):
return True

#check if any of the following usagess is set
l = [“Discord Whisper”, “Whisper Both”, “All”, “Discord Both”]
if data.IsWhisper() and (rUsage in l):
return True

return False

how to add commands to revlobot best of how to add commands to revlobot
#—————————————
# [Required] functions
#—————————————
def Init():

“””data on Load, required function”””
# Globals
global MySet

# Load in saved settings
how to add commands to revlobot best of how to add commands to revlobot
MySet = Settings(settingsFile)

global jackpot
jackpot = MySet.Jackpot

# End of Init
return

def Execute(data):
“””Required Execute data function”””
how to add commands to revlobot check more how to add commands to revlobot

#check if command is called
if data.IsChatMessage() and data.GetParam(0).lower() == MySet.Command.lower():

if not CheckUsage(data, MySet.Usage):
return

#set permissions to a new variable
HasPerm = Parent.HasPermission(data.User, MySet.Permission, MySet.PermissionInfo)

how to add commands to revlobot check more how to add commands to revlobot
#check if live only mode is enabled and if stream is live
if not MySet.OnlyLive or Parent.IsLive() and HasPerm:

#introduce globals for cooldown management
cooldown = Parent.IsOnCooldown(ScriptName, MySet.Command)
userCooldown = Parent.IsOnUserCooldown(ScriptName, MySet.Command, data.User)

#check if command is on cooldown
if cooldown or userCooldown:

how to add commands to revlobot check more how to add commands to revlobot
#check if cooldown message is enabled
if MySet.UseCD:

#set variables for cooldown
cooldownDuration = Parent.GetCooldownDuration(ScriptName, MySet.Command)
userCDD = Parent.GetUserCooldownDuration(ScriptName, MySet.Command, data.User)

#check for the longest CD!
if cooldownDuration > userCDD:

how to add commands to revlobot informational how to add commands to revlobot
#set cd remaining
m_CooldownRemaining = cooldownDuration

#send cooldown message
message = MySet.OnCooldown.format(data.User, m_CooldownRemaining)
SendResp(data, MySet.Usage, message)

else: #set cd remaining
m_CooldownRemaining = userCDD

how to add commands to revlobot best of how to add commands to revlobot
#send usercooldown message
message = MySet.OnUserCooldown.format(data.User, m_CooldownRemaining)
SendResp(data, MySet.Usage, message)
return

#if not on cooldown continue
else:

#check parameter count to make sure they are there
if data.GetParamCount() < 2 and not MySet.UseRandom:
how to add commands to revlobot check more how to add commands to revlobot

#introduce global for info message
SendResp(data, MySet.Usage, MySet.InfoResponse)

return

#introduce gambleInt
global gambleInt

#set gambleInt to selected value
how to add commands to revlobot best of how to add commands to revlobot
gambleInt = data.GetParam(1)

#check if gambleInt is int
try:
int(gambleInt)
#end function if you gamble less than 1
if int(gambleInt) < 1:
Parent.SendTwitchMessage(MySet.NoZero.format(data.User))
return
except ValueError:
how to add commands to revlobot informational how to add commands to revlobot

#check if user wants to gamble all
setBet = MySet.UseRandom or MySet.ForceAll
if data.GetParam(1).lower() == MySet.AllWord.lower() and not setBet:
gambleInt = Parent.GetPoints(data.User)

#check if user tries to check total jackpot value
elif data.GetParam(1).lower() == MySet.JackpotWord and MySet.JackpotCheck:

#send twitch message with jackpot amount
how to add commands to revlobot check more how to add commands to revlobot
message = MySet.JackpotResponse.format(jackpot, Parent.GetCurrencyName())
SendResp(data, MySet.Usage, message)
return

else:
return

#check if random bets are enabled
how to add commands to revlobot how to add commands to revlobot
if MySet.UseRandom:

#set values for min and max random numbers
maxRandom = int(Parent.GetPoints(data.User)*MySet.RandomMax/100)
minRandom = int(Parent.GetPoints(data.User)*MySet.RandomMin/100)

gambleInt = Parent.GetRandom(minRandom, maxRandom+1)

#check if forced all in is enabled
if MySet.ForceAll:
how to add commands to revlobot best of how to add commands to revlobot
gambleInt = Parent.GetPoints(data.User)

#test if the parameter is an integer
try:
gambleInt = int(gambleInt)

except ValueError:
pass

#check what mod is active
how to add commands to revlobot informational how to add commands to revlobot
if MySet.Mode == "Revlo":
Revlo(data)

#if revlo advanced
elif MySet.Mode == "Revlo Advanced":
RevloAdvanced(data)

# if random mode is enabled
elif MySet.Mode == "Random":
Random(data)
how to add commands to revlobot check more how to add commands to revlobot

# if Percentage mode is enabled
elif MySet.Mode == "Percentage":
Percentage(data)

# if Percentage mode is enabled
elif MySet.Mode == "Single Number":
SingleNumber(data)

#end function
how to add commands to revlobot check more how to add commands to revlobot
return

def Tick():
"""Required tick function"""
return

#—————————————
# Functions for all game modes
#—————————————
def Revlo(data):
how to add commands to revlobot informational how to add commands to revlobot
"""Revlo game mode function"""

#check if amount ambled is over users points
global gambleInt
if Parent.GetPoints(data.User) = 99:

how to add commands to revlobot best of how to add commands to revlobot
#pay out the currency
Parent.AddPoints(data.User, gambleInt*3)

#set winMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
winMessage = MySet.WinResponse.format(data.User, gambleInt*3, points, currency)

#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + winMessage)
how to add commands to revlobot best of how to add commands to revlobot

#check if roll value is in the calculated win range
elif rollValue >= 61:

#pay out the currency
Parent.AddPoints(data.User, gambleInt*2)

#set winMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
how to add commands to revlobot informational how to add commands to revlobot
winMessage = MySet.WinResponse.format(data.User, gambleInt*2, points, currency)

#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + winMessage)

else:
#add value to jackpot
global jackpot
jackpot += int(gambleInt*MySet.JackpotPercentage/100)

how to add commands to revlobot informational how to add commands to revlobot
MySet.Jackpot = jackpot

#save jackpot
SaveSettings(MySet, settingsFile)

#save to text file
with open(jackpotFile, “w+”) as f:
f.write(str(jackpot))

#set loseMessage
how to add commands to revlobot check more how to add commands to revlobot
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
loseMessage = MySet.LoseResponse.format(data.User, gambleInt, points, currency)

#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + loseMessage)

# if user is caster and caster cooldown is ignored do nothing
if Parent.HasPermission(data.User, “Caster”, “”) and MySet.CasterCD:
return
how to add commands to revlobot how to add commands to revlobot

#else add cooldown for user
else:
# add cooldowns
Parent.AddUserCooldown(ScriptName, MySet.Command, data.User, MySet.UserCooldown)
Parent.AddCooldown(ScriptName, MySet.Command, MySet.Cooldown)
return

def RevloAdvanced(data):
“””Revlo Advanced game mode function”””
how to add commands to revlobot informational how to add commands to revlobot

#check if amount gambled is more than max bet allowed
if MySet.MaxBet gambleInt:

#set min bet message
currency = Parent.GetCurrencyName()
minBetMessage = MySet.TooLowResponse.format(data.User, MySet.MinBet, currency)
how to add commands to revlobot check more how to add commands to revlobot

#send twitch message
SendResp(data, MySet.Usage, minBetMessage)

#end function
return

#check if amount ambled is over users points
if Parent.GetPoints(data.User) trippleWin and MySet.TrippleWinEnabled:

#pay out the currency
Parent.AddPoints(data.User, gambleInt*3)
how to add commands to revlobot informational how to add commands to revlobot

#set winMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
winMessage = MySet.WinResponse.format(data.User, gambleInt*3, points, currency)

#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + winMessage)

#check if roll value is in the calculated win range
how to add commands to revlobot informational how to add commands to revlobot
elif rollValue > int(MySet.MaxValue-MySet.MaxValue*MySet.WinChance/100):

#pay out the currency
Parent.AddPoints(data.User, gambleInt*2)

#set winMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
winMessage = MySet.WinResponse.format(data.User, gambleInt*2, points, currency)

how to add commands to revlobot best of how to add commands to revlobot
#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + winMessage)

else:
#add value to jackpot
global jackpot
jackpot += int(gambleInt*MySet.JackpotPercentage/100)

MySet.Jackpot = jackpot

how to add commands to revlobot best of how to add commands to revlobot
#save jackpot
SaveSettings(MySet, settingsFile)

#save to text file
with open(jackpotFile, “w+”) as f:
f.write(str(jackpot))

#set loseMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
how to add commands to revlobot how to add commands to revlobot
loseMessage = MySet.LoseResponse.format(data.User, gambleInt, points, currency)

#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + loseMessage)

# if user is caster and caster cooldown is ignored do nothing
if Parent.HasPermission(data.User, “Caster”, “”) and MySet.CasterCD:
return

#else add cooldown for user
how to add commands to revlobot check more how to add commands to revlobot
else:
# add cooldowns
Parent.AddUserCooldown(ScriptName, MySet.Command, data.User, MySet.UserCooldown)
Parent.AddCooldown(ScriptName, MySet.Command, MySet.Cooldown)
return

def Random(data):
“””Random game mode function”””
#check if amount gambled is more than max bet allowed
if MySet.RMaxBet gambleInt:

#set min bet message
currency = Parent.GetCurrencyName()
minBetMessage = MySet.TooLowResponse.format(data.User, MySet.RMinBet, currency)

#send twitch message
SendResp(data, MySet.Usage, minBetMessage)
how to add commands to revlobot informational how to add commands to revlobot

#end function
return

#check if amount ambled is over users points
if Parent.GetPoints(data.User) = 100-MySet.RWinChance:

#pay out the currency
Parent.AddPoints(data.User, gambleInt*2)

#set winMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
how to add commands to revlobot informational how to add commands to revlobot
winMessage = MySet.WinResponse.format(data.User, gambleInt*2, points, currency)

#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + winMessage)

else:
#add value to jackpot
global jackpot
jackpot += int(gambleInt*MySet.JackpotPercentage/100)

how to add commands to revlobot informational how to add commands to revlobot
MySet.Jackpot = jackpot

#save jackpot
SaveSettings(MySet, settingsFile)

#save to text file
with open(jackpotFile, “w+”) as f:
f.write(str(jackpot))

#set loseMessage
how to add commands to revlobot check more how to add commands to revlobot
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
loseMessage = MySet.LoseResponse.format(data.User, gambleInt, points, currency)

#send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + loseMessage)

# if user is caster and caster cooldown is ignored do nothing
if Parent.HasPermission(data.User, “Caster”, “”) and MySet.CasterCD:
how to add commands to revlobot informational how to add commands to revlobot
return

#else add cooldown for user
else:
# add cooldowns
Parent.AddUserCooldown(ScriptName, MySet.Command, data.User, MySet.UserCooldown)
Parent.AddCooldown(ScriptName, MySet.Command, MySet.Cooldown)
return

def Percentage(data):
how to add commands to revlobot informational how to add commands to revlobot
“””Percentage game mode function”””

#check if amount gambled is more than max bet allowed
if MySet.PMaxBet gambleInt:

#set min bet message
currency = Parent.GetCurrencyName()
how to add commands to revlobot informational how to add commands to revlobot
minBetMessage = MySet.TooLowResponse.format(data.User, MySet.PMinBet, currency)

#send twitch message
SendResp(data, MySet.Usage, minBetMessage)

#end function
return

#check if amount ambled is over users points
if Parent.GetPoints(data.User) 1:
how to add commands to revlobot informational how to add commands to revlobot

#set winMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
newBalance = int(gambleInt*pPayout-gambleInt)
winMessage = MySet.WinResponse.format(data.User, newBalance, points, currency)

#Send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + winMessage)

how to add commands to revlobot how to add commands to revlobot
else:
#add value to jackpot
global jackpot
jackpot += int(gambleInt*MySet.JackpotPercentage/100)

MySet.Jackpot = jackpot

#save jackpot
SaveSettings(MySet, settingsFile)

how to add commands to revlobot how to add commands to revlobot
#save to text file
with open(jackpotFile, “w+”) as f:
f.write(str(jackpot))

#set loseMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
newBalance = abs(int(gambleInt*pPayout-gambleInt))
loseMessage = MySet.LoseResponse.format(data.User, newBalance, points, currency)

how to add commands to revlobot how to add commands to revlobot
#Send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + loseMessage)

# if user is caster and caster cooldown is ignored do nothing
if Parent.HasPermission(data.User, “Caster”, “”) and MySet.CasterCD:
return

#else add cooldown for user
else:
# add cooldowns
how to add commands to revlobot best of how to add commands to revlobot
Parent.AddUserCooldown(ScriptName, MySet.Command, data.User, MySet.UserCooldown)
Parent.AddCooldown(ScriptName, MySet.Command, MySet.Cooldown)
return

def SingleNumber(data):
“””Single number game mode function”””

#check if amount gambled is more than max bet allowed
if MySet.SMaxBet gambleInt:

#set min bet message
currency = Parent.GetCurrencyName()
minBetMessage = MySet.TooLowResponse.format(data.User, MySet.PMinBet, currency)

#send twitch message
SendResp(data, MySet.Usage, minBetMessage)

how to add commands to revlobot check more how to add commands to revlobot
#end function
return

#check if amount ambled is over users points
if Parent.GetPoints(data.User) < gambleInt:

#set not enough currency message
currency = Parent.GetCurrencyName()
notEnough = MySet.NotEnoughResponse.format(data.User, currency, MySet.Command)

how to add commands to revlobot informational how to add commands to revlobot
#send twitch message
SendResp(data, MySet.Usage, notEnough)

#end function
return

#introduce roll value and set it to ra random number between min and max
rollValue = Parent.GetRandom(MySet.SMinValue, MySet.SMaxValue+1)

#remove points gambled
how to add commands to revlobot how to add commands to revlobot
Parent.RemovePoints(data.User, gambleInt)

#parse numbers from the UI
numbersList = MySet.SWinNumbers.split(" ")

#by default winCheck = false
winCheck = False

#if number is the same as rollValue set winCheck to true
for number in numbersList:
how to add commands to revlobot check more how to add commands to revlobot
if number == str(rollValue):
winCheck = True

#if user rolled jackpotnumber and jackpot is enabled
if int(rollValue) == int(MySet.JackpotNumber) and MySet.JackpotEnabled:

#add points to user!
global jackpot
Parent.AddPoints(data.User, jackpot)

how to add commands to revlobot check more how to add commands to revlobot
#send jackpot message
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
jackpotMessage = MySet.JackpotWin.format(data.User, jackpot, points, currency)
message = MySet.BaseResponse.format(rollValue, data.User)
SendResp(data, MySet.Usage, message + jackpotMessage)

jackpot = MySet.JackpotBase

MySet.Jackpot = jackpot
how to add commands to revlobot informational how to add commands to revlobot

#save jackpot
SaveSettings(MySet, settingsFile)

#save to text file
with open(jackpotFile, "w+") as f:
f.write(str(jackpot))
return

if winCheck:
how to add commands to revlobot informational how to add commands to revlobot

#add points for winning roll
Parent.AddPoints(data.User, gambleInt*MySet.SMultiplier)

#set winMessage
newBalance = gambleInt*MySet.SMultiplier-gambleInt
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
winMessage = MySet.WinResponse.format(data.User, newBalance, points, currency)

how to add commands to revlobot informational how to add commands to revlobot
#Send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + winMessage)

else:
#add value to jackpot
global jackpot
jackpot += int(gambleInt*MySet.JackpotPercentage/100)

MySet.Jackpot = jackpot

how to add commands to revlobot best of how to add commands to revlobot
#save jackpot
SaveSettings(MySet, settingsFile)

#save to text file
with open(jackpotFile, "w+") as f:
f.write(str(jackpot))

#set loseMessage
points = Parent.GetPoints(data.User)
currency = Parent.GetCurrencyName()
how to add commands to revlobot how to add commands to revlobot
loseMessage = MySet.LoseResponse.format(data.User, gambleInt, points, currency)

#Send twitch message
SendResp(data, MySet.Usage, MySet.BaseResponse.format(rollValue, data.User) + loseMessage)

# if user is caster and caster cooldown is ignored do nothing
if Parent.HasPermission(data.User, "Caster", "") and MySet.CasterCD:
return

#else add cooldown for user
how to add commands to revlobot check more how to add commands to revlobot
else:
# add cooldowns
Parent.AddUserCooldown(ScriptName, MySet.Command, data.User, MySet.UserCooldown)
Parent.AddCooldown(ScriptName, MySet.Command, MySet.Cooldown)
return
how to add commands to revlobot

Redstone Arsenal Ftb

Ffmpeg Ndi