diff options
author | AlmightyMiau <almightymeow612@gmail.com> | 2024-10-26 13:06:14 -0700 |
---|---|---|
committer | AlmightyMiau <almightymeow612@gmail.com> | 2024-10-26 13:06:14 -0700 |
commit | 1ca00b3b73a9699e41f81e154cea32934c16de03 (patch) | |
tree | d8ff8fe937b06cf40458aac232953b19665bcc6e /bitburnerFiles1026/run.js |
First commit
Diffstat (limited to 'bitburnerFiles1026/run.js')
-rw-r--r-- | bitburnerFiles1026/run.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bitburnerFiles1026/run.js b/bitburnerFiles1026/run.js new file mode 100644 index 0000000..31c70cd --- /dev/null +++ b/bitburnerFiles1026/run.js @@ -0,0 +1,12 @@ +/** @param {NS} ns */ +export async function main(ns) { + const target = ns.args[0]; + const script = ns.args[1]; + const scriptRam = ns.getScriptRam(script); + ns.exec(script, "home", threads(ns, scriptRam), target); + await ns.sleep(4000); +} + +function threads(ns, scriptRam) { + return Math.floor(((ns.getServerMaxRam("home") - ns.getServerUsedRam("home")) * 0.95) / scriptRam); +}
\ No newline at end of file |