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.

IP Display Changer

Featured Replies

Changes your OSBot frame title to show your current IP address of your bot.

 

Source

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import javax.swing.*;
import java.awt.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

@ScriptManifest(author = "Purple", name = "IP Display Changer", version = 1.01, info = "Changes the title of your osbot to display your bots IP address.", logo = "")
public class Display extends Script {

    @Override
    public int onLoop() throws InterruptedException {
        changeFrameTitle("OSBot (" + getCurrentIPAddress() + ")");
        stop(false);
        return 0;
    }

    public void changeFrameTitle(final String title) {
        for(Frame frame : Frame.getFrames()) {
            if(frame.isVisible() && frame.getTitle().startsWith("OSBot")) {
                SwingUtilities.invokeLater(() -> frame.setTitle(title));
                break;
            }
        }
    }

    public String getCurrentIPAddress() {
        try {
            URL url = new URL("http://myip.dnsomatic.com/");
            BufferedReader b = new BufferedReader(new InputStreamReader(url.openStream()));
            String ip = b.readLine();
            b.close();
            return ip;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "null";
    }
}
 

Aaes83X.png

  • Author

where do i have to safe this ?

 

You have to compile it and save it to your scripts folder located in 

 

C:\Users\YOUR_NAME_HERE\OSBot\Scripts

Wouldn't this be less intensive if this was in the onStart() instead on onLoop() since you only need to set the IP once? Nice job anyways

Wouldn't this be less intensive if this was in the onStart() instead on onLoop() since you only need to set the IP once? Nice job anyways

emote32342.png

 @Override
    public int onLoop() throws InterruptedException {
        changeFrameTitle("OSBot (" + getCurrentIPAddress() + ")");
        stop(false);
        return 0;
    }
changeFrameTitle("OSBot (" + getCurrentIPAddress() + ")");
stop(false);
stop(false);
since you only need to set the IP once

 

facep.gif

 

Edited by Rudie

  • 4 weeks later...

Wouldn't this be less intensive if this was in the onStart() instead on onLoop() since you only need to set the IP once? Nice job anyways

 

 

emote32342.png

 @Override
    public int onLoop() throws InterruptedException {
        changeFrameTitle("OSBot (" + getCurrentIPAddress() + ")");
        stop(false);
        return 0;
    }
changeFrameTitle("OSBot (" + getCurrentIPAddress() + ")");
stop(false);
stop(false);

facep.gif

XD

 

onstart is still the proper use tho.

how do i get this compiled?

same, i have eclipse i just have no idea what to do with this code =[

can someone do a massive solid for me and compile this? It'll save me the hour or two figuring it out :D 

  • 6 months later...

Create an account or sign in to comment

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.