From 5e587b15364abd27ac346a2e6014e87cefff9363 Mon Sep 17 00:00:00 2001 From: jenz Date: Fri, 6 Jun 2025 12:14:38 +0200 Subject: [PATCH] further adjustsments --- AutismBotIngame/python/ingamefollowct.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/AutismBotIngame/python/ingamefollowct.py b/AutismBotIngame/python/ingamefollowct.py index 2a88f14..c626b48 100644 --- a/AutismBotIngame/python/ingamefollowct.py +++ b/AutismBotIngame/python/ingamefollowct.py @@ -187,18 +187,18 @@ def my_file_created_function(event_path): file_size = None while True: - time.sleep(10) stdout, stderr = subprocess.Popen(["ls", "-l", event_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() #print('stdout: ', stdout) #print('stderr: ', stderr) if stderr: - print('finished downloading the bz2 file.') + print('finished downloading the bz2 file. Reconnecting client again.') + writeCfgInput("retry;") break + user = stdout.decode().split("autismbots")[0] if whoami not in user: - writeCfgInput("disconnect;") print("disconnected from server until other user finished downloading bz2 file") - continue + writeCfgInput("disconnect;") #in case the bz2 download is not progressing just delete the file and disconnect. cur_file_size = stdout.decode().split("autismbots")[1].strip().split(" ")[0] @@ -209,6 +209,7 @@ def my_file_created_function(event_path): subprocess.Popen(["rm", event_path], stdout=subprocess.DEVNULL).communicate()[0] break file_size = cur_file_size + time.sleep(10) class NewFileHandler(FileSystemEventHandler): def on_created(self, event): @@ -295,14 +296,12 @@ if __name__ == '__main__': print('bot kicked server full: ', datetime.datetime.now().time()) elif "autismo connected to ze" == data: print('Bot connected to ze!') - #cpulimit_pid_of_game() is_bot_connected_to_ze2 = False overwrite_file_access() elif "not connected to ze2" == data: is_bot_connected_to_ze2 = False elif "autismo connected to ze2" == data: print('Bot connected to ze2!') - #cpulimit_pid_of_game() is_bot_connected_to_ze2 = True overwrite_file_access() elif "connect to ze" == data or ("connect to ze2" == data and not is_bot_connected_to_ze2):