Skip to content

Commit

Permalink
Added a check to avoid multiple usage on bot restart
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBitz committed Aug 31, 2020
1 parent 86357e0 commit 95b868f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xAcademy.py
Expand Up @@ -8,7 +8,7 @@
import subprocess

pName = 'xAcademy'
pVersion = '1.2.0'
pVersion = '1.2.1'
pUrl = 'https://raw.githubusercontent.com/JellyBitz/phBot-xPlugins/master/xAcademy.py'

# User settings
Expand All @@ -20,6 +20,7 @@
# Globals
isCreatingCharacter = False
CreatingNickname = ""
isRestarted = False

# Graphic user interface
gui = QtBind.init(__name__,pName)
Expand Down Expand Up @@ -281,6 +282,11 @@ def CloseBot():

# This will execute another bot with the same command line arguments as this one
def RestartBotWithCommandLine():
# Flag to indicate it can be executed only once
global isRestarted
if isRestarted:
return
isRestarted = True
# Get the path and arguments from the current bot
cmd = ' '.join(get_command_line_args())
# Run on subprocess to avoid lock
Expand Down

0 comments on commit 95b868f

Please sign in to comment.