Consumables

Group
player
Methods
12
Fields
None

Getting one

player:consumables()

Methods

MethodReturnsDescription
poisonState(){ isPoisoned: boolean, isVenomed: boolean, incomingDamage: number, rawValue: number }Poison and venom state, and incoming damage with it.
curePoison(number?)booleanCure poison or venom with the best potion carried, else Cure Me.
consumeFood(number?, boolean?)booleanEat one food when hitpoints are low. Any carried food that heals counts, karambwans included, but the gout tuber, Recipe for Disaster's que…
consumeKarambwanFood(number?, boolean?)booleanEat food and a karambwan together in one tick, or neither: the combo eat.
consumeTripleFood(boolean?)booleanEat food, a karambwan and drink a Saradomin brew together in one tick, or none of them. Whatever of the three is carried; no hitpoints gate.
consumePrayerRestore(number?)booleanDrink a prayer restore when prayer points are low enough.
consumeMagicBoost(number?)booleanDrink a magic boost when it has run down.
consumeStrengthBoost(number?)booleanDrink a strength boost when it has run down.
consumeAttackBoost(number?)booleanDrink an attack boost when it has run down.
consumeDefenceBoost(number?)booleanDrink a defence boost when it has run down.
consumeRangingBoost(number?)booleanDrink a ranging boost when it has run down.
consumeEnergyPotion()booleanTop up run energy: below 5% an energy potion; below 40% with no stamina buff running a stamina potion; otherwise nothing.

Returned by

MethodReturnsDescription
PlayerDomain.consumablesConsumablesFood, potions, and poison cures.

Method details

poisonState

poisonState: (Consumables) -> { isPoisoned: boolean, isVenomed: boolean, incomingDamage: number, rawValue: number }

Poison and venom state, and incoming damage with it.

curePoison

curePoison: (Consumables, number?) -> boolean

Cure poison or venom with the best potion carried, else Cure Me.

Venom is always cured. Poison is cured when no threshold is given, or when incoming poison damage has reached it.

damageThreshold
Only cure poison at or above this damage.
Returns
false when not afflicted, or below the threshold.

consumeFood

consumeFood: (Consumables, number?, boolean?) -> boolean

Eat one food when hitpoints are low. Any carried food that heals counts, karambwans included, but the gout tuber, Recipe for Disaster's quest foods and rock cakes. Fewest bites first (a cake is 3), then inventory order; tick-eat foods (karambwans, halibut, the gnome foods) after all the rest.

threshold
Eat at or below this boosted hitpoints level. Omit to eat at or below 60% of real hitpoints with a food that would not overheal, or at 5 hitpoints or fewer.
includeBlighted
Whether blighted food counts. Omit for the default: only inside the Wilderness.
Returns
false when there is no food, or it is not time to eat.

consumeKarambwanFood

consumeKarambwanFood: (Consumables, number?, boolean?) -> boolean

Eat food and a karambwan together in one tick, or neither: the combo eat.

threshold
Eat at or below this boosted hitpoints level.
includeBlighted
Whether blighted food counts. Omit for the default.

consumeTripleFood

consumeTripleFood: (Consumables, boolean?) -> boolean

Eat food, a karambwan and drink a Saradomin brew together in one tick, or none of them. Whatever of the three is carried; no hitpoints gate.

includeBlighted
Whether blighted food counts. Omit for the default.

consumePrayerRestore

consumePrayerRestore: (Consumables, number?) -> boolean

Drink a prayer restore when prayer points are low enough.

atOrBelowPoints
Drink at or below this many prayer points; default 10.

consumeMagicBoost

consumeMagicBoost: (Consumables, number?) -> boolean

Drink a magic boost when it has run down.

boostLeftAtMost
Drink when at most this much of the boost is left (boosted level less real level); default 5.

consumeStrengthBoost

consumeStrengthBoost: (Consumables, number?) -> boolean

Drink a strength boost when it has run down.

boostLeftAtMost
As consumeMagicBoost's.

consumeAttackBoost

consumeAttackBoost: (Consumables, number?) -> boolean

Drink an attack boost when it has run down.

boostLeftAtMost
As consumeMagicBoost's.

consumeDefenceBoost

consumeDefenceBoost: (Consumables, number?) -> boolean

Drink a defence boost when it has run down.

boostLeftAtMost
As consumeMagicBoost's.

consumeRangingBoost

consumeRangingBoost: (Consumables, number?) -> boolean

Drink a ranging boost when it has run down.

boostLeftAtMost
As consumeMagicBoost's.

consumeEnergyPotion

consumeEnergyPotion: (Consumables) -> boolean

Top up run energy: below 5% an energy potion; below 40% with no stamina buff running a stamina potion; otherwise nothing.