Jump to content

Contant errors


BloodRush20

Recommended Posts

Once I load up the latest jar all i constantly get is a message telling me that I cant make static references when i'm just using a method from the regular api. I get these errors constantly and they wont go away. I've seen others who wrote their code the same way so why am i getting the errors using eclipse btw set up as it should.

Link to comment
Share on other sites

It sounds like you're using non-static API methods in static context.

This would imply doing something like this:

Inventory.getItems()

 

rather than the correct approach using an instance of the Inventory class

getInventory().getItems()

 

NOTE: That is if the current class inherits from a MethodProvider, which the Script class does.

Link to comment
Share on other sites

Post a snippet of the code in question with the relevant stack trace and we can try debug it for you.

startExp = Skills.getExperience(Skill.MAGIC);
Mouse.click(true);
Bank.open();

Here are some small examples all pulling the same static error I didnt know calling the bank open method could be a static method. Or I have picked up bad habits from other api's i've used.

 

Frost I didnt know there was such a difference in the wording there I never saw the getinventory only the inventory itself in the api.

 

Also while im here is there a equivlent to Game in you api such as Game.logout(false);

Edited by BloodRush20
Link to comment
Share on other sites

startExp = Skills.getExperience(Skill.MAGIC);
Mouse.click(true);
Bank.open();

Here are some small examples all pulling the same static error I didnt know calling the bank open method could be a static method. Or I have picked up bad habits from other api's i've used.

 

Frost I didnt know there was such a difference in the wording there I never saw the getinventory only the inventory itself in the api.

 

Also while im here is there a equivlent to Game in you api such as Game.logout(false);

 

The api is not static.

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...