Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package eWildyPrayerBot.tasks;
- import net.runelite.api.coords.WorldPoint;
- import simple.hooks.scripts.task.Task;
- import simple.hooks.wrappers.SimpleObject;
- import simple.robot.api.ClientContext;
- import simple.robot.utils.WorldArea;
- public class WalkingTo extends Task {
- private static final WorldPoint EX_TILE = new WorldPoint(2955, 3317, 0);
- public static WorldArea sacraficeArea = new WorldArea(new WorldPoint(2957, 3819, 0), new WorldPoint(2947, 3822, 0));
- public static WorldArea exchangerea = new WorldArea(new WorldPoint(2958, 3824, 0), new WorldPoint(2969, 3824, 0), new WorldPoint(2969, 3814, 0), new WorldPoint(2958, 3811, 0), new WorldPoint(2949, 3811, 0), new WorldPoint(2953, 3817, 0), new WorldPoint(2953, 3818, 0), new WorldPoint(2954, 3819, 0), new WorldPoint(2958, 3819, 0));
- public WalkingTo(ClientContext ctx) {
- super(ctx);
- }
- public boolean condition() {
- return ctx.inventory.populate().filter(536).population() == 0 && !exchangerea.containsPoint(ctx.players.getLocal().getLocation());
- }
- public void run() {
- if (!sacraficeArea.containsPoint(ctx.players.getLocal().getLocation()) && ctx.pathing.reachable(EX_TILE)) {
- ctx.updateStatus("Walking to sacrafice bones");
- ctx.pathing.step(EX_TILE);
- ctx.sleep(600);
- } else if (!sacraficeArea.containsPoint(ctx.players.getLocal().getLocation()) && !ctx.pathing.reachable(EX_TILE)) {
- ctx.updateStatus("Walking to sacrafice bones");
- SimpleObject door = ctx.objects.populate().filter("Large door").nearest().next();
- ctx.updateStatus("Opening doors");
- door.click("Open");
- ctx.onCondition(() -> {
- return ctx.pathing.reachable(EX_TILE);
- });
- }
- }
- @Override
- public String status() {
- return "Walking to Exchange";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement