Avnsx/EFT_Flea_Market_Bot

getToken.py - does not kill all the specified processes

astron4ik opened this issue · 3 comments

When you receive a token, you look for the remaining pID for the processes, and a command is generated only to close the last process.

You need to add a variable for the kill commands of other processes by pid

Example:

token = psutil.Process(getProcessPID('EscapeFromTarkov_BE.exe')).cmdline()[3][7:]
pID = getProcessPID('EscapeFromTarkov_BE.exe')
command_tarkovBE = 'taskkill /PID ' + str(pID) + ' /f'
time.sleep(0.33)

pID = getProcessPID('EscapeFromTarkov.exe')
command_tarkov = 'taskkill /PID ' + str(pID) + ' /f'
time.sleep(0.33)

pID = getProcessPID('UnityCrashHandler64.exe')
command_unity = 'taskkill /PID ' + str(pID) + ' /f'

*** In the token found change the functions to kill, according to the received commands ***

subprocess.Popen(command_tarkovBE, stdout=DEVNULL, stderr=DEVNULL)
subprocess.Popen(command_tarkov, stdout=DEVNULL, stderr=DEVNULL)
subprocess.Popen(command_unity, stdout=DEVNULL, stderr=DEVNULL)

And you can also describe a common function to kill processes, but it is up to you.

PS Sorry for my bad English, I use a translator. If you need help with adjustment getToken.py, please contact me.

Avnsx commented

65e7cf3
@astron4ik
I tried rewriting it like you recommended, but the next user opened a issue ticket with an error that I've attached as comment to above commit. What did I do wrong? I currently don't have access to the game equaling in myself not being able to text & fix the error.

As far as I know, when the process of Tarkov_be is killed, the Tarkov process closes automatically. Please check this through the task manager.
If this is the case, then subprocess.Popen(command_tarkov***) for tarkov (not BE) is not needed.

Avnsx commented

Yes I've just removed the lines that would kill tarkov and unitycrashhandler, it's whatever!