Advertisement
Guest User

Untitled

a guest
May 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public class Chop extends MethodProvider {
  2. private String name;
  3. private Area area;
  4.  
  5. public Chop(final String name, final Area area) {
  6. this.area = area;
  7. this.name = name;
  8. }
  9.  
  10. private RS2Object getGameObject() {
  11. return getObjects().closest(i -> i.getName().equals(name) && area.contains(i) && i.hasAction("Chop down"));
  12. }
  13.  
  14. public boolean uInteract() {
  15. final RS2Object go = getGameObject();
  16. if (go == null) return false;
  17. if (go.isVisible()) {
  18. return go.interact("Chop down");
  19. }
  20. return getWalking().webWalk(go.getPosition());
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement