Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to auto kill long running clients on Windows?

Featured Replies

Hey - looking to kill any clients which run for more than >30 minutes on Windows; preferably via a batch file/exe.

I know they exist for Linux in shell file sofmr; such as;

#!/bin/bash
# This script will kill process which running more than X hours
# egrep: the selected process; grep: hours
PIDS="`ps eaxo bsdtime,pid,comm | egrep "spamd|exim|mysqld|httpd" | grep " 1:" | awk '{print $2}'`"

# Kill the process
echo "Killing spamd, exim, mysqld and httpd processes running more than one hour..."
for i in ${PIDS}; do { echo "Killing $i"; kill -9 $i; }; done;

Just wondering if anyone has ever found a way to kill clients (via process ID/the program name - OSBot.jar) which exceed the time limit set? (In this case 30 minutes).

This is to kill tutorial island clients which either don't connect to the proxy and/or get stuck - to prevent CPU hogging of the server.

 

Thanks

11 minutes ago, Void said:

Hey - looking to kill any clients which run for more than >30 minutes on Windows; preferably via a batch file/exe.

 

Personally I store all booted credentials and if a client with those details doesn't post back to the server within X time It's killed via pid by CLI username
Windows I use

WMIC path win32_process get Caption,Processid,Commandline

to output CLI/PID/ECT, just loop through each line of the proccess output until line contains details
then after removing all double spaces down to 1 space gaps only

 String pid = s.split(" ")[s.split(" ").length - 1];
 String cli = s.substring(s.indexOf("java -jar")).replace(pid, "");

now we got those we can

Taskkill /PID "+ pid+ " /F"


For linux I have something similar
but

ps -fea|grep -i *CLI USERNAME*

than same as above, make all multiple spaces 1 space gaps

String pid = s.split(" ")[1];
//Note CLI output will depend on if you're running debug mode or not, if you are it'll be the exact args else it'll be the clients main args which are a little more annoying to rip
                       if (s.contains("java -jar")) {
                            cli = s.substring(s.indexOf("java -jar"));
                        }else if(!s.contains("java -jar")) {
                            cli = s.substring((s.indexOf("BotApplication") + ("BotApplication").length()));
                        }

and for the killarino

"kill -9 "+pid;



 

You need to know the Process ID's (PID) to kill the clients, if you start the clients via a Java application you can for example store the PID and a 'started' timestamp in a list for each client. Let a separate thread iterate trough the list and check if the timestamp is older than 30 minutes, if it is kill the process using the PID and remove it from the list.

Or do what @Isolate said.

Edited by Rudie

  • Author
58 minutes ago, Isolate said:

Personally I store all booted credentials and if a client with those details doesn't post back to the server within X time It's killed via pid by CLI username
Windows I use


WMIC path win32_process get Caption,Processid,Commandline

to output CLI/PID/ECT, just loop through each line of the proccess output until line contains details
then after removing all double spaces down to 1 space gaps only


 String pid = s.split(" ")[s.split(" ").length - 1];
 String cli = s.substring(s.indexOf("java -jar")).replace(pid, "");

now we got those we can


Taskkill /PID "+ pid+ " /F"


For linux I have something similar
but


ps -fea|grep -i *CLI USERNAME*

than same as above, make all multiple spaces 1 space gaps


String pid = s.split(" ")[1];
//Note CLI output will depend on if you're running debug mode or not, if you are it'll be the exact args else it'll be the clients main args which are a little more annoying to rip
                       if (s.contains("java -jar")) {
                            cli = s.substring(s.indexOf("java -jar"));
                        }else if(!s.contains("java -jar")) {
                            cli = s.substring((s.indexOf("BotApplication") + ("BotApplication").length()));
                        }

and for the killarino


"kill -9 "+pid;



 

Thanks for the replies  

Where do you store the booted credentials?

35 minutes ago, Void said:

Thanks for the replies  

Where do you store the booted credentials?

I just have a jar called the "manager"
that I run which I launch clients through, they're stored in  a hashmap of String for username and long for the time that client should be filtered and killed because it didn't post back
Once it's posted it's socket back it'll move from the pending list to a client list which'll just be String for the username and in my case BotCommunicationClient for the communication 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.