# Consumables Manages consumable items like food and potions. It handles loading, inventory scanning, and consumption logic with cooldowns and effects. - - - (ERSConsumable)= ## Enum ERSConsumable ```pascal ERSConsumable = (BOOST, ENERGY, POISON, ANTIFIRE); ``` Defines the categories of consumables available. - - - (TConsumableItem)= ## type TConsumableItem Represents a single consumable item with its properties. - - - (TBoostItem)= ## type TBoostItem Represents a single boost item with its properties. - - - ## TBoostItem.Points ```pascal 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. - - - (TConsumables)= ## type TConsumables Manages all aspects of item consumption. - - - ## Consumables.Setup ```pascal 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: ```pascal Consumables.Setup(ESkill.HITPOINTS); Consumables.Setup(ESkill.PRAYER); Consumables.Setup(ERSConsumable.ANTIFIRE); ``` - - - ## TConsumables.Enable ```pascal 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 ```pascal function TConsumables.Find(consumable: ERSConsumable): TConsumableItemArray; function TConsumables.Find(boost: ESkill): TBoostItemArray; overload; ``` Scans inventory for all consumables of a specific category. - - - ## TConsumables.HasEnoughPoints ```pascal 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 ```pascal 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 ```pascal function TConsumables.Consume(consumable: ERSConsumable): Boolean; function TConsumables.Consume(skill: ESkill): Boolean; overload; ``` Consumes the best item of a specified category from inventory.