Examples of RSComponent


Examples of org.rsbot.script.wrappers.RSComponent

    }
    return null;
  }

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

Examples of org.rsbot.script.wrappers.RSComponent

  }

  public int getSelectedTab() {
    int[] ids = new int[]{TAB_PLAYERS, TAB_WORLDS, TAB_FRIENDS, TAB_CLAN, TAB_OPTIONS, TAB_FRIENDS_CHAT};
    for (int id : ids) {
      final RSComponent c = getComponent(id);
      if (c != null && c.isValid() && c.getTextureID() == 4671) {
        return id;
      }
    }
    return -1;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSComponent

  public boolean open(final int tab) {
    if (getSelectedTab() == tab) {
      return true;
    }
    final RSComponent c = getComponent(tab);
    if (c != null && c.isValid()) {
      c.doClick();
    }
    return getSelectedTab() == tab;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSComponent

      if (enter) {
        methods.interfaces.getComponent(INTERFACE_LOBBY, INTERFACE_LOBBY_BUTTON_PLAY).doClick();
      }
      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

Examples of org.rsbot.script.wrappers.RSComponent

    }
    if (!methods.interfaces.get(INTERFACE_LOBBY_WORLD_SELECT).isValid()) {
      open(TAB_WORLDS);
    }
    for (int i = 0; i < methods.interfaces.getComponent(INTERFACE_LOBBY_WORLD_SELECT, INTERFACE_WORLD_SELECT_WORLD_NAME).getComponents().length; i++) {
      final RSComponent comp = methods.interfaces.getComponent(INTERFACE_LOBBY_WORLD_SELECT, INTERFACE_WORLD_SELECT_WORLD_NAME).getComponents()[i];
      if (comp != null) {
        final String number = comp.getText();
        if (Integer.parseInt(number) == world) {
          return methods.interfaces.getComponent(INTERFACE_LOBBY_WORLD_SELECT, INTERFACE_WORLD_SELECT_WORLD_LIST).getComponents()[i];
        }
      }
    }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSComponent

        final long systemTime = System.currentTimeMillis();
        while (System.currentTimeMillis() - systemTime < 8000 && !interfaces.get(INTERFACE_GRAVE).isValid()) {
          sleep(50, 150);
        }
        sleep(1200, 2500);
        RSComponent inter;
        if ((inter = interfaces.getComponent(INTERFACE_GRAVE, INTERFACE_GRAVE_ID)) != null) {
          final int theID = inter.getComponentID();
          boolean found = false;
          for (Coffin coffin : coffins) {
            if (coffin.modelID == theID) {
              coffin.setStoneID(undecidedID);
              found = true;
View Full Code Here

Examples of org.rsbot.script.wrappers.RSComponent

   * @param parent The parent interface.
   * @param child  The child interface.
   * @return Clicked or not.
   */
  private boolean atCloseInterface(final int parent, final int child) {
    final RSComponent i = interfaces.getComponent(parent, child);
    if (!i.isValid()) {
      return false;
    }
    final Rectangle pos = i.getArea();
    if (pos.x == -1 || pos.y == -1 || pos.width == -1 || pos.height == -1) {
      return false;
    }
    mouse.click(i.getCenter(), 5, 5, true);
    sleep(500, 800);
    return true;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSComponent

   *
   * @return The users in the channel or null if unavailable
   */
  public ClanUser[] getUsers() {
    if (inChannel()) {
      RSComponent c = methods.interfaces.getComponent(INTERFACE_CLAN_CHAT, INTERFACE_CLAN_CHAT_USERS_LIST);
      if (c != null) {
        List<ClanUser> mates = new ArrayList<ClanUser>();
        for (RSComponent user : c.getComponents()) {
          if (user == null || user.getComponentName().isEmpty()) {
            continue;
          }
          String name = user.getComponentName();
          int userIndex = user.getComponentIndex();
          RSComponent rank = methods.interfaces.getComponent(INTERFACE_CLAN_CHAT, 10);
          rank = rank.getComponent(userIndex);
          RSComponent world = methods.interfaces.getComponent(INTERFACE_CLAN_CHAT, 11);
          world = world.getComponent(userIndex);
          mates.add(new ClanUser(name, rank, world));
        }
        return mates.toArray(new ClanUser[mates.size()]);
      }
    }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSComponent

  public boolean activateCondition() {
    return game.isLoggedIn() && objects.getNearest(INACTIVE_PILLARS) != null;
  }

  private int getScore() {
    final RSComponent score = interfaces.get(INTERFACE_PINBALL).getComponent(1);
    try {
      return Integer.parseInt(score.getText().split(" ")[1]);
    } catch (final java.lang.ArrayIndexOutOfBoundsException t) {
      return -1;
    }
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSComponent

          return random(4500, 5700);
        }
      }
      return random(500, 1000);
    }
    final RSComponent inter = searchInterfacesText("To exit,");
    if (inter != null) {
      for (int i = 0; i < colors.length; i++) {
        if (inter.getText().toLowerCase().contains(colors[i])) {
          door = objects.getNearest(doorIDs[i]);
          break;
        }
      }
      return random(500, 1000);
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.