mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-30 01:47:33 +01:00
46 lines
838 B
Markdown
46 lines
838 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Bladeburner](./bitburner.bladeburner.md) > [getStamina](./bitburner.bladeburner.getstamina.md)
|
|
|
|
## Bladeburner.getStamina() method
|
|
|
|
Get bladeburner stamina.
|
|
|
|
**Signature:**
|
|
|
|
```typescript
|
|
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
|
|
|
|
|
|
```ts
|
|
// NS1:
|
|
function getStaminaPercentage() {
|
|
var res = bladeburner.getStamina();
|
|
return res[0] / res[1];
|
|
}
|
|
```
|
|
|
|
## Example 2
|
|
|
|
|
|
```ts
|
|
// NS2:
|
|
function getStaminaPercentage() {
|
|
const [current, max] = ns.bladeburner.getStamina();
|
|
return current / max;
|
|
}
|
|
```
|
|
|