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.

drawing and saving on image?

Featured Replies

Create image -> draw shapes or whatever on it -> save image with those graphic modifications

 

That's what I'd like to do.


nevermind got it lol

 

if anyone wants to clue me in on how to grab script paint in the onExit method before the bot itself clears it that would be great

v2?

Sth like

    @Override
    public void onExit() throws InterruptedException {
        System.out.println("Exit");
        try {
            takeScreenshoot();
        } catch (IOException e) {
            e.printStackTrace();
        }
        super.onExit();
    }

    private void takeScreenshoot() throws IOException {
        BufferedImage screenshoot = new BufferedImage(this.bot.getCanvas().getWidth(), this.getBot().getCanvas().getHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics2D graphics2D = screenshoot.createGraphics();
        final BufferedImage gameBuffer = this.bot.getCanvas().gameBuffer;
        graphics2D.drawImage(gameBuffer, 0, 0, null);
        this.onPaint(graphics2D);
        ImageIO.write(screenshoot, "png", new File("screenshot" + new Date(System.currentTimeMillis()).toString().replace(':', '-') + ".png"));
    }

9nBvWVi.png

  • Author

v2?

Sth like

public class ProgressReport {

	private Image image;

	private ProgressReport(Image image) {
		this.image = image;
	}

	public static ProgressReport getReport(Script sI) throws AWTException {
		Canvas c = sI.bot.getCanvas();
		return new ProgressReport(new Robot().createScreenCapture(new Rectangle(c.getX(), c.getY(), c.getWidth(), c.getHeight())));
	}

	public boolean save(String filename) throws IOException {
		Graphics imageGraphics = image.getGraphics();
		imageGraphics.setColor(Color.BLACK);
		imageGraphics.fillRect(7, 458, 71, 15);
		return ImageIO.write((BufferedImage) image, "png", new File(filename + ".png"));
	}

}

That's what I have however my issue is that I can't seem to grab the canvas with the script paint on it before the script exits sad.png

 

From what you can see above I tried using Toolkit as well but even that doesn't get the paint.

 

Also, what is the original gameBuffer representing?

Edited by Swizzbeat

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.