Examples of RSItem


Examples of org.rsbot.script.wrappers.RSItem

   * @param targetID The item ID you want the first parameter to be used on.
   * @return <tt>true</tt> if the first item has been "used" on the other;
   *         otherwise <tt>false</tt>.
   */
  public boolean useItem(final int itemID, final int targetID) {
    final RSItem item = getItem(itemID);
    final RSItem target = getItem(targetID);
    return item != null && target != null && useItem(item, target);
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   * @param object The RSObject you want the item to be used on.
   * @return <tt>true</tt> if the "use" action had been used on both the
   *         RSItem and RSObject; otherwise <tt>false</tt>.
   */
  public boolean useItem(final int itemID, final RSObject object) {
    final RSItem item = getItem(itemID);
    return item != null && useItem(item, object);
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

  public RSItem[] getItemsOffered() {
    List<RSItem> items = new ArrayList<RSItem>();
    for (int i = 0; i < 28; i++) {
      RSComponent component = methods.interfaces.get(INTERFACE_TRADE_MAIN).getComponent(INTERFACE_TRADE_MAIN_THEIR).getComponent(i);
      if (component != null && component.getComponentStackSize() != 0) {
        items.add(new RSItem(methods, component));
      }
    }
    return items.toArray(new RSItem[items.size()]);
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

    }
    if (!isOpen()) {
      return false;
    }
    final int inventoryCount = methods.inventory.getCount(true);
    final RSItem item = getItem(itemID);
    if (item != null) {
      if (count >= 500) {
        if (item.interact("Buy 500")) {
          sleep(random(500, 700));
          return buy(itemID, (count - 500));
        } else {
          return false;
        }
      } else if (count >= 50 && count < 500) {
        if (item.interact("Buy 50")) {
          sleep(random(500, 700));
          return buy(itemID, (count - 50));
        } else {
          return false;
        }
      } else if (count >= 10 && count < 50) {
        if (item.interact("Buy 10")) {
          sleep(random(500, 700));
          return buy(itemID, (count - 10));
        } else {
          return false;
        }
      } else if (count >= 5 && count < 10) {
        if (item.interact("Buy 5")) {
          sleep(random(500, 700));
          return buy(itemID, (count - 5));
        } else {
          return false;
        }
      } else if (count >= 1 && count < 5) {
        if (item.interact("Buy 1")) {
          sleep(random(500, 700));
          return buy(itemID, (count - 1));
        } else {
          return false;
        }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

    final ArrayList<RSItem> items = new ArrayList<RSItem>();
    final RSComponent[] components = getInterface().getComponent(INTERFACE_STORE_ITEMS).getComponents();

    for (final RSComponent component : components) {
      if (component != null && component.getComponentID() != -1) {
        items.add(new RSItem(methods, component));
      }
    }

    return items.toArray(new RSItem[items.size()]);
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

            SELECTED_REWARD = getSelectedReward();
            log.info("Selecting " + SELECTED_REWARD.name() + " as reward");
        }
        switch (getState()) {
            case OPEN_RANDOM:
                RSItem item = inventory.getItem(Values.ACTIVATION_ITEMS);
                if (item != null && item.doClick(true)) {
                  for (int i = 0; i < 35; i++) {
                    if (interfaces.get(Values.INTERFACE_MAIN_BOX).isValid() || interfaces.get(Values.INTERFACE_XP_SELECTION).isValid()) {
                      break;
                    }
                    sleep(100);
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   */
  public RSItem[] getItems() {
    final RSItem[] items = new RSItem[slotArray.length];
    for (int i = 0; i < slotArray.length; i++) {
      final RSComponent equip = getInterface().getComponent(slotArray[i].componentID());
      items[i] = new RSItem(methods, equip);
    }
    return items;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   */
  public RSItem[] getWornItems() {
    final int[] equip = methods.players.getMyPlayer().getEquipment();
    final RSItem[] items = new RSItem[slotArray.length];
    for (int i = 0; i < items.length; i++) {
      items[i] = new RSItem(methods, equip[i], 1);
    }
    return items;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

  public RSItem[] getCachedItems() {
    final RSInterface equipment = methods.interfaces.get(INTERFACE_EQUIPMENT);
    final RSComponent[] components = equipment.getComponents();
    final RSItem[] items = new RSItem[slotArray.length];
    for (int i = 0; i < items.length; i++) {
      items[i] = new RSItem(methods, components[slotArray[i].componentID()]);
    }
    return items;
  }
View Full Code Here

Examples of org.rsbot.script.wrappers.RSItem

   *
   * @param index The item index.
   * @return The equipped item.
   */
  public RSItem getItem(final int index) {
    return new RSItem(methods, getInterface().getComponents()[index]);
  }
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.