bitburner/scripts/update.js

25 lines
700 B
JavaScript
Raw Normal View History

2022-02-04 17:17:13 -05:00
/**
* Automatically download all the scripts in the repository.
*/
2022-02-04 11:49:05 -05:00
export async function main(ns) {
2022-02-04 17:17:13 -05:00
const SRC = 'https://gitlab.zakscode.com/ztimson/BitBurner/-/raw/develop/scripts/';
const DIST = '/scripts/';
2022-02-04 11:49:05 -05:00
const FILE_LIST = [
2022-02-04 17:17:13 -05:00
'auto-pwn.js',
'bruteforce.js',
'crawler.js',
'miner.js',
'node-manager.js',
'update.js'
2022-02-04 11:49:05 -05:00
];
2022-02-04 17:17:13 -05:00
// Download each file
2022-02-04 11:49:05 -05:00
for(const FILE of FILE_LIST) {
2022-02-04 18:48:08 -05:00
const SPEED = ~~(Math.random() * 100) / 10;
2022-02-04 17:17:13 -05:00
await ns.wget(`${SRC}${FILE}`, `${DIST}${FILE}`);
2022-02-04 18:48:08 -05:00
ns.tprint(`${FILE} \t [==================>] 100% \t (${SPEED} MB/s)`);
await ns.sleep(500);
2022-02-04 11:49:05 -05:00
}
2022-02-04 17:17:13 -05:00
ns.tprint('Done!');
2022-02-04 11:49:05 -05:00
}