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.

onPaint

Featured Replies

Paint seems to be broken.

The images and the text i'm attempting to input are not coming up.


	static Timer runTime;
	URL paintUrl;
	URL hideUrl;
	Image paintImg;
	Image hideImg;

	public long starttime;
	public long timeran = System.currentTimeMillis() - starttime;
	public long currenttime;
	int startinglvl;
	int startingxp;
	int looted;
	int walk;
	int deaths;
	public int statID;
	public int seedID;
	public int compID;
	String status;
	public static boolean started = false; // for gui
	public static boolean trainstat2 = false;
	public static Image image;
	
	public void onStart() {
		runTime = new Timer(0);
		status = "Starting up..";
		starttime = System.currentTimeMillis();

		try {
			paintUrl = new URL(
					"https://dl.dropboxusercontent.com/u/76706937/bitterfarmformat.png");
		} catch (MalformedURLException e1) {
			e1.printStackTrace();
		}

		try {
			paintImg = ImageIO.read(paintUrl);
		} catch (IOException e1) {
			e1.printStackTrace();
		}

		try {
			hideUrl = new URL(
					"https://dl.dropboxusercontent.com/u/76706937/hideshowpaint.png");
		} catch (MalformedURLException e1) {
			e1.printStackTrace();
		}

		try {
			hideImg = ImageIO.read(hideUrl);
		} catch (IOException e1) {
			e1.printStackTrace();
		}

	}
	
	
	public void onPaint(Graphics2D g) {
		

		long currenttime = System.currentTimeMillis();
		long timeran = currenttime - starttime;


		g.setColor(new Color(255, 255, 255));
		g.setFont(new Font("Arial", Font.BOLD, 17));

		//if (!hide) {


			g.drawImage(paintImg, -1, 208, 520, 273, null);

			g.drawString(" " + format(System.currentTimeMillis() - starttime),
					324, 360);
			g.drawString(" " + looted, 308, 378);
			g.drawString(" " + getPerHour(looted, timeran), 328, 398);
			g.drawString(" " + (looted * 204), 341, 415);
			g.drawString(" " + getPerHour(looted * 204, timeran), 316, 435);
			g.drawString(" " + walk, 308, 452);
			g.drawString(" " + status, 308, 470);

		//} else {
			// if boolean says hidden then draws image where you want it to be

			g.drawImage(hideImg, 498, 341, 16, 16, null);
			// usually just a simple 'X' or show paint

		//}

	}

I've tried several things. I'm looking for input.

I'm not asking to be spoon-fed, just a little guidance or reassurance that this isn't a bug.

change

public void onPaint(Graphics2D g) {

To

public void onPaint(Graphics g) {

result:

 

Profit.

change

public void onPaint(Graphics2D g) {

To

public void onPaint(Graphics g) {

result:

 

Profit.

They switched the argument to Graphics2D in OSB2.

 

For the love of God just use one catch block.

They switched the argument to Graphics2D in OSB2.

 

Didn't know. I begin that adventure tonight.

Edited by Kirito

Solved with this:

try {
			paintUrl = new URL(
					"https://dl.dropboxusercontent.com/u/76706937/bitterfarmformat.png");
			hideUrl = new URL(
					"https://dl.dropboxusercontent.com/u/76706937/hideshowpaint.png");
		} catch (MalformedURLException e1) {
			e1.printStackTrace();
		}
		

		try {
			paintImg = ImageIO.read(paintUrl);
			hideImg = ImageIO.read(hideUrl);
		} catch (IOException e1) {
			e1.printStackTrace();
		}

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.