make worker scripts and worker script executor time-aware.

[?]
Apr 28, 2020, 1:07 AM
MKHG4OQBVXNOJFRUKKI2KN7VXJHXDWZUUYKGF22TKTBYEUEFCC5AC

Dependencies

  • [2] DJDWBCCQ add missing "nop.js". killall.js: rename to kill.js. add `--script` and `--server` options.
  • [3] HSNSECD5 all: refactor. main.js: fix call to `void_kill_script_named_server_named`.
  • [4] NQ22FUSW add more options to `main.js`. update `README.md`.
  • [5] 2BKHJI2S init
  • [6] 3NFCZ6IP fixed the ram utilisation logic. added flags to `main.js` that can prevent the execution of helpers.
  • [7] 6MBUKAG6 remove unneeded functions and comments. update readme.
  • [8] CJBGAILA add optional `--target` parameter for `main.js`. update `README.md`.
  • [9] 4ACCU75N improve and refactor scheduling logic.
  • [10] SLSWBNYT added ram utilisation logic to `ram.js` and `servers.js`. split and refactored redundant code into separate library files.
  • [11] AXGQ7FML split and refactor hacking logic to "hacker.js" and argument parsing and script execution logic to "main.js". update "README.md".

Change contents

  • replacement in sbin/weaken.js at line 2
    [3.46][3.46:105]()
    await ns.sleep(ns.args[2]), await ns.weaken(ns.args[1]);
    [3.46]
    [3.1997]
    await ns.sleep(Date.now() + ns.args[2]), await ns.weaken(ns.args[1]);
  • replacement in sbin/hack.js at line 2
    [3.156][3.156:213]()
    await ns.sleep(ns.args[2]), await ns.hack(ns.args[1]);
    [3.156]
    [3.52923]
    await ns.sleep(Date.now() + ns.args[2]), await ns.hack(ns.args[1]);
  • replacement in sbin/grow.js at line 2
    [3.257][3.257:314]()
    await ns.sleep(ns.args[2]), await ns.grow(ns.args[1]);
    [3.257]
    [3.53351]
    await ns.sleep(Date.now() + ns.args[2]), await ns.grow(ns.args[1]);
  • replacement in bin/main.js at line 40
    [2.2959][2.2959:3080]()
    // maximum amount of jobs to spawn per cycle, used to prevent using up too much IRL RAM
    let integer_job_cap = 1000;
    [2.2959]
    [2.3080]
    // maximum amount of jobs to execute per schedule, used to prevent using up too much IRL RAM
    let integer_job_cap = 2000;
  • replacement in bin/main.js at line 43
    [2.3111][2.3111:3144]()
    let float_padding_seconds = 1;
    [2.3111]
    [2.3144]
    let float_padding_seconds = 0.5;
  • replacement in bin/main.js at line 52
    [2.3468][2.3468:3527]()
    // ram utilisiation threshold. upgrade ram when reached.
    [2.3468]
    [2.3527]
    // ram utilisiation threshold. upgrade ram or buy or replace servers when reached.
  • replacement in README.md at line 34
    [3.3600][3.3600:3722]()
    * SECONDS = The duration of delay between each job, in seconds. Should be a floating-point number > 0. Defaults to 0.4.
    [3.3600]
    [3.3722]
    * SECONDS = The duration of delay between each job, in seconds. Should be a floating-point number > 0. Defaults to 0.5.
  • replacement in README.md at line 42
    [3.3500][3.4061:4162]()
    * CAP = The maximum amount of jobs to start per cycle. Should be an integer > 0. Defaults to 2000.
    [3.3500]
    [3.4162]
    * CAP = The maximum amount of jobs to execute per schedule. Should be an integer > 0. Defaults to 2000.
  • replacement in README.md at line 58
    [3.4712][3.4712:4855]()
    * CAP = The maximum amount fraction of cash to steal from the target server per `hack` job. Should be an integer >= 0 <=1. Defaults to 0.96.
    [3.4712]
    [3.4855]
    * CAP = The maximum amount fraction of cash to steal from the target server per `hack` job. Should be an integer >= 0 <=1. Defaults to 0.9.