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.

Adding ( Polygon Shape ) help

Featured Replies

Hello guys, I need help adding a Polygon Shape in to my target object, I dont know whats wrong with my code..

Best regards, Mr Pro Pop.

Thanks In Advance!

 

 

here is the code:

import java.awt.Color;
import java.awt.Graphics2D;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Mr Pro Pop", info = "", logo = "", name = "woodcutting", version = 1)
public class wc extends Script {

	public void chop() throws InterruptedException {

		if (!myPlayer().isAnimating() && !getInventory().isFull()) {
			RS2Object tree = getObjects().closest("Tree");
			tree.interact("Chop down");
		}
	}


	public int onLoop() throws InterruptedException {
		chop();
		sleep(random(100+1800,2100));
		return 0;
	}

	public void onPaint(Graphics2D g) {
		Color color1 = new Color(255, 255, 255, 255);
		g.setColor(color1);
		RS2Object tree = getObjects().closest("Tree");
		int x = tree.getPosition().getX();
		int y = tree.getPosition().getY();
		int h = tree.getHeight();
		g.drawRect(x, y, 75, h);

	}
}

Edited by Mr Pro Pop

 

Hello guys, I need help adding a Polygon Shape in to my target object, I dont know whats wrong with my code..

Best regards, Mr Pro Pop.

Thanks In Advance!

 

 

here is the code:

import java.awt.Color;
import java.awt.Graphics2D;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Mr Pro Pop", info = "", logo = "", name = "woodcutting", version = 1)
public class wc extends Script {

	public void chop() throws InterruptedException {

		if (!myPlayer().isAnimating() && !getInventory().isFull()) {
			RS2Object tree = getObjects().closest("Tree");
			tree.interact("Chop down");
		}
	}


	public int onLoop() throws InterruptedException {
		chop();
		sleep(random(100+1800,2100));
		return 0;
	}

	public void onPaint(Graphics2D g) {
		Color color1 = new Color(255, 255, 255, 255);
		g.setColor(color1);
		RS2Object tree = getObjects().closest("Tree");
		int x = tree.getPosition().getX();
		int y = tree.getPosition().getY();
		int h = tree.getHeight();
		g.drawRect(x, y, 75, h);

	}
}

you should use conditional sleeps instead of random sleeps also couldn't you just use a uhh bounding box is that for npc's only idk

  • Author

you should use conditional sleeps instead of random sleeps also couldn't you just use a uhh bounding box is that for npc's only idk

Okay bro ill use conditional sleeps.

anyways i dont know how to add the bounding box, can you provide me with the code please.. ?

Polygon is a 2D shape. Your tree is in 3D space.

so what do i need to do, any method to get it working ?

Okay bro ill use conditional sleeps.

anyways i dont know how to add the bounding box, can you provide me with the code please.. ?

so what do i need to do, any method to get it working ?

Graphics2D paints on your canvas, not in runescape space, so you can't paint based on runescape coordinates. You need to project the 3D runescape space coordinates onto the camera plane to get the actual position on the canvas of a game object. Take a look at the GraphicUtilities class, everything you need should be there.

  • Author

Graphics2D paints on your canvas, not in runescape space, so you can't paint based on runescape coordinates. You need to project the 3D runescape space coordinates onto the camera plane to get the actual position on the canvas of a game object. Take a look at the GraphicUtilities class, everything you need should be there.

I tryed but couldnt get it to work with me, can you please provide me with the code, Will really appreciate. Thanks wink.png

Edited by Mr Pro Pop

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.