lib_ls.js: minor refactor. rm.js: add. README.md: update.

[?]
Oct 10, 2020, 11:31 PM
5TPN2FMT5IKBTZ4YMFZAIB7R5MUCOT2EZFFS3OMYHHSGUML5BTWAC

Dependencies

  • [2] TDRFRQLA README.md: fix a formatting typo and some grammatical nitpicks.
  • [3] TDBVUKLO cache some calculations which should increase performance.
  • [4] NQ22FUSW add more options to `main.js`. update `README.md`.
  • [5] Y5OWMCQR all: remove unecessary uses of `exec`. refactor. main.js: add RAM reservation logic. lib_ram.js: renamed to lib_ram_server.js. README.js: update.
  • [6] SXEJJKPI executables: add `--help` flag. hacker.js: change scheduling logic. refactor. kill.js: allow handling more than one server or script at a time. cyclic_weaken.js: add. README.md: update.
  • [7] FBAPT2WW executables: dynamically load help messages. lshw.js, main.js: add options to change score correction method and score factor multipliers. README.md: update.
  • [8] 2BKHJI2S init
  • [9] FCJA5EXS contracts.js: add. README.md: update.
  • [10] QU6T4CIV README.md: place installation notes nearer to the top.
  • [11] 5DIUM5GJ hacknet.js: convert from helper script to stand-alone script. main.js, README.md: update to accommodate "hacknet.js" changes. README.md: add "Troubleshooting" section and alter misleading information about required server for installation.
  • [12] XUZPBRE6 main.js: fix regression. lib_ls.js: refactor.

Change contents

  • replacement in lib/lib_ls.js at line 3
    [4.3733690][4.1734:1788]()
    export const array_get_files_with_string = function (
    [4.3733690]
    [4.3763]
    export const array_get_files_with_string = (
  • replacement in lib/lib_ls.js at line 5
    [4.3769][4.3769:3793]()
    string_server_source,
    [4.3769]
    [4.1571]
    string_server,
  • replacement in lib/lib_ls.js at line 7
    [4.1583][4.3812:3816](),[4.3812][4.3812:3816](),[4.3816][3.7883:7971]()
    ) {
    const
    array_files_with_string = [],
    string_type_substring = typeof substring;
    [4.1583]
    [4.1672]
    ) => {
    const string_type_substring = typeof substring;
  • edit in lib/lib_ls.js at line 10
    [4.1707][4.1707:1726](),[4.1726][3.7972:8021](),[3.8021][4.1726:1779](),[4.1726][4.1726:1779](),[4.1779][3.8022:8074](),[3.8074][4.1831:1875](),[4.1831][4.1831:1875](),[4.1944][4.1944:1982](),[4.1982][3.8075:8149](),[3.8149][4.2038:2070](),[4.2038][4.2038:2070]()
    case "object":
    const substring_length = substring.length;
    for (
    let integer_index_substring = 0;
    integer_index_substring < substring_length;
    ++integer_index_substring
    ) {
    array_files_with_string.push(
    ns.ls(string_server_source, substring[integer_index_substring])
    );
    }
    break;
  • replacement in lib/lib_ls.js at line 11
    [4.2089][4.2089:2178]()
    array_files_with_string.push(ns.ls(string_server_source, substring));
    break;
    [4.2089]
    [4.2178]
    return ns.ls(string_server, substring);
    case "object":
    return substring.flatMap((string_file) => {
    return array_get_files_with_string(ns, string_server, string_file);
    });
  • replacement in lib/lib_ls.js at line 20
    [4.3734155][4.1876:1910](),[4.1910][4.3734185:3734187](),[4.3734185][4.3734185:3734187]()
    return array_files_with_string;
    };
    [4.3734155]
    };
  • replacement in bin/kill.js at line 64
    [4.12486][4.10728:10746]()
    break;;
    [4.12486]
    [4.3799773]
    break;
  • replacement in README.md at line 8
    [4.1603][4.9136:9565]()
    Save all the `.js` files in this repository to the root directory of a rooted server (one with at least enough RAM to run "hacker.js", e.g. "foodnstuff") using the same filenames (but not including the directory names) that they currently have in this repository. If in the start of a new game, run `run botnet.js 0.001` (to increase the RAM available for the scripts) then `run kill.js` (to kill any currently running scripts).
    [4.1603]
    [4.3092]
    Save all the `.js` files in this repository to the root directory of a rooted server (one with at least enough RAM to run "hacker.js", e.g. "foodnstuff") using the same filenames (but not including the directory names) that they currently have in this repository. If in the start of a new game or just after resetting, run `run botnet.js 0.001` to increase the RAM available for the scripts and increase the available hackable servers, then `run kill.js` (to kill any currently running scripts).
  • edit in README.md at line 214
    [4.10944]
    [4.15498]
    ---
    ### "rm.js" (3.05 GB)
    * Removes all removable files (which excludes currently running scripts, including this one).
    * Optionally, removes only files whose names match a given regular expression.
    * Optionally, removes only files on servers whose names match a given regular expression.
    * Optionally, removes only files whose names match a given regular expression on servers whose names match a given regular expression.
    #### USAGE
    `run rm.js [FLAGS ...] [OPTIONS]`
    #### FLAGS
    `-h, --help`
    * Displays a help message then exits.
    #### OPTIONS
    `-e, --server <REGEX>`
    * REGEX = Regular expression used for server names.
    `-f, --file <REGEX>`
    * REGEX = Regular expression used for filenames.
    #### EXAMPLES
    `run rm.js`
    * Removes all removable files.
    `run rm.js -f txt --file lit`
  • edit in README.md at line 247
    [4.15499]
    [4.15499]
    * Removes all files with filenames that match the regular expressions "txt" and "lit".
    `run rm.js -e home --server harakiri-sushi`
    * Removes all files from servers whose names match the regular expressions "home" and "harakiri-sushi".
    `run rm.js -f txt --file lit -e home --server harakiri-sushi`
    * Removes all files with filenames that match the regular expressions "txt" and "lit" from servers whose names match the regular expressions "home" and "harakiri-sushi".
  • replacement in README.md at line 343
    [4.12686][2.1857:2114]()
    * [See if this discussion about the hacking strategy used answers your questions](https://old.reddit.com/r/Bitburner/comments/g2ry1t/can_someone_explain_traditional_hacking_loop/). If it doesn't, feel free to contact me through one of the channels above.
    [4.12686]
    [4.17038]
    * [See if this discussion about the hacking strategy used answers your questions](https://web.archive.org/web/20201010181949/https://old.reddit.com/r/Bitburner/comments/g2ry1t/can_someone_explain_traditional_hacking_loop/). If it doesn't, feel free to contact me through one of the channels above.