Consumables¶
Manages consumable items like food and potions.
It handles loading, inventory scanning, and consumption logic with cooldowns and effects.
Enum ERSConsumable¶
ERSConsumable = (BOOST, ENERGY, POISON, ANTIFIRE);
Defines the categories of consumables available.
type TRSConsumableItem¶
Represents a single consumable item with its properties.
type TRSBoostItem¶
Represents a single boost item with its properties.
TRSBoostItem.Points¶
property TRSBoostItem.Points: Integer;
property TRSBoostItem.Points(value: Integer);
Getter and setter Points property.
Only set a new value if you want to permanently override it.
type TRSConsumables¶
Manages all aspects of item consumption.
Consumables.Setup¶
procedure TRSConsumables.Setup(consumable: ERSConsumable);
procedure TRSConsumables.Setup(skill: ERSSkill); overload;
Sets up the specified type of consumable.
To setup a ERSConsumable.BOOST you should use a ERSSkill value instead with
the ERSSkill you want to boost.
For example, to setup food, prayer potions and antifires you would do the following:
Consumables.Setup(ERSSkill.HITPOINTS);
Consumables.Setup(ERSSkill.PRAYER);
Consumables.Setup(ERSConsumable.ANTIFIRE);
TRSConsumables.Enable¶
procedure TRSConsumables.Enable(consumable: ERSConsumable; item: TRSItem);
procedure TRSConsumables.Enable(boost: ERSSkill; item: TRSItem); overload;
Enabled a specific item to use for a category.
If this is not used any item available will that is valid for the category will be used.
TRSConsumables.Find¶
function TRSConsumables.Find(consumable: ERSConsumable): TRSConsumableItemArray;
function TRSConsumables.Find(boost: ERSSkill): TRSBoostItemArray; overload;
Scans inventory for all consumables of a specific category.
TRSConsumables.HasEnoughPoints¶
function TRSConsumables.HasEnoughPoints(consumable: ERSConsumable): Boolean;
function TRSConsumables.HasEnoughPoints(skill: ERSSkill): Boolean; overload;
Checks if total points of a consumable type meet the MinInvPoints threshold.
TRSConsumables.CanConsume¶
function TRSConsumables.CanConsume(consumable: ERSConsumable): Boolean;
function TRSConsumables.CanConsume(boost: ERSSkill): Boolean; overload;
Checks if a consumable can be used, considering active effects.
TRSConsumables.Consume¶
function TRSConsumables.Consume(consumable: ERSConsumable): Boolean;
function TRSConsumables.Consume(skill: ERSSkill): Boolean; overload;
Consumes the best item of a specified category from inventory.