WALK TO GRAND EXCHANGE - OV
I am honestly not sure how well I went with this but I understand it's not too complicated, It was more of a learning project to me and I thought why not release it to see if there's any feedback to come from it. Enjoy!
import com.epicbot.api.shared.script.LoopScript;
import com.epicbot.api.shared.script.ScriptManifest;
import com.epicbot.api.shared.APIContext;
import com.epicbot.api.shared.GameType;
import com.epicbot.api.shared.util.paint.frame.PaintFrame;
import com.epicbot.api.shared.webwalking.model.RSBank;
import java.awt.*;
@ScriptManifest(name = "Walk to Grand Exchange", gameType = GameType.OS)
public class Main extends LoopScript {
private boolean walking = false;
@Override
public boolean onStart(String... strings) {
if (getAPIContext().client().isLoggedIn()) {
return true;
}
else {
return false;
}
}
@Override
protected int loop() {
if (walking == false) {
if (!RSBank.GRAND_EXCHANGE.getTile().getArea().contains(getAPIContext().localPlayer().get().getLocation())) {
walking = true;
getAPIContext().webWalking().walkToBank(RSBank.GRAND_EXCHANGE);
walking = false;
}
else {
return -1;
}
return -1;
}
return 1000;
}
@Override
protected void onPaint(Graphics2D g, APIContext ctx) {
PaintFrame frame = new PaintFrame("Walk to GE - Ov");
frame.addLine("Walking: ", walking);
frame.draw(g, 0, 120, ctx);
}
}