Options
All
  • Public
  • Public/Protected
  • All
Menu

Focusable managing training stats for faction requirements.

Hierarchy

Index

Constructors

  • Creates a focuser that manages training stats.

    Parameters

    • ns: NS

      The Netscript object.

    • priority: number = 100

      Priority this focuser should run at, defaults to 100.

    Returns TrainingFocusable

Properties

_currentTraining: undefined | Workouts | Courses

Current training or course being done.

_factionManager: FactionManager

Manager of factions

_ns: NS

The Netscript object.

name: string

The name of the focusable.

Methods

  • _checkCombatStats(combat: number): boolean
  • Check combat stats against player.

    Parameters

    • combat: number

      Combat requirement to check against.

    Returns boolean

    True if player meets requirement with all stats, false otherwise.

  • _focus(): boolean
  • Either train at the Powerhouse Gym, or study hacking at Rothman University.

    Returns boolean

    True if the focus was successful, false otherwise.

  • Get factions needing a higher combat stat.

    Returns Faction[]

    All factions which have combat requirement higher than current stats, sorted by requirement.

  • Get factions needing a higher hacking stat.

    Returns Faction[]

    All factions which have hacking requirement higher than current stats, sorted by requirement.

  • _learn(course: Courses, university?: string): boolean
  • Take a course at a university.

    Parameters

    • course: Courses

      The course to take.

    • university: string = "Rothman University"

      University to take course at.

    Returns boolean

    True if was successful taking course.

  • _train(workout: Workouts, gym?: string): boolean
  • Train a combat stat at a gym.

    Parameters

    • workout: Workouts

      The stat to train.

    • gym: string = "Powerhouse Gym"

      Gym to train at.

    Returns boolean

    True if was successful training.

  • canFocus(): boolean
  • Check if we need to train to meet faction requirements.

    Returns boolean

    True if there's a faction which requires more combat or hacking experience.

  • 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 priority 5 if multipliers make working within reach, default otherwise.

    Returns number

    Priority for task.

  • shouldContinueRunning(): boolean
  • Checks if the player is still working.

    virtual

    Can be overridden, but run super.shouldContinueRunning if you do.

    Returns boolean

    True if user is still 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