_internal.classes.focus.crime.CrimeFocusable - vladzaharia/bitburner GitHub Wiki
_internal/classes/focus/crime.CrimeFocusable
Focusable managing crime.
-
↳
CrimeFocusable
- _focus
- _needToKill
- _needToLoseKarma
- _shouldExecute
- canFocus
- focus
- getCheckInterval
- getDetailText
- getFocusTime
- getPriority
- shouldContinueRunning
- shouldRunInBackground
• new CrimeFocusable(ns, priority?)
Creates a focuser that manages crime work.
| Name | Type | Default value | Description |
|---|---|---|---|
ns |
NS |
undefined |
The Netscript object. |
priority |
number |
150 |
Priority this focuser should run at, defaults to 50. |
_internal/classes/focus/crime.ts:37
• Private _crimeTime: undefined | number
Time to sleep, set when executing a task.
_internal/classes/focus/crime.ts:25
• Private _currentCrime: undefined | Crimes
Current crime being worked.
_internal/classes/focus/crime.ts:28
• 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
▸ Protected _focus(): boolean
Commit a crime.
boolean
True if crime was successful, false otherwise.
_internal/classes/focus/crime.ts:55
▸ Private _needToKill(): boolean
Check if we need to kill someone.
boolean
True if we still need to kill for a faction invitation.
_internal/classes/focus/crime.ts:111
▸ Private _needToLoseKarma(): boolean
Check if we need to lose karma.
boolean
True if we still need to lose karma for a faction invitation.
_internal/classes/focus/crime.ts:125
▸ Private _shouldExecute(crime): boolean
Check if we should commit a crime.
| Name | Type | Description |
|---|---|---|
crime |
Crimes |
The crime to check if we should commit. |
boolean
True if there's a good chance to succeed, false otherwise.
_internal/classes/focus/crime.ts:100
▸ canFocus(): boolean
Check if we need to commit a crime to meet faction requirements.
boolean
True if we need to kill or lose karma.
_internal/classes/focus/crime.ts:46
▸ 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
Returns the focus time of the current crime.
number
Time needed to focus, 0 if not commiting a crime.
_internal/classes/focus/crime.ts:90
▸ getPriority(): number
Gets the current priority of the focusable action.
number
Current priority, with 0 being the highest.
_internal/classes/focus/_base.ts:60
▸ 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
Crimes can never run in the background, returns false always.
boolean
Always false.