I am trying to create a larger script than usual, so I want to use multiple files for it.
Now I have the main script that starts up, but I have to use the methods of "MethodProvider" in the OSBot API in the other class too. Something like:
MainScript.java
private DoWalkPath path;
@Override
public void onStart() {
path = new DoWalkPath(); // This is just an example name, I don't want the other class just to walk...
}
@Override
public int onLoop() throws InterruptedException {
switch (state) {
case WALKING_TO_BANK:
path.walk(); // This is what I want
break;
}
return 3;
}
DoWalkPath.java
public void walk() {
openTab(Tabs.Magic);
selectInterfaceOption(271, 23, "Cast"); // Teleport or something
sleep(random(5000, 6000)); // Wait for teleport
walk(Position); // Walk from there
}
Now I can't use "walk()" as I don't have access to the MethodProvider in that other class.
I tried extending the MethodProvider, but I every value is null (client etc).