Jump to content

Entity cannot be resolved into a class.


aerospacedoor

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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