Package rsb.methods
Class Store
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Store
Store related operations.
-
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods -
Method Summary
Modifier and TypeMethodDescriptionbooleanbuy(int itemID, int count) Tries to buy an item.booleanclose()Closes the store interface.Gets the store interface.getItem(int id) Gets the first item found with the given id.getItemAt(int index) Gets the item at a given component index.RSItem[]getItems()Gets all the items in the store inventory.booleanisOpen()Returns whether the store interface is open.
-
Method Details
-
buy
public boolean buy(int itemID, int count) Tries to buy an item. 0 is All. 1, 5 and 10 use buy 1/5/10 while the other numbers use buy x.- Parameters:
itemID- The id of the item.count- The number to buy.- Returns:
trueon success
-
close
public boolean close()Closes the store interface.- Returns:
trueif the interface is no longer open
-
getInterface
Gets the store interface.- Returns:
- the store
RSWidget
-
getItemAt
Gets the item at a given component index.- Parameters:
index- The index of the component based off of the components in the Store interface.- Returns:
RSWidgetfor the item at the given index; otherwise null.
-
getItem
Gets the first item found with the given id.- Parameters:
id- ID of the item to get- Returns:
- The
RSWidgetof the item; otherwise null.
-
getItems
Gets all the items in the store inventory.- Returns:
- An
RSWidgetarray representing all of the components in the storesRSWidget.
-
isOpen
public boolean isOpen()Returns whether the store interface is open.- Returns:
trueif the store interface is open, otherwisefalse.
-