Options
All
  • Public
  • Public/Protected
  • All
Menu

Focusable managing crime.

Hierarchy

Index

Constructors

  • Creates a focuser that manages crime work.

    Parameters

    • ns: NS

      The Netscript object.

    • priority: number = 150

      Priority this focuser should run at, defaults to 50.

    Returns CrimeFocusable

Properties

_crimeTime: undefined | number

Time to sleep, set when executing a task.

_currentCrime: undefined | Crimes

Current crime being worked.

_ns: NS

The Netscript object.

name: string

The name of the focusable.

Methods

  • _focus(): boolean
  • Commit a crime.

    Returns boolean

    True if crime was successful, false otherwise.

  • _needToKill(): boolean
  • Check if we need to kill someone.

    Returns boolean

    True if we still need to kill for a faction invitation.

  • _needToLoseKarma(): boolean
  • Check if we need to lose karma.

    Returns boolean

    True if we still need to lose karma for a faction invitation.

  • _shouldExecute(crime: Crimes): boolean
  • Check if we should commit a crime.

    Parameters

    • crime: Crimes

      The crime to check if we should commit.

    Returns boolean

    True if there's a good chance to succeed, false otherwise.

  • canFocus(): boolean
  • Check if we need to commit a crime to meet faction requirements.

    Returns boolean

    True if we need to kill or lose karma.

  • 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
  • Returns the focus time of the current crime.

    Returns number

    Time needed to focus, 0 if not commiting a crime.

  • getPriority(): number
  • Gets the current priority of the focusable action.

    Returns number

    Current priority, with 0 being the highest.

  • 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
  • Crimes can never run in the background, returns false always.

    Returns boolean

    Always false.

Generated using TypeDoc