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 TypeMethodDescriptionboolean
buy
(int itemID, int count) Tries to buy an item.boolean
close()
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.boolean
isOpen()
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:
true
on success
-
close
public boolean close()Closes the store interface.- Returns:
true
if 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:
RSWidget
for 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
RSWidget
of the item; otherwise null.
-
getItems
Gets all the items in the store inventory.- Returns:
- An
RSWidget
array representing all of the components in the storesRSWidget
.
-
isOpen
public boolean isOpen()Returns whether the store interface is open.- Returns:
true
if the store interface is open, otherwisefalse
.
-