Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Clicks on an object.
- * @author Speed
- * @param object
- * The RSObject to click on
- * @param action
- * The action to select at the object.
- * @return <tt>true</tt> if the object was clicked; otherwise
- * <tt>false</tt>.
- */
- private boolean atObject(final RSObject object, final String action) {
- RSTile objects = object.getLocation();
- if (objects.getX() != -1 && objects.getY() != -1) {
- if (distanceTo(objects) < 8) {
- if (tileOnScreen(objects)) {
- moveMouse(Calculations.tileToScreen(objects));
- if (getMenuActions().contains(action)) {
- if (getMenuActions().get(0).contains(action)) {
- clickMouse(true);
- return true;
- } else {
- clickMouse(false);
- atMenu(action);
- return true;
- }
- }
- } else
- turnToTile(objects);
- } else {
- if (tileOnMap(objects)) {
- walkTileMM(objects);
- }
- }
- }
- return false;
- }
Add Comment
Please, Sign In to add comment