Package org.rsbot.script.wrappers

Examples of org.rsbot.script.wrappers.RSComponent.doClick()


        }
        sleep(random(50, 100));
      }
    }
    RSComponent exitToComponent = methods.interfaces.getComponent(INTERFACE_LOGOUT, lobby ? 2 : 13);
    if (exitToComponent != null && exitToComponent.doClick()) {
      sleep(random(1500, 2000));
    }
    return !isLoggedIn();
  }
View Full Code Here


  public boolean mouseChatButton(final ChatButton button, final boolean left) {
    if (button == null || (left && isButtonSelected(button))) {
      return false;
    }
    final RSComponent chatButton = methods.interfaces.getComponent(CHAT_OPTION, button.idx());
    return chatButton.isValid() && chatButton.doClick(left);
  }

  /**
   * Opens the specified tab at the specified index.
   *
 
View Full Code Here

    public boolean add(final String name) {
      if (name != null && !name.isEmpty()) {
        openTab();
        final RSComponent c = methods.interfaces.getComponent(FriendsList.FRIENDSLIST, FriendsList.FRIENDSLIST_BUTTON_ADD_FRIEND);
        if (c != null) {
          c.doClick();
          sleep(random(300, 550));
          methods.keyboard.sendText(name, true);
          sleep(random(600, 800));
          return getFriend(name) != null;
        }
View Full Code Here

     */
    public boolean remove(final String name) {
      if (name != null && getFriend(name) != null) {
        final RSComponent c = methods.interfaces.getComponent(FriendsList.FRIENDSLIST, FriendsList.FRIENDSLIST_BUTTON_REMOVE_FRIEND);
        if (c != null) {
          c.doClick();
          sleep(random(300, 550));
          methods.keyboard.sendText(name, true);
          sleep(random(600, 800));
          return getFriend(name) != null;
        }
View Full Code Here

    return null;
  }

  public boolean clickPlay() {
    RSComponent playComp = getComponent(INTERFACE_LOBBY_BUTTON_PLAY);
    return playComp != null && playComp.isValid() && playComp.doClick();
  }

  public int getSelectedTab() {
    int[] ids = new int[]{TAB_PLAYERS, TAB_WORLDS, TAB_FRIENDS, TAB_CLAN, TAB_OPTIONS, TAB_FRIENDS_CHAT};
    for (int id : ids) {
View Full Code Here

    if (getSelectedTab() == tab) {
      return true;
    }
    final RSComponent c = getComponent(tab);
    if (c != null && c.isValid()) {
      c.doClick();
    }
    return getSelectedTab() == tab;
  }

  public int getSelectedWorld() {
View Full Code Here

      return true;
    }
    final RSComponent comp = getWorldComponent(world);
    if (comp != null) {
      methods.interfaces.scrollTo(comp, methods.interfaces.getComponent(INTERFACE_LOBBY_WORLD_SELECT, INTERFACE_WORLD_SELECT_SCROLL_AREA));
      comp.doClick();
      sleep(random(500, 800));
      if (getSelectedWorld() == world) {
        if (enter) {
          methods.interfaces.getComponent(INTERFACE_LOBBY, INTERFACE_LOBBY_BUTTON_PLAY).doClick();
        }
View Full Code Here

        return random(1000, 2000);
      }
      for (int j = 0; j < 3; j++) {
        final RSComponent iface = interfaces.getComponent(184, 8).getComponent(j);
        if (iface.containsText(itemName)) {
          iface.doClick();
          return random(1000, 1200);
        }
      }
    }
    if (interfaces.canContinue()) {
View Full Code Here

   * @return <tt>true</tt> if the familiar was dismissed.
   */
  public boolean doDismiss() {
    RSComponent confirmInterface = methods.interfaces.getComponent(228, 2);
    if (confirmInterface.isValid()) {
      return confirmInterface.doClick();
    } else {
      RSComponent dismissInterface = methods.interfaces.getComponent(INTERFACE_TAB_SUMMONING, INTERFACE_TAB_SUMMONING_CHILD);
      if (dismissInterface != null && dismissInterface.interact("Dismiss")) {
        sleep(random(500, 750));
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.