Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. package eWildyPrayerBot.tasks;
  2.  
  3. import net.runelite.api.coords.WorldPoint;
  4. import simple.hooks.scripts.task.Task;
  5. import simple.hooks.wrappers.SimpleObject;
  6. import simple.robot.api.ClientContext;
  7. import simple.robot.utils.WorldArea;
  8.  
  9. public class WalkingTo extends Task {
  10.  
  11. private static final WorldPoint EX_TILE = new WorldPoint(2955, 3317, 0);
  12. public static WorldArea sacraficeArea = new WorldArea(new WorldPoint(2957, 3819, 0), new WorldPoint(2947, 3822, 0));
  13. 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));
  14.  
  15. public WalkingTo(ClientContext ctx) {
  16. super(ctx);
  17. }
  18.  
  19. public boolean condition() {
  20. return ctx.inventory.populate().filter(536).population() == 0 && !exchangerea.containsPoint(ctx.players.getLocal().getLocation());
  21.  
  22. }
  23.  
  24. public void run() {
  25. if (!sacraficeArea.containsPoint(ctx.players.getLocal().getLocation()) && ctx.pathing.reachable(EX_TILE)) {
  26. ctx.updateStatus("Walking to sacrafice bones");
  27. ctx.pathing.step(EX_TILE);
  28. ctx.sleep(600);
  29.  
  30. } else if (!sacraficeArea.containsPoint(ctx.players.getLocal().getLocation()) && !ctx.pathing.reachable(EX_TILE)) {
  31. ctx.updateStatus("Walking to sacrafice bones");
  32. SimpleObject door = ctx.objects.populate().filter("Large door").nearest().next();
  33. ctx.updateStatus("Opening doors");
  34. door.click("Open");
  35. ctx.onCondition(() -> {
  36. return ctx.pathing.reachable(EX_TILE);
  37. });
  38. }
  39. }
  40.  
  41. @Override
  42. public String status() {
  43. return "Walking to Exchange";
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement