ShopAPI
ShopAPI - methods for interacting with shops.
ClassRLPlugins API
public class ShopAPIMembers
Static methods
- voidbuy1(String)
Buy 1 of an item from the shop by its name.
- voidbuy1(int)
Buy 1 of an item from the shop by its id.
- voidbuy10(String)
Buy 10 of an item from the shop by its name.
- voidbuy10(int)
Buy 10 of an item from the shop by its id.
- voidbuy5(String)
Buy 5 of an item from the shop by its name.
- voidbuy5(int)
Buy 5 of an item from the shop by its id.
- voidbuy50(String)
Buy 50 of an item from the shop by its name.
- voidbuy50(int)
Buy 50 of an item from the shop by its id.
- voidbuyAction(int, int, int)
Send a buy action for a shop item.
- voidbuyX(String, int)
Purchases the amount of the desired item.
- voidbuyX(int, int)
Purchases the amount of the desired item.
- voidclose()
Closes the shop interface.
- ItemExgetShopItem(String)
Get an item by its name from the shop container.
- ItemExgetShopItem(int)
Get an item by its id from the shop container.
- intgetStockQuantity(String)
Get the shops current quantity of an item.
- intgetStockQuantity(int)
Get the shops current quantity of an item.
- booleanisOpen()
Whether open.
- voidsell1(String)
Sell 1 of an item from inventory by its name.
- voidsell1(int)
Sell 1 of an item from inventory by its id.
- voidsell10(String)
Sell 10 of an item from inventory by its name.
- voidsell10(int)
Sell 10 of an item from inventory by its id.
- voidsell5(String)
Sell 5 of an item from inventory by its name.
- voidsell5(int)
Sell 5 of an item from inventory by its id.
- voidsell50(String)
Sell 50 of an item from inventory by its name.
- voidsell50(int)
Sell 50 of an item from inventory by its id.
- voidsellAction(int, int, int)
Send a sell action for an inventory item.
- voidsellX(String, int)
Sells the amount of the desired item.
- voidsellX(int, int)
Sells the amount of the desired item.
- booleanshopContains(String)
Check if a shop currently has an item in stock.
- booleanshopContains(int)
Check if a shop currently has an item in stock.
buy1(String)static
public static void buy1(String itemName)Buy 1 of an item from the shop by its name.
Parameters
itemName- Item name.
buy1(int)static
public static void buy1(int itemId)Buy 1 of an item from the shop by its id.
Parameters
itemId- Item id.
buy10(String)static
public static void buy10(String itemName)Buy 10 of an item from the shop by its name.
Parameters
itemName- Item name.
buy10(int)static
public static void buy10(int itemId)Buy 10 of an item from the shop by its id.
Parameters
itemId- Item id.
buy5(String)static
public static void buy5(String itemName)Buy 5 of an item from the shop by its name.
Parameters
itemName- Item name.
buy5(int)static
public static void buy5(int itemId)Buy 5 of an item from the shop by its id.
Parameters
itemId- Item id.
buy50(String)static
public static void buy50(String itemName)Buy 50 of an item from the shop by its name.
Parameters
itemName- Item name.
buy50(int)static
public static void buy50(int itemId)Buy 50 of an item from the shop by its id.
Parameters
itemId- Item id.
buyAction(int, int, int)static
public static void buyAction(int itemId, int slot, int action)Send a buy action for a shop item.
Parameters
itemId- Item id.
slot- Slot in shop inventory.
action- Action type (2=buy1, 3=buy5, 4=buy10, 5=buy50).
buyX(String, int)static
public static void buyX(String itemName, int purchaseAmount)Purchases the amount of the desired item.
Stops when the amount purchased is reached, the item is out of stock, or you've hit the 10 actions per tick cap.
Parameters
itemName- The name of the item to purchase.
purchaseAmount- The amount of the item to purchase.
buyX(int, int)static
public static void buyX(int itemId, int purchaseAmount)Purchases the amount of the desired item.
Stops when the amount purchased is reached, the item is out of stock, or you've hit the 10 actions per tick cap.
Parameters
itemId- The ID of the item to purchase. See
net.runelite.api.gameval.ItemID. purchaseAmount- The amount of the item to purchase.
close()static
public static void close()Closes the shop interface.
getShopItem(String)static
public static ItemEx getShopItem(String itemName)Get an item by its name from the shop container.
Parameters
itemName- Item name.
Returns
Item.
getShopItem(int)static
public static ItemEx getShopItem(int itemId)Get an item by its id from the shop container.
Parameters
itemId- Item id.
Returns
Item.
getStockQuantity(String)static
public static int getStockQuantity(String itemName)Get the shops current quantity of an item.
Parameters
itemName- Item name.
Returns
Quantity.
getStockQuantity(int)static
public static int getStockQuantity(int itemId)Get the shops current quantity of an item.
Parameters
itemId- Item id.
Returns
Quantity.
isOpen()static
public static boolean isOpen()Whether open.
Returns
True if the shop window is open.
sell1(String)static
public static void sell1(String itemName)Sell 1 of an item from inventory by its name.
Parameters
itemName- Item name.
sell1(int)static
public static void sell1(int itemId)Sell 1 of an item from inventory by its id.
Parameters
itemId- Item id.
sell10(String)static
public static void sell10(String itemName)Sell 10 of an item from inventory by its name.
Parameters
itemName- Item name.
sell10(int)static
public static void sell10(int itemId)Sell 10 of an item from inventory by its id.
Parameters
itemId- Item id.
sell5(String)static
public static void sell5(String itemName)Sell 5 of an item from inventory by its name.
Parameters
itemName- Item name.
sell5(int)static
public static void sell5(int itemId)Sell 5 of an item from inventory by its id.
Parameters
itemId- Item id.
sell50(String)static
public static void sell50(String itemName)Sell 50 of an item from inventory by its name.
Parameters
itemName- Item name.
sell50(int)static
public static void sell50(int itemId)Sell 50 of an item from inventory by its id.
Parameters
itemId- Item id.
sellAction(int, int, int)static
public static void sellAction(int itemId, int slot, int action)Send a sell action for an inventory item.
Parameters
itemId- Item id.
slot- Slot in player inventory.
action- Action type (0=sell1, 1=sell5, 2=sell10, 3=sell50).
sellX(String, int)static
public static void sellX(String itemName, int sellAmount)Sells the amount of the desired item.
Stops when the amount sold is reached, you run out of items, or you've hit the 10 actions per tick cap.
Parameters
itemName- The name of the item to sell.
sellAmount- The amount of the item to sell.
- Can wait for the game. Call it only from
VitaPlugin.loop(); in a@Subscribemethod it freezes the game.
sellX(int, int)static
public static void sellX(int itemId, int sellAmount)Sells the amount of the desired item.
Stops when the amount sold is reached, you run out of items, or you've hit the 10 actions per tick cap.
Parameters
itemId- The ID of the item to sell.
sellAmount- The amount of the item to sell.
- Can wait for the game. Call it only from
VitaPlugin.loop(); in a@Subscribemethod it freezes the game.
shopContains(String)static
public static boolean shopContains(String itemName)Check if a shop currently has an item in stock.
Parameters
itemName- Item name.
Returns
Boolean.
shopContains(int)static
public static boolean shopContains(int itemId)Check if a shop currently has an item in stock.
Parameters
itemId- Item id.
Returns
Boolean.
Also allowed
Every class has these, as in plain Java.
equals, toString