Jump to content

The Full Paint Tutorial - All aspects covered - Pug Tutorials


Recommended Posts

Posted

Would love to see more stuff added in this thread but sadly the creator got banned.

If anyone could give me a hand with calculating xp/hour and some more stuff like an option to hide the paint or adding the status of what the bot is doing feel free to hit me up. happy.png

I'm also interested in changing the standard green text color etc.

 

I'm new to all this but I already learned quite a few things by trying out the things i've found here! smile.png

  • 2 weeks later...
  • 4 months later...
Posted (edited)

Great tutorial. Very useful! But i don't know if i'm doing this the right way. Do i need to set a background with: g.Fill or can i just create an image with everything in it.

 

 

Because when i do so, my TimeRan will not be displayed because the background overlays the TimeRan. Wich we dont want.

	public void onPaint(Graphics2D g) {
		timeRan = System.currentTimeMillis() - this.timeBegan;
		g.drawString(ft(timeRan), 158, 369); 
		g.setColor(Color.BLACK);
		g.drawImage(bg, 8, 334, null);
	}

Thanks alot,

 

OSRS Sebastian.

post-199385-0-02839000-1447146960_thumb.png

Edited by OSRS Sebastian
Posted (edited)

Great tutorial. Very useful! But i don't know if i'm doing this the right way. Do i need to set a background with: g.Fill or can i just create an image with everything in it.

 

 

Because when i do so, my TimeRan will not be displayed because the background overlays the TimeRan. Wich we dont want.

	public void onPaint(Graphics2D g) {
		timeRan = System.currentTimeMillis() - this.timeBegan;
		g.drawString(ft(timeRan), 158, 369); 
		g.setColor(Color.BLACK);
		g.drawImage(bg, 8, 334, null);
	}

Thanks alot,

 

OSRS Sebastian.

	Image getImage(String url) {
		try {
			return ImageIO.read(new URL(url));
		} catch (IOException e) {
		}
		return null;
	}

	Image picture = getImage("http://i.imgur.com/vGxY3dv.jpg");

	@Override
	public void onPaint(Graphics2D g) {
		g.drawImage(picture, 7, 345, null);
                timeRan = System.currentTimeMillis() - this.timeBegan;
                g.drawString(ft(timeRan), 158, 369); 
	}

Another simple copy and paste for ya. Put the run time further down in the code. It goes from top to bottom when drawing the paint, so the run time gets covered if it's put first. Good luck smile.png

 

Edited by Shiny
  • Like 1
  • 11 months later...
  • 4 weeks later...
  • 4 weeks later...
  • 1 month later...
Posted

Thanks for the awesome guide! There's just one thing: In the "Adding Gold Made" section you mentioned that, to calculate the gp gained, you need to multiply the amount of items made by their price:

 

gpGained = itemsMade - costOfItem;

 

But in this case it's subtracting, and not multiplying, isn't it? Needs to be changed to:

 

gpGained = itemsMade * costOfItem;
  • Like 1
  • 3 weeks later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...