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.

HScrollingLogger | Display messages dynamically and aesthetically.

Featured Replies

HScrollingLogger Code:

public class HScrollingLogger {

	private static int messagesDisplayed = 5;
	private static String[] messages = new String[messagesDisplayed];
	private final static DateFormat dateFormat = new SimpleDateFormat("HH:mm a");
	private static int i = 0;

	private final static Color backgroundColor = new Color(50, 205, 50);
	private final static Color textColor = new Color(0, 0, 0);

	private final static Font FONT = new Font("Arial", 0, 11);

	public static void add(String s) {
		messages[i] = (s + " | " + (dateFormat.format(new Date())));
		i = (i + 1) % messagesDisplayed;
	}

	public static void paintLog(int x, int y, Graphics g) {
		FontMetrics metrics = g.getFontMetrics(FONT);
		int height = metrics.getHeight();
		int descent = metrics.getDescent() - 5;
		int index = i;
		for (int messageIndex = 0; messageIndex < messagesDisplayed; messageIndex++) {
			index = index == 0 ? messagesDisplayed - 1 : index - 1;
			String s = messages[index];
			if (s == null) {
				break;
			}
			g.setColor(backgroundColor);
			g.fillRect(x - metrics.stringWidth(s) - 10, y + descent - height, metrics.stringWidth(s) + 10, height);
			g.setColor(textColor);
			g.setFont(FONT);
			g.drawString(s, x - metrics.stringWidth(s) - 5, y - 5);
			y -= 15;
		}
	}

} 

 

Usage:

HScrollingLogger.add("Started Script.");
HScrollingLogger.add("Test message 1.");
HScrollingLogger.add("Test message 2.");
HScrollingLogger.add("Test message 3.");
HScrollingLogger.add("Test message 4.");

...

@ Override
public void onPaint(Graphics2D g) {
HScrollingLogger.paintLog(516, 340, g);
}

What it looks like ingame:

29194745ce7ca4a32da9450caf9c4082.png

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.