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.

Problems defining Position[]

Featured Replies

When defining a position array like so:

	private Position[] path = {
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

I get an error on new Position

Cannot instantiate the type Position 

Any Ideas on what is causing this? Both tutorials available for walking haven't helped. 
Any help?

 

//Pizza

Edited by PizzaBoxBoy2

When defining a position array like so:

	private Position[] path = {
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

I get an error on new Position

Cannot instantiate the type Position 

Any Ideas on what is causing this? Both tutorials available for walking haven't helped. 

Any help?

private Position[] path = new Position[]{
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

Make sure you are using the OSBot API import.


That is:

org.osbot.rs07.api.map.Position

and not:

javax.swing.text.Position
  • Author

Thanks. Couldent find the import, and it had auto imported javax in an odd spot. 

Thanks a ton :D

//Pizza

Thanks. Couldent find the import, and it had auto imported javax in an odd spot. 

Thanks a ton biggrin.png

//Pizza

 

Dw it's a common mistake, glad you solved it :D

private Position[] path = new Position[]{
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

 

This doesn't matter, since you can initiliaze with just {} behind your declaration ;)

If you initialize it later on you have to do it this way :D

When defining a position array like so:

	private Position[] path = {
  		     new Position(3165, 3481, 0),
  		     new Position(3164, 3471, 0),
  		     new Position(3157, 3462, 0),
  		     new Position(3145, 3456, 0),
  		     new Position(3131, 3453, 0),
  		     new Position(3121, 3451, 0),
  		     new Position(3116, 3449, 0)
	};

I get an error on new Position

Cannot instantiate the type Position 

Any Ideas on what is causing this? Both tutorials available for walking haven't helped. 

Any help?

 

//Pizza

 

Recheck your imports :)

Use the osbot import instead <3

 

Khaleesi

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.