Options
All
  • Public
  • Public/Protected
  • All
Menu

Focusable managing <>.

Hierarchy

Index

Constructors

  • Creates a focuser that manages <>.

    Parameters

    • ns: NS

      The Netscript object.

    • priority: number = Infinity

      Priority this focuser should run at, defaults to <>.

    Returns TemplateFocusable

Properties

_ns: NS

The Netscript object.

name: string

The name of the focusable.

Methods

  • _focus(): boolean
  • Execute focus using ns.singularity, must be implemented by subclass.

    Returns boolean

    Whether the focus action was successful.

  • canFocus(): boolean
  • 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
  • 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
  • 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