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.

Entity cannot be resolved into a class.

Featured Replies

The rocks you are referring to is actually an object of type "RS2Object" 

 

The reason it's coming up as a red line is you might not have added the OSBot jar to your build path.

  • Author

The rocks you are referring to is actually an object of type "RS2Object" 

 

The reason it's coming up as a red line is you might not have added the OSBot jar to your build path.

I am pretty sure that's one of the first things the guide i'm following instructed me to do. akikZMW.png

Did you use the wrong import :')

 Entity i = objects.closest("lol");

gives no errors to me using the osbot entity import.


Oh the picture you posted on the other thread shows that you didnt import entity... plz sir


put this at the top:

import org.osbot.rs07.api.model.Entity;

and remove any other import with the word entity in it.

  • Author

XMZDf0k.png

 

I fixed the first error but that made another error here. 

Edited by aerospacedoor

XMZDf0k.png

at the bottom you before the last bracket you need to add something like

return random(lowInt, Highint);
//eg
return random(250,500);

because its an int it needs to return an int in the end and in this case thats the sleep before the script polls again

  • Author

EDIT**

at the bottom you before the last bracket you need to add something like

return random(lowInt, Highint);
//eg
return random(250,500);

because its an int it needs to return an int in the end and in this case thats the sleep before the script polls again

ksmBxx4.png

 

I thought I had fixed my error until I found this, what does this mean?

Edited by aerospacedoor

Thank you again you are very help-full smile.png. Error fixed, you helped fix my problems but I still don't understand stuff like int needing to return to and int and mostly all of it but I am picking things up slowly.

to not:

Void

Public void myVoid(){
//Do something here and return nothing, just do whats coded
}

String

public String myString(){
//code to figure out what string to return
}

//eg.

public String getName(Item item){
if(item != null){
return item.getName();
}
}

//which would be called like
Item banana = blah blah blah;
String bananaName = getName(banana);


int

 

public int randomInt(int low, int high){
    Random random = new Random();
    return random.nextInt((high - low) + 1) + low;
}

//which if used like
int i = randomInt(1,10);
//would generate a random number between 1 and 10 inclusive.

boolean

 

public boolean isAnimating(){
 return myPlayer.getAnimation() != -1;
}

//which would return true if you're doing anything but walking/standing still

doing things like this are a good way of getting what you want but giving you the ability to incorporate alot of factors of your own

EDIT**

ksmBxx4.png

 

I thought I had fixed my error until I found this, what does this mean?

what is red lined?

it might just be telling you its an unused import since you called it as an entity, just remove the import line for it and see if its fixed

It doesn't matter if he uses the entity interface. Just know he probably has the wrong entity Import

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.