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.

How do I format correctly?

Featured Replies

Hey!
Maybe for some its stupid question, but personally I after using java for so long, I've never had to use nor graphics so deep or used color codes that much.

So my question:
Situation is 

        g.setColor(Color.BLUE);

        g.drawString("blabla" + someStringVariable), 20, 50);

So how can I keep that blabla or whatever as blue and change variable color to I don't know, to yellow? Like how can I make it happen, or is there any chance that I can change colors in drawString with colorcodes?

Dunno, my english isn't perfect, but I'm giving my best :D 

 

If I understand your problem correctly you want to do something like blabla someStringVariable in one drawString call?

I don't think it's possible to do it in one drawString call, but this works, taken from https://stackoverflow.com/questions/23591034/how-to-use-multiple-colors-when-using-drawstring-in-java-awt-graphics
 

public class Test extends Script {

    private static final String s = "<html>all your <font color=\"#ffd700\">base</font> belong to us</html>";
    private JLabel renderer = new JLabel(s);
    private CellRendererPane crp = new CellRendererPane();
    private Dimension dim = renderer.getPreferredSize();

    @Override
    public int onLoop() throws InterruptedException {
        return 10000;
    }
    @Override
    public void onPaint(Graphics2D g) {
        renderer.setForeground(Color.BLUE);
        crp.paintComponent(g, renderer, bot.getBotPanel(), 10, 10, dim.width, dim.height);
    }

}

 

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.