Guest User

Untitled

a guest
Jul 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /**
  2. * Clicks on an object.
  3. * @author Speed
  4. * @param object
  5. * The RSObject to click on
  6. * @param action
  7. * The action to select at the object.
  8. * @return <tt>true</tt> if the object was clicked; otherwise
  9. * <tt>false</tt>.
  10. */
  11. private boolean atObject(final RSObject object, final String action) {
  12. RSTile objects = object.getLocation();
  13. if (objects.getX() != -1 && objects.getY() != -1) {
  14. if (distanceTo(objects) < 8) {
  15. if (tileOnScreen(objects)) {
  16. moveMouse(Calculations.tileToScreen(objects));
  17. if (getMenuActions().contains(action)) {
  18. if (getMenuActions().get(0).contains(action)) {
  19. clickMouse(true);
  20. return true;
  21. } else {
  22. clickMouse(false);
  23. atMenu(action);
  24. return true;
  25. }
  26. }
  27. } else
  28. turnToTile(objects);
  29. } else {
  30. if (tileOnMap(objects)) {
  31. walkTileMM(objects);
  32. }
  33. }
  34. }
  35. return false;
  36. }
Add Comment
Please, Sign In to add comment