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.

Change Title/Icon of OSBot

Featured Replies

I needed a easy way to track which bot is running which account, so yeah.

You can change the Title and the icon with this. Have fun :DPreview_Title.gif.a707d74dfe0e46990651fd3f543d66fc.gif

Spoiler

import sun.swing.SwingAccessor;

import javax.swing.*;
import java.awt.*;
import java.awt.image.*;

public class OSBotBar {
    private static Image iconNormal;
    private static Image iconRed;
    private static Image iconGreen;
    private static JFrame frame;
    private static String title;

    public static void setTitle(String name){
        if(frame == null)
            getFrame();
        if(title == null)
            title = frame.getTitle();

        if (frame != null) {
            frame.setTitle(title + " - " + name);
        }
    }

    public static void setIcon(Icon icon){
        if(iconNormal == null || iconRed == null || iconGreen == null)
            getIcons();

        switch (icon){
            case GREEN:
                frame.setIconImage(iconGreen);
                break;
            case RED:
                frame.setIconImage(iconRed);
                break;
            default:
                frame.setIconImage(iconNormal);
        }
    }

    private static void getIcons(){
        if(frame == null)
            getFrame();

        iconNormal = frame.getIconImage();

        ImageProducer prodRed = new FilteredImageSource( iconNormal.getSource(), new ColorFilter(0xffff0000) );
        ImageProducer prodGreen = new FilteredImageSource( iconNormal.getSource(), new ColorFilter(0xff00ff00) );

        iconRed = frame.createImage(prodRed);
        iconGreen = frame.createImage(prodGreen);
    }

    private static void getFrame(){
        Window[] windows = Window.getWindows();
        for (Window window : windows) {
            if (window instanceof JFrame) {
                JFrame jFrame = (JFrame) window;
                if (jFrame != null && jFrame.getTitle().contains("OSBot ")) {
                    frame = jFrame;
                }
            }
        }
    }

    public enum Icon{
        STANDARD,
        RED,
        GREEN
    }
}

class ColorFilter extends RGBImageFilter
{
    private int filter;
    public ColorFilter(int filter)
    {
        this.filter = filter;
        canFilterIndexColorModel = true;
    }
    public int filterRGB( int x, int y, int rgb )
    {
        return (rgb & filter);
    }
}

 

Nice work. Also, you don't need to use getFrame when you can do:

Window w = SwingUtilities.getWindowAncestor(bot.getCanvas());
JFrame f = (JFrame) w;
f.setTitle("TEST");

 

Edited by liverare

  • Author

I'm new to java and more to the java gui, nice one you got there ?

That's pretty cool.

This is an awesome idea, nicely done. since with java 10 you can break down the Main java process to display the child process names, you could manually set it to "runelite" and maybe help avoid the "auto detection system" (if they ever coded one to check child processes, I've yet to see it in an OSRS deob).

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.