_internal.classes.focus.train.TrainingFocusable - vladzaharia/bitburner GitHub Wiki
_internal/classes/focus/train.TrainingFocusable
Focusable managing training stats for faction requirements.
-
↳
TrainingFocusable
- _checkCombatStats
- _focus
- _getCombatFactions
- _getHackingFactions
- _learn
- _train
- canFocus
- focus
- getCheckInterval
- getDetailText
- getFocusTime
- getPriority
- shouldContinueRunning
- shouldRunInBackground
• new TrainingFocusable(ns, priority?)
Creates a focuser that manages training stats.
| Name | Type | Default value | Description |
|---|---|---|---|
ns |
NS |
undefined |
The Netscript object. |
priority |
number |
100 |
Priority this focuser should run at, defaults to 100. |
_internal/classes/focus/train.ts:29
• Private _currentTraining: undefined | Workouts | Courses
Current training or course being done.
_internal/classes/focus/train.ts:20
• Private _factionManager: FactionManager
Manager of factions
_internal/classes/focus/train.ts:17
• Protected _ns: NS
The Netscript object.
_internal/classes/focus/_base.ts:21
• name: string
The name of the focusable.
_internal/classes/focus/_base.ts:18
▸ Private _checkCombatStats(combat): boolean
Check combat stats against player.
| Name | Type | Description |
|---|---|---|
combat |
number |
Combat requirement to check against. |
boolean
True if player meets requirement with all stats, false otherwise.
_internal/classes/focus/train.ts:180
▸ Protected _focus(): boolean
Either train at the Powerhouse Gym, or study hacking at Rothman University.
boolean
True if the focus was successful, false otherwise.
_internal/classes/focus/train.ts:68
▸ Private _getCombatFactions(): Faction[]
Get factions needing a higher combat stat.
Faction[]
All factions which have combat requirement higher than current stats, sorted by requirement.
_internal/classes/focus/train.ts:141
▸ Private _getHackingFactions(): Faction[]
Get factions needing a higher hacking stat.
Faction[]
All factions which have hacking requirement higher than current stats, sorted by requirement.
_internal/classes/focus/train.ts:160
▸ Private _learn(course, university?): boolean
Take a course at a university.
| Name | Type | Default value | Description |
|---|---|---|---|
course |
Courses |
undefined |
The course to take. |
university |
string |
"Rothman University" |
University to take course at. |
boolean
True if was successful taking course.
_internal/classes/focus/train.ts:126
▸ Private _train(workout, gym?): boolean
Train a combat stat at a gym.
| Name | Type | Default value | Description |
|---|---|---|---|
workout |
Workouts |
undefined |
The stat to train. |
gym |
string |
"Powerhouse Gym" |
Gym to train at. |
boolean
True if was successful training.
_internal/classes/focus/train.ts:112
▸ canFocus(): boolean
Check if we need to train to meet faction requirements.
boolean
True if there's a faction which requires more combat or hacking experience.
_internal/classes/focus/train.ts:56
▸ focus(): number
Executes a focus action, returning a predefined sleep time.
number
_sleepTime if successful, -1 otherwise.
_internal/classes/focus/_base.ts:76
▸ getCheckInterval(): number
Gets how often to check for task completion, defaults to this._checkInterval.
number
How often to check for task completion.
BaseFocusable.getCheckInterval
_internal/classes/focus/_base.ts:118
▸ getDetailText(): string
Returns value from preset field.
string
Value of this._detailField if set, "" otherwise
_internal/classes/focus/_base.ts:137
▸ getFocusTime(): number
Get time needed for task, defaults to this._sleepTime.
number
The time to sleep before running the manager again.
_internal/classes/focus/_base.ts:109
▸ getPriority(): number
Returns priority 5 if multipliers make working within reach, default otherwise.
number
Priority for task.
_internal/classes/focus/train.ts:40
▸ shouldContinueRunning(): boolean
Checks if the player is still working.
virtual Can be overridden, but run super.shouldContinueRunning if you do.
boolean
True if user is still working, false otherwise.
BaseFocusable.shouldContinueRunning
_internal/classes/focus/_base.ts:128
▸ shouldRunInBackground(): boolean
Checks if the action should run in the background, defaults to if priority is > 50.
boolean
True if this can run in the background, False if it needs to be in the foreground.