Jump to content
Zummy

Closing specific osbot client

Recommended Posts

Hello, I'm trying to find a way to kill a specific osbot client. This is what i'm after: say I have 10 osbots clients open but I want to kill the client that has account X running, how could I achieve this? I tried:

  • Finding a way to rename the java.exe process with a java argument in a .bat file.
  • Finding a way to rename the window tile of the client, doesn't look like it's possible alway OSBot 2.5.8
  • Using a custom login handler and using System.exit, this only works with local scripts and I need to find a solution that also works with SDN scripts.
  • Killing the process with PKILL in cmd based on it's PID but can't find the connection to link specific clients with it's PID number (which client has PID X running account X).

Thanks for reading, any help is appreciated ?.

Link to comment
Share on other sites

16 minutes ago, myOSBaccount said:

is it possible that you're cheating the system somehow? you don't seem very VIP to me, and yet you're saying you have more than 1 client running :think:

I'm not saying that I am running more than 1 client, I'm planning to. I will buy VIP ofcourse but right now I'm in the process of setting things up.

Link to comment
Share on other sites

 

3 hours ago, Zummy said:

Hello, I'm trying to find a way to kill a specific osbot client. This is what i'm after: say I have 10 osbots clients open but I want to kill the client that has account X running, how could I achieve this? I tried:

  • Finding a way to rename the java.exe process with a java argument in a .bat file.
  • Finding a way to rename the window tile of the client, doesn't look like it's possible alway OSBot 2.5.8
  • Using a custom login handler and using System.exit, this only works with local scripts and I need to find a solution that also works with SDN scripts.
  • Killing the process with PKILL in cmd based on it's PID but can't find the connection to link specific clients with it's PID number (which client has PID X running account X).

Thanks for reading, any help is appreciated ?.

Click the X in the top right corner of your client :) 

Link to comment
Share on other sites

6 hours ago, Zummy said:

Hello, I'm trying to find a way to kill a specific osbot client. This is what i'm after: say I have 10 osbots clients open but I want to kill the client that has account X running, how could I achieve this? I tried:

  • Finding a way to rename the java.exe process with a java argument in a .bat file.
  • Finding a way to rename the window tile of the client, doesn't look like it's possible alway OSBot 2.5.8
  • Using a custom login handler and using System.exit, this only works with local scripts and I need to find a solution that also works with SDN scripts.
  • Killing the process with PKILL in cmd based on it's PID but can't find the connection to link specific clients with it's PID number (which client has PID X running account X).

Thanks for reading, any help is appreciated ?.

 

Take a look at how I do it in my OSBot manager using the windows tasklist and taskkill commands. I have written this in Java, but you could do it in a batch script.

https://github.com/Explv/osbot_manager/blob/master/osbot_manager/src/bot_parameters/configuration/Configuration.java#L347

Essentially:

1. Collect all the PIDs of running OSBot clients.

2. Start a new OSBot process

3. Collect all the PIDs of running OSBot clients.

4. Check which PID has been added by comparing the two lists

By doing this you can store which PID is associated to which OSBot client, so when you want to close that client, you just kill the process.

Edited by Explv
  • Like 1
Link to comment
Share on other sites

6 hours ago, Explv said:

 

Take a look at how I do it in my OSBot manager using the windows tasklist and taskkill commands. I have written this in Java, but you could do it in a batch script.

https://github.com/Explv/osbot_manager/blob/master/osbot_manager/src/bot_parameters/configuration/Configuration.java#L347

Essentially:

1. Collect all the PIDs of running OSBot clients.

2. Start a new OSBot process

3. Collect all the PIDs of running OSBot clients.

4. Check which PID has been added by comparing the two lists

By doing this you can store which PID is associated to which OSBot client, so when you want to close that client, you just kill the process.

OMG you even added linux support! You saved me so much time, thank you so much! ❤️

Link to comment
Share on other sites

Lovely solution from Explv.

Though it's this exact reason why I waited for Java 9 to come out back in September.

If you launch your OSBot processes externally (as with Explvs launcher) you can use Java 9 Process API

https://www.javaworld.com/article/3176874/java-language/java-9s-other-new-enhancements-part-3.html

Makes it easy to get PID's, kill processes and etc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...