Jump 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.

detecting ip changes

Featured Replies

EDIT 

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class IPListener {

    private static final String MY_IP_URL = "http://my-ip.heroku.com/";
    private static final String BAT_TO_RUN = "run.bat";

    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(MY_IP_URL).openConnection().getInputStream()));
        String initialIP = reader.readLine();
        reader.close();
        System.out.println("Initial IP: " + initialIP);
        System.out.println("Listening for change in IP address...");
        while (true) {
            reader = new BufferedReader(new InputStreamReader(new URL(MY_IP_URL).openConnection().getInputStream()));
            String currentIP = reader.readLine();
            reader.close();
            if (!initialIP.equals(currentIP)) {
                System.out.println("IP changed from " + initialIP + " to " + currentIP);
                Runtime.getRuntime().exec("cmd /c start " + BAT_TO_RUN);
                System.out.println(BAT_TO_RUN + " executed.");
                break;
            }
        }
    }

}

Came up with this but it spams the website every few milliseconds... they'll prob block me. The file run.bat is executed on IP change so you can put commands in there to kill java.exe or javaw.exe processes.

Edited by pork

Well an easy fix would be to just get a new VPN. What are you currently using?

  • Author

Witopia. But there is always a chance that any vpn could disconnect or my internet could disconnect and reconnect to runescape before reconnecting to VPN. I need a way to have my bots close if my ip address changes. Changing vpns isn't a solution for me because it can happen on any other one.

Code for ip changer killer

package ipchange;
import java.net.InetAddress;
import java.net.UnknownHostException;

import javax.swing.JFrame;


public class IpChange
{
	private static String ip;
	
	private static void kill(String string)
	{
	    try 
	    {
	      Runtime.getRuntime().exec("taskkill /F /IM " + string).waitFor();
	    } 
	    catch (Exception e) {}
	}
	
	public static void main(String[] args) throws UnknownHostException, InterruptedException
	{
		ip = InetAddress.getLocalHost().getHostAddress();
		JFrame frame = new JFrame();
		frame.setVisible(true);
		while(true)
		{
			System.out.println(InetAddress.getLocalHost().getHostAddress());
			if(!ip.equalsIgnoreCase(InetAddress.getLocalHost().getHostAddress()))
			{
				kill("javaw.exe");
				break;
			}
			Thread.sleep(5000);
		}
	}

}
 

 

Here is download link

 

https://www.dropbox.com/s/0w27kzkx3de417k/IpChange.jar

 

Also keep the JFRAME that it pops up open.... that is for the purpose of that it is still running

 

It will kill osbot when you disconnect from vpn 

 

Cheers smile.png

Edited by Anon

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.