Options
All
  • Public
  • Public/Protected
  • All
Menu

Focusable managing working for factions.

Hierarchy

Index

Constructors

  • Creates a focuser that manages faction focus.

    Parameters

    • ns: NS

      The Netscript object.

    • priority: number = 200

      Priority this focuser should run at, defaults to 25.

    Returns FactionFocusable

Properties

_currentFaction: undefined | Factions

Current faction being worked for.

_ns: NS

The Netscript object.

name: string

The name of the focusable.

Methods

  • _focus(): boolean
  • Work for the faction with the most augmentations available.

    Returns boolean

    Whether the focus action was successful.

  • Determine which is the best faction to focus on.

    Returns Factions

    Faction with the most augmentations available.

  • Return factions which are can be focused on.

    Returns IFaction[]

    All Factions which which are accepted and have rep needed to purchase augmentations.

  • _getMaxAugmentationRep(faction: IFaction): number
  • Get the largest rep requirement of the augmentations offered by faction.

    Parameters

    Returns number

    Largest rep cost of the augmentations offered.

  • Gets unpurchased augmentations for faction.

    Parameters

    • faction: IFaction

      The faction to check.

    Returns Augmentations[]

    The augmentations which aren't purchased.

  • Return factions with priority augmentations.

    Returns IFaction[]

    All Factions which which are accepted and have priority augmentations available.

  • Gets unpurchased augmentations for faction that are within reach.

    Parameters

    • faction: IFaction

      The faction to check.

    Returns Augmentations[]

    The augmentations which aren't purchased.

  • canFocus(): boolean
  • User can focus if there's a faction where rep is needed to purchase augmentations.

    override

    Returns boolean

    Whether the user has factions with augmentations available and rep needed.

  • focus(): number
  • Executes a focus action, returning a predefined sleep time.

    Returns number

    _sleepTime if successful, -1 otherwise.

  • getCheckInterval(): number
  • Gets how often to check for task completion, defaults to this._checkInterval.

    Returns number

    How often to check for task completion.

  • getDetailText(): string
  • Returns value from preset field.

    Returns string

    Value of this._detailField if set, "" otherwise

  • getFocusTime(): number
  • Get time needed for task, defaults to this._sleepTime.

    Returns number

    The time to sleep before running the manager again.

  • getPriority(): number
  • Returns high priority if priority factions are available, medium if there's a lot of factions to focus on, default otherwise.

    override

    Returns number

    Whether the user has factions with augmentations available and rep needed.

  • shouldContinueRunning(): boolean
  • Check if we have enough rep for the most expensive augmentation.

    Returns boolean

    True if we need to keep working, false otherwise..

  • shouldRunInBackground(): boolean
  • Checks if the action should run in the background, defaults to if priority is > 50.

    Returns boolean

    True if this can run in the background, False if it needs to be in the foreground.

Generated using TypeDoc