Options
All
  • Public
  • Public/Protected
  • All
Menu

Focusable managing working for companies.

Hierarchy

Index

Constructors

  • Creates a focuser that manages working for companies.

    Parameters

    • ns: NS

      The Netscript object.

    • priority: number = 150

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

    Returns CompanyFocusable

Properties

_currentCompany: undefined | Companies

Current company being worked for.

_factionManager: FactionManager

Faction manager.

_ns: NS

The Netscript object.

name: string

The name of the focusable.

Methods

  • _focus(): boolean
  • Work for a company, applying if necessary.

    Returns boolean

    Whether the focus was successful.

  • Get megacorps which do not yet have a faction invite.

    Returns IMegaCorporation[]

    All megacorps which do not have a faction invite.

  • canFocus(): boolean
  • Check if there are any megacorps with unjoined factions.

    Returns boolean

    True if there are megacorps available to focus on.

  • 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
  • Check if we have enough rep to stop working early.

    Returns boolean

    True if we should continue working, false if we have enough rep.

  • 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