Updated update.js RAM usage

This commit is contained in:
Zakary Timson 2022-02-10 20:38:25 +00:00
parent 28b2000489
commit 3e2a2b92da
2 changed files with 4 additions and 2 deletions

View File

@ -79,7 +79,7 @@ Options:
``` ```
### [update.js](./scripts/update.js) ### [update.js](./scripts/update.js)
**RAM:** 1.60 GB **RAM:** 2.60 GB
Automatically download the latest versions of all scripts using wget. Automatically download the latest versions of all scripts using wget.
``` ```

View File

@ -2,6 +2,8 @@
* Automatically download all the scripts in the repository. * Automatically download all the scripts in the repository.
*/ */
export async function main(ns) { export async function main(ns) {
ns.disableLog('ALL');
async function download(file) { async function download(file) {
await ns.wget(`${src}${file}`, `${dest}${file}`); await ns.wget(`${src}${file}`, `${dest}${file}`);
const speed = ~~((Math.random() * 200) + 100) / 10; const speed = ~~((Math.random() * 200) + 100) / 10;
@ -29,7 +31,7 @@ export async function main(ns) {
ns.tprint(''); ns.tprint('');
ns.tprint("Restarting..."); ns.tprint("Restarting...");
await ns.sleep(2000); await ns.sleep(2000);
return ns.exec(`${dest}update.js`, ns.getHostname(), 1, 1); return ns.run(`${dest}update.js`, 1, 1);
} }
// Download each file // Download each file