Item¶
Page dedicated to runescape items and misc functions related to them.
Quantity Constants¶
QUANTITY_ALL = 0;
QUANTITY_ALL_BUT_ONE = -1;
In WaspLib you have this 2 constants to use in interfaces that allows you to specify “all” quantities of items, e.g. the Bank interface.
ITEM_SHADOW¶
ITEM_SHADOW: TColor = $202030;
TColor of an item gray shadow. This shadow value will change between clients
(check ERSClient) and depending on the client certain interfaces being
open will also change it to ITEM_SHADOW_GRAY, e.g. the Bank
with Legacy or RuneLite.
Example:
WriteLn ITEM_SHADOW; //$202030
ITEM_SHADOW_GRAY¶
ITEM_SHADOW_GRAY: TColor = $333333;
TColor of an item gray shadow. This shadow value will change between clients
(check ERSClient) and depending on the client certain interfaces being
open will also change it, e.g. the Bank with Legacy or RuneLite.
Example:
WriteLn ITEM_SHADOW; //$333333
ITEM_BORDER¶
ITEM_BORDER: TColor = $010000;
TColor of an item border. This value will change between clients
(check ERSClient).
Example:
WriteLn ITEM_BORDER; //$010000
ITEM_BORDER_WHITE¶
ITEM_BORDER_WHITE: TColor = $FFFFFF;
TColor of a selected item border. This value will change between clients
(check ERSClient).
Example:
WriteLn ITEM_BORDER_WHITE; //$FFFFFF
ERSItemQuantity¶
ERSItemQuantity = enum(ONE, FIVE, TEN, CUSTOM, ALL);
General purpose item quantity enum.
ERSItemQuantity.Integer2Quantity¶
function ERSItemQuantity.Integer2Quantity(quantity: Integer): ERSItemQuantity; static;
Internal helper function to convert a integer quantity into a ERSItemQuantity.
Example:
WriteLn ERSItemQuantity.Integer2Quantity(5);
WriteLn ERSItemQuantity.Integer2Quantity(7);
ERSItemQuantity.String2Quantity¶
function ERSItemQuantity.String2Quantity(str: String): ERSItemQuantity; static;
Internal helper function to convert a string quantity into a ERSItemQuantity.
Example:
WriteLn ERSItemQuantity.String2Quantity('5');
WriteLn ERSItemQuantity.String2Quantity('7');
WriteLn ERSItemQuantity.String2Quantity('All');
ERSStack¶
ERSStack = enum(YELLOW, WHITE, GREEN);
Enum representing the types of item stacks available.
ERSStack.Color¶
property ERSStack.Color: TColor;
Returns a TColor of a ERSStack.
ERSStack.YELLOWshould be stacks between0and99.999.ERSStack.WHITEshould be stacks between100.000and9.999.999and are shown with aKrepresenting the 3 least significant digits, e.g.9.999.999would be seen as9999K.ERSStack.GREENshould be stacks between100.000and9.999.999and are shown with anMrepresenting the 6 least significant digits, e.g.999.999.999would be seen as999M.
Example:
WriteLn ERSStack.YELLOW.Color; //$00FFFF
WriteLn ERSStack.WHITE.Color; //$FFFFFF
WriteLn ERSStack.GREEN.Color; //$80FF00
ERSStack.Multiplier¶
property ERSStack.Multiplier: Integer;
Returns the “multiplier” of a ERSStack which are:
ERSStack.YELLOW: 0ERSStack.WHITE: 1000ERSStack.GREEN: 1000000
Example:
WriteLn ERSStack.YELLOW.Multiplier;
TRSItem¶
The main type that represents, well, a runescape item.
TRSItem is a type of String and therefore inherits all String methods.
TRSItemArray¶
Array type of TRSItem.
TRSItem.InBounds¶
function TRSItem.InBounds(bounds: TBox; fadeTolerance: Single = 8.5): Boolean; static;
Checks if the specified bounds has an item in it.
Example:
WriteLn TRSItem.InBounds(Inventory.Slots.Box(0));
TRSItem.HasAmount¶
function TRSItem.HasAmount(): Boolean;
Checks if the TRSItem has “doses” or “charges”.
Example:
item := 'Amulet of glory(6)';
WriteLn item.HasAmount(); //true
TRSItem.Spread¶
function TRSItem.Spread(): TRSItemArray;
Checks if the TRSItem has (a..b) in it’s name and will spread it into a
TRSItemArray.
Example:
item := 'prayer potion(1..4)';
WriteLn item.Spread(); ['prayer potion(1)', 'prayer potion(2)', 'prayer potion(3)'. 'prayer potion(4)']
item := 'prayer potion(2..1)';
WriteLn item.Spread(); ['prayer potion(2)', 'prayer potion(1)']
TRSItem.SimplifyName¶
function TRSItem.SimplifyName(): String;
Internal helper function to get a human like short item name, usually to search.
Example:
item := 'Amulet of glory(6)';
WriteLn item.SimplifyName();
Item.StackBox¶
property TRSItem.StackBox(slot: TBox): TBox; static;
Returns the correct text box of an item’s amount text based on the item box.
TRSItem.ReadStack¶
function TRSItem.ReadStack(slot: TBox): Integer; static;
For use with items in interfaces like bankscreen, inventory, shops and so on to get the number of stacked items.
TRSBankItem¶
Helper type to handle bank items better. This holds information about the item name, quantity and whether it’s noted or not.
TRSBankItemArray¶
Array type of TRSBankItem.
TRSBankItem.Construct¶
function TRSBankItem.Construct(item: TRSItem; quantity: Integer = QUANTITY_ALL_BUT_ONE): TRSBankItem; static;
Creates a TRSBankItem.
Example:
var
bankitem: TRSBankItem;
begin
bankitem := new TRSBankItem('abyssal whip', 1);
end.
TRSItem.ToBankItem¶
function TRSItem.ToBankItem(quantity: Integer = QUANTITY_ALL_BUT_ONE): TRSBankItem;
Returns a TRSBankItem based on the TRSItem in question with the specified
quantity.
Example:
item := 'Amulet of glory(6)';
WriteLn item.ToBankItem();
TRSBankItem.ToItem¶
function TRSBankItem.ToItem(): TRSItem;
The opposite of TRSItem.ToBankItem