More updates

This commit is contained in:
Zakary Timson 2022-02-04 23:48:08 +00:00
parent 8f85795c51
commit 349cd03b4c
3 changed files with 14 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# BitBurner # BitBurner - Scripts
These scripts are for playing the [open source](https://github.com/danielyxie/bitburner) game [BitBurner](https://danielyxie.github.io/bitburner/) These scripts are for playing the [open source](https://github.com/danielyxie/bitburner) game [BitBurner](https://danielyxie.github.io/bitburner/)
## Table of Contents ## Table of Contents
@ -46,10 +46,15 @@ Manages the specified number of nodes buying any if they don't exist.
It's recommended you run this from your home computer, it useses 5.6 GB of RAM. It's recommended you run this from your home computer, it useses 5.6 GB of RAM.
``` ```
Usage: Usage:
run node-manager.js NUM_NODES run node-manager.js <num> [savings]
NUM_NODES - Minimum number of nodes to maintain num - Target number of nodes
savings - Prevent spending bellow this point
``` ```
### update.js ### update.js
Automaticlly downloads all the scripts in this repo using the in-game `wget`. Automaticlly downloads all the scripts in this repo using the in-game `wget`.
```
Usage:
run update.js
```

View File

@ -23,8 +23,7 @@ export async function main(ns) {
ns.print('==================================================='); ns.print('===================================================');
if(message != null) MESSAGE_HISTORY.push(message); if(message != null) MESSAGE_HISTORY.push(message);
MESSAGE_HISTORY.splice(0, MESSAGE_HISTORY.length - HISTORY_LENGTH); MESSAGE_HISTORY.splice(0, MESSAGE_HISTORY.length - HISTORY_LENGTH);
MESSAGE_HISTORY.map(m => m).reverse().forEach(m => ns.print(m)); MESSAGE_HISTORY.forEach(m => ns.print(m));
for(let i = MESSAGE_HISTORY.length; i < HISTORY_LENGTH; i++) ns.print('');
} }
// Setup // Setup
@ -33,9 +32,9 @@ export async function main(ns) {
if(ns.args[0] == null) help('Missing number of nodes'); if(ns.args[0] == null) help('Missing number of nodes');
if(isNaN(ns.args[0])) help('First argument must be a number'); if(isNaN(ns.args[0])) help('First argument must be a number');
const HISTORY_LENGTH = 17; const HISTORY_LENGTH = 17;
const MESSAGE_HISTORY = []; const MESSAGE_HISTORY = Array(HISTORY_LENGTH).fill('');
const LIMIT = ns.args[0] < ns.hacknet.maxNumNodes() ? ns.args[0] : ns.hacknet.maxNumNodes(); const LIMIT = ns.args[0] < ns.hacknet.maxNumNodes() ? ns.args[0] : ns.hacknet.maxNumNodes();
const SAVINGS = ng.args[1] ?? 0; const SAVINGS = ns.args[1] ?? 0;
let nodeCount = ns.hacknet.numNodes(); let nodeCount = ns.hacknet.numNodes();
log(); log();

View File

@ -15,9 +15,10 @@ export async function main(ns) {
// Download each file // Download each file
for(const FILE of FILE_LIST) { for(const FILE of FILE_LIST) {
ns.tprint(`Downloading: ${FILE}...`); const SPEED = ~~(Math.random() * 100) / 10;
await ns.wget(`${SRC}${FILE}`, `${DIST}${FILE}`); await ns.wget(`${SRC}${FILE}`, `${DIST}${FILE}`);
ns.tprint('Complete!'); ns.tprint(`${FILE} \t [==================>] 100% \t (${SPEED} MB/s)`);
await ns.sleep(500);
} }
ns.tprint('Done!'); ns.tprint('Done!');
} }