add `cp.js`.

[?]
Apr 17, 2020, 3:13 PM
BZ6FC2BTR7M7T6KQX5OJEFY4B3OWAKCOALYOF7GYBXZ4ZNSGSCYQC

Dependencies

  • [2] HHZNTFCT remove `-t` flag for `main.js` which conflicted with the same flag for the `run` command.
  • [3] BCM3TZOS added `killall.js` option to kill only named scripts. fixed `void_server_buy_or_upgrade` regression that prevented it from working when you don't have servers.
  • [4] FA3U4WUJ more `README.md` changes.
  • [5] YANDOFZ4 added readme and licenses
  • [6] CJBGAILA add optional `--target` parameter for `main.js`. update `README.md`.
  • [7] 2BKHJI2S init
  • [8] 6MBUKAG6 remove unneeded functions and comments. update readme.
  • [9] VMXI7PS4 added action cap. improved scoring system. fixed parts of security and cash predictors. made lshw loopable.
  • [10] 3TYF4BJS target only hackable servers. replace servers continually.

Change contents

  • replacement in lib/lib.js at line 493
    [5.3081][5.3755879:3756004](),[5.3755879][5.3755879:3756004]()
    const integer_server_score = function(ns, string_server_target) {
    void_debug(integer_server_score, Array.from(arguments));
    [5.3081]
    [5.3082]
    const float_get_server_score = function(ns, string_server_target) {
    void_debug(float_get_server_score, Array.from(arguments));
  • replacement in lib/lib.js at line 499
    [5.3756242][5.3756242:3756324]()
    // sort an array of servers by their integer_server_score, from lowest to highest
    [5.3756242]
    [5.3756324]
    // sort an array of servers by their score, from lowest to highest
  • replacement in lib/lib.js at line 502
    [5.3756454][5.3756454:3756612]()
    return array_servers.sort((string_element_0, string_element_1) => integer_server_score(ns, string_element_0) - integer_server_score(ns, string_element_1));
    [5.3756454]
    [5.3756612]
    return array_servers.sort((string_element_0, string_element_1) => float_get_server_score(ns, string_element_0) - float_get_server_score(ns, string_element_1));
  • replacement in lib/lib.js at line 834
    [5.3774745][5.3774745:3774835]()
    const array_servers_rooted_sorted_by_ram = array_get_servers_rooted_sorted_by_ram (ns);
    [5.3774745]
    [5.1728]
    const array_servers_rooted_sorted_by_ram = array_get_servers_rooted_sorted_by_ram(ns);
  • edit in bin/main.js at line 1
    [5.3793719]
    [5.3793720]
    // TODO: Separate logic that can finish running (e.g. server buying logic which becomes redundant after 25 fully upgraded servers have been bought) to other sbins so that RAM usage is more efficient. Also separate logic that requires source files so that they are only ran when you have the required source file. Maybe make a cache script that saves runtime constants like max money of servers to a cache file to potentially reduce RAM usage further.
  • replacement in bin/main.js at line 14
    [2.3870][2.3870:3903]()
    const integer_job_cap = 2000;
    [2.3870]
    [2.3903]
    const integer_job_cap = 4000;
  • replacement in bin/killall.js at line 6
    [5.3797253][3.2888:3387]()
    for (let integer_integer_indices_0 = 0; integer_integer_indices_0 < array_servers.length; ++integer_integer_indices_0) {
    const array_scan_results = ns.scan(array_servers[integer_integer_indices_0]);
    for (let integer_integer_indices_1 = 0; integer_integer_indices_1 < array_scan_results.length; ++integer_integer_indices_1) {
    if (array_servers.indexOf(array_scan_results[integer_integer_indices_1]) === -1) {
    array_servers.push(array_scan_results[integer_integer_indices_1]);
    [5.3797253]
    [5.3797680]
    for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {
    const array_scan_results = ns.scan(array_servers[integer_indices_0]);
    for (let integer_indices_1 = 0; integer_indices_1 < array_scan_results.length; ++integer_indices_1) {
    if (array_servers.indexOf(array_scan_results[integer_indices_1]) === -1) {
    array_servers.push(array_scan_results[integer_indices_1]);
  • edit in README.md at line 2
    [5.7086][5.7086:7087]()
  • edit in README.md at line 3
    [5.7102][5.2862:2863]()
  • edit in README.md at line 6
    [5.2966][5.3117:3118](),[2.4262][5.3117:3118](),[5.3117][5.3117:3118]()
  • edit in README.md at line 15
    [5.3095][5.3527:3528](),[5.3527][5.3527:3528]()
  • edit in README.md at line 19
    [5.3223][5.3599:3600](),[5.14284][5.3599:3600](),[5.3599][5.3599:3600]()
  • replacement in README.md at line 22
    [5.3873390][5.3652:3668]()
    ## Installation
    [5.3873390]
    [5.3668]
    ### `cp.js <SUBSTRING1 [SUBSTRING2 ...]>` (2.65 GB)
    * Copy all files that contain particular substring(s) in their filenames from all servers to the current server.
  • edit in README.md at line 25
    [5.3669]
    [5.3669]
    ## Installation
  • edit in README.md at line 29
    [5.3770][4.1690:1691]()
  • replacement in README.md at line 46
    [4.1993][4.1993:2006]()
    ## Debugging
    [4.1993]
    [5.3873767]
    ```
    run cp.js .lit .script .txt
    ```
    Copies all files that contain the strings ".lit", ".script" or ".txt" in their filename from all servers to the current server.
  • edit in README.md at line 51
    [5.3873768]
    [4.2007]
    ## Debugging
  • edit in README.md at line 55
    [5.3873779][5.3873779:3873780]()
  • edit in README.md at line 58
    [5.3873942][5.3873942:3873943]()