August 6, 20214 yr Hello, I am trying to automate opening and killing OSBot processes in Windows by utilizing the ProcessBuilder library in Java 11. I can easily open OSBot using the cli with -login flagged, and keep the PID for future termination. The problem is that the OSBot login window opens for a second to log me in, to then open a new process that is the actual bot client. I therefore immediately lose the PID connection to the process. Any ideas how to work arround that? Kind regards
December 24, 20223 yr wmic process Where "CommandLine Like '%oempaloempa%'" Call Terminate Replace oempaloempa with the runescape account name. So it will look for the command that was started containing that runescape account name :)! Took me a while to find a solution for this problem.. Edited December 24, 20223 yr by AtlassianTarsier
September 24, 20241 yr You could try using a ProcessHandle to get a handle to the child process after launching the main OSBot process. Once the login window opens, you can listen for the new process to spawn and grab its PID. A simple way to achieve this is to use a loop to check for active processes after starting OSBot. Another option is to use a library like JNA to interact with the Windows API, which might give you better control over the processes.
Create an account or sign in to comment