jrchamp/bitburner-scripts

Shared Functions

Closed this issue · 0 comments

It's possible to have a file such as shared-functions.js that defines functions like:

export function sharedFunction(ns) {
	ns.print("success");
}

And then other scripts can have:

import {sharedFunction} from 'shared-functions.js';

So they can use the shared function(s).

This seems like it would be particularly useful for reducing the duplication in server caching and target selection code (particularly as it relates to the individual task work in #1)