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 TConsumableItem¶
Represents a single consumable item with its properties.
type TBoostItem¶
Represents a single boost item with its properties.
TBoostItem.Points¶
property TBoostItem.Points: Integer;
property TBoostItem.Points(value: Integer);
Getter and setter Points property.
Only set a new value if you want to permanently override it.
type TConsumables¶
Manages all aspects of item consumption.
Consumables.Setup¶
procedure TConsumables.Setup(consumable: ERSConsumable);
procedure TConsumables.Setup(skill: ESkill); overload;
Sets up the specified type of consumable.
To setup a ERSConsumable.BOOST you should use a ESkill value instead with
the ESkill you want to boost.
For example, to setup food, prayer potions and antifires you would do the following:
Consumables.Setup(ESkill.HITPOINTS);
Consumables.Setup(ESkill.PRAYER);
Consumables.Setup(ERSConsumable.ANTIFIRE);
TConsumables.Enable¶
procedure TConsumables.Enable(consumable: ERSConsumable; item: TItem);
procedure TConsumables.Enable(boost: ESkill; item: TItem); 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.
TConsumables.Find¶
function TConsumables.Find(consumable: ERSConsumable): TConsumableItemArray;
function TConsumables.Find(boost: ESkill): TBoostItemArray; overload;
Scans inventory for all consumables of a specific category.
TConsumables.HasEnoughPoints¶
function TConsumables.HasEnoughPoints(consumable: ERSConsumable): Boolean;
function TConsumables.HasEnoughPoints(skill: ESkill): Boolean; overload;
Checks if total points of a consumable type meet the MinInvPoints threshold.
TConsumables.CanConsume¶
function TConsumables.CanConsume(consumable: ERSConsumable): Boolean;
function TConsumables.CanConsume(boost: ESkill): Boolean; overload;
Checks if a consumable can be used, considering active effects.
TConsumables.Consume¶
function TConsumables.Consume(consumable: ERSConsumable): Boolean;
function TConsumables.Consume(skill: ESkill): Boolean; overload;
Consumes the best item of a specified category from inventory.