Examples of RSItem


Examples of org.rsbot.script.wrappers.RSItem

   * @param leftClick <tt>true</tt> for left button click, <tt>false</tt> for right
   *                  button.
   * @return <tt>true</tt> if item was selected, <tt>false</tt> if not.
   */
  public boolean clickSelectedItem(final boolean leftClick) {
    final RSItem item = getSelectedItem();
    return item != null && item.doClick(true);
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   * @param itemID The ID of items to destroy.
   * @return <tt>true</tt> if the items were destroyed; otherwise
   *         <tt>false</tt>.
   */
  public boolean destroyItem(final int itemID) {
    RSItem item = getItem(itemID);
    if (item == null || !item.hasAction("Destroy")) {
      return false;
    }
    while ((item = getItem(itemID)) != null) {
      if (methods.interfaces.get(94).isValid()) {
        methods.interfaces.getComponent(94, 3).doClick();
      } else {
        item.interact("Destroy");
      }
      sleep(random(700, 1100));
    }
    return true;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

      found_droppable = false;

      for (int j = 0; j < 28; j++) {
        final int c = leftToRight ? j % 4 : j / 7;
        final int r = leftToRight ? j / 4 : j % 7;
        final RSItem curItem = getItems()[c + r * 4];
        if (curItem != null) {
          int id = curItem.getID();
          if (id != -1) {
            boolean isInItems = false;
            for (final int i : ids) {
              if (i == id) {
                isInItems = true;
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

      methods.game.openTab(Game.Tab.INVENTORY);
    }
    if (col < 0 || col > 3 || row < 0 || row > 6) {
      return false;
    }
    final RSItem item = getItems()[col + row * 4];
    return item != null && item.getID() != -1 && item.interact("Drop");
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

    if (methods.game.getTab() != Game.Tab.INVENTORY
        && !methods.interfaces.get(Bank.INTERFACE_BANK).isValid()
        && !methods.interfaces.get(Store.INTERFACE_STORE).isValid()) {
      methods.game.openTab(Game.Tab.INVENTORY);
    }
    RSItem item = getItem(id);
    return item != null && item.getID() != -1 && item.interact("Drop");
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   * @param index The index of inventory item.
   * @return The item, or <tt>null</tt> if not found.
   */
  public RSItem getItemAt(final int index) {
    final RSComponent comp = getInterface().getComponent(index);
    return 0 <= index && index < 28 && comp != null ? new RSItem(methods,
        comp) : null;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   *
   * @param name The name of the item you wish to find.
   * @return The ID of the item or -1 if not in inventory.
   */
  public int getItemID(final String name) {
    final RSItem item = getItem(name);
    return item != null ? item.getID() : -1;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

        final RSItem[] inv = new RSItem[len];
        for (int i = 0; i < len; ++i) {
          final RSComponent item = comps[i];
          final int idx = item.getComponentIndex();
          if (idx >= 0) {
            inv[idx] = new RSItem(methods, item);
          } else {
            return new RSItem[0];
          }
        }
        return inv;
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   *
   * @param itemID The ID of the item to select.
   * @return <tt>true</tt> if the item was selected; otherwise <tt>false</tt>.
   */
  public boolean selectItem(final int itemID) {
    final RSItem item = getItem(itemID);
    return item != null && selectItem(item);
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   * @param item The item to select.
   * @return <tt>true</tt> if the item was selected; otherwise <tt>false</tt>.
   */
  public boolean selectItem(final RSItem item) {
    final int itemID = item.getID();
    RSItem selItem = getSelectedItem();
    if (selItem != null && selItem.getID() == itemID) {
      return true;
    }
    if (selItem != null) {
      selItem.interact("Use");
    }
    if (!item.interact("Use")) {
      return false;
    }
    for (int c = 0; c < 5 && (selItem = getSelectedItem()) == null; c++) {
      sleep(random(200, 300));
    }
    return selItem != null && selItem.getID() == itemID;
  }
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.