mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 14:12:27 +01:00
06a985bdf8
This reverts commit bbb6e3f309935aebac74ddb1fbeec12dfb7540b1.
844 B
844 B
Home > bitburner > Bladeburner > getStamina
Bladeburner.getStamina() method
Get bladeburner stamina.
Signature:
getStamina(): [number, number];
Returns:
number, number
Array containing current stamina and max stamina.
Remarks
RAM cost: 4 GB Returns an array with two elements: * [Current stamina, Max stamina]
Example 1
// NS1:
function getStaminaPercentage() {
var res = bladeburner.getStamina();
return res[0] / res[1];
}
Example 2
// NS2:
function getStaminaPercentage() {
const [current, max] = ns.bladeburner.getStamina();
return current / max;
}