How can i execute the customwebwalk from my main class?
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
@ScriptManifest(name = "Skeleton", author = "Alek", version = 1.0, info = "", logo = "")
public class Main extends Script {
CustomWebWalk customWebWalk;
@Override
public void onStart() {
//Code here will execute before the loop is started
Position destination = new Position(3144, 3485, 0); // Replace with desired destination coordinates
customWebWalk = new CustomWebWalk(destination);
customWebWalk.exchangeContext(getBot());
customWebWalk.onStart();
}
@Override
public int onLoop() throws InterruptedException {
if (customWebWalk != null) {
execute(customWebWalk);
} else {
log("Web walk null");
}
return 100; //The amount of time in milliseconds before the loop starts over
}
}
Something like this?
edit: i got it to execute but in asyncwalkevent class canperformaction is false.
private boolean canPerformAction() {
// Only allow the actions to start if the map destination is far enough away
Position dest = getMap().getDestination();
if (dest == null) return false;
int dist = getMap().distance(dest);
return dist < 20 && dist > 7;
}
Im trying to walk to edgeville from grand exchange.
Final edit: got it to work