Jump to content

Interacting with objects and other misc problems


caseywyka

Recommended Posts

Here's part of my method that i need explanation on how to use it properly and what it truly does (api wasn't helping me)

 

Character.interact("Cross","Wilderness Ditch",true,20,true,true);

 

Cant make static reference to non static method

 

I thought this method im calling will interact with the object using that option if its within 20 squares away and will move the camera pitch if necessary.

 

Can someone please explain how to do this properly?

 

Also side note - Is there a method for toggling run or do i have to hard code mouse points and such?

Thanks! - Caseywyka

 

(credit for help will be left in script when done)

 

 

Link to comment
Share on other sites

You can't call a static method in a non-static method, so you'll have to make a variable and interact with it that way.

 

Example:

RS2Object ditch = closestObjectForName("Wilderness Ditch");
ditch.interact("Cross");

You can enable/disable running with this:

setRunning(true); //This turns it on
setRunning(false); //This shuts it off
  • Like 1
Link to comment
Share on other sites

 

You can't call a static method in a non-static method, so you'll have to make a variable and interact with it that way.

 

 

 

I think you meant it the other way around. You can call static methods from a non-static method, but you can't call non-static methods from a static context (static context includes calling from a static method and calling through the class name instead of an instance)

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