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.
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);
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.HasAmount¶
function TRSItem.HasAmount(): Boolean;
Checks if the TRSItem
has “doses” or “charges”.
Example:
item := 'Amulet of glory(6)';
WriteLn item.HasAmount(); //true
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.GetStackBox¶
function TRSItem.GetStackBox(slot: TBox): TBox; static;
Returns the correct text box of an item’s amount text based on the item box.
Item.ReadStack¶
function TRSItem.ReadStack(slot: TBox): Integer; static;
For use with items in like bankscreen, inventory, shops and so on to get the number of stacked items there are.
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