rm.js: fix incorrect logic, refactor. lib_servers.js: refactor. README.md: clarify confusing "hacker.js" troubleshooting explanation.
[?]
Oct 12, 2020, 12:43 AM
EDSOZNELN4QFPJ4RGPWTWVL5IWEET5DGFAMNN3QQYBR7S3OAG2GQCDependencies
- [2]
VTCBEUHDREADME.md: add clarification and extra information. - [3]
7SRULDRFminor refactoring. - [4]
Y5OWMCQRall: remove unecessary uses of `exec`. refactor. main.js: add RAM reservation logic. lib_ram.js: renamed to lib_ram_server.js. README.js: update. - [5]
5DIUM5GJhacknet.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. - [6]
TDBVUKLOcache some calculations which should increase performance. - [7]
2BKHJI2Sinit - [8]
FBAPT2WWexecutables: dynamically load help messages. lshw.js, main.js: add options to change score correction method and score factor multipliers. README.md: update. - [9]
DJDWBCCQadd missing "nop.js". killall.js: rename to kill.js. add `--script` and `--server` options. - [10]
SXEJJKPIexecutables: 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.
Change contents
- replacement in lib/lib_servers.js at line 4[3.3713867]→[3.2643:2692](∅→∅),[3.2692]→[3.5059:5156](∅→∅),[3.5156]→[3.2767:2775](∅→∅),[3.2767]→[3.2767:2775](∅→∅),[3.2775]→[3.5585:5619](∅→∅),[3.5619]→[3.5157:5206](∅→∅),[3.5206]→[3.5668:5695](∅→∅),[3.5668]→[3.5668:5695](∅→∅),[3.5695]→[3.2876:2882](∅→∅),[3.2876]→[3.2876:2882](∅→∅),[3.2882]→[3.5207:5351](∅→∅),[3.5351]→[3.2883:2893](∅→∅),[3.5773]→[3.2883:2893](∅→∅),[3.3714167]→[3.2883:2893](∅→∅),[3.2893]→[3.5774:5815](∅→∅),[3.5815]→[3.5352:5413](∅→∅),[3.5413]→[3.5876:5910](∅→∅),[3.5876]→[3.5876:5910](∅→∅),[3.5910]→[3.3005:3011](∅→∅),[3.3005]→[3.3005:3011](∅→∅),[3.3011]→[3.5911:6071](∅→∅),[3.6071]→[3.3714435:3714439](∅→∅),[3.3714435]→[3.3714435:3714439](∅→∅)
export const array_get_servers = function (ns) {constarray_servers = [ns.getHostname()],array_servers_length = array_servers.length;for (let integer_index_server = 0;integer_index_server < array_servers_length;++integer_index_server) {constarray_scan_results = ns.scan(array_servers[integer_index_server]),array_scan_results_length = array_scan_results.length;for (let integer_index_scan_result = 0;integer_index_scan_result < array_scan_results_length;++integer_index_scan_result)-1 === array_servers.indexOf(array_scan_results[integer_index_scan_result]) &&array_servers.push(array_scan_results[integer_index_scan_result]);}export const array_get_servers = (ns) => {const array_servers = [ns.getHostname()];array_servers.forEach(string_server => {ns.scan(string_server).forEach(string_scan_result => {-1 === array_servers.indexOf(string_scan_result) &&array_servers.push(string_scan_result);});}); - replacement in lib/lib_servers.js at line 13
};[3.3714463]}; - edit in bin/rm.js at line 7
import {array_get_servers} from "lib_servers.js"; - replacement in bin/rm.js at line 12
const object_get_constants = function () {return {object_argument_names: {file_regex: {short: "f",long: "file",},server_regex: {short: "e",long: "server",},help: {short: "h",long: "help",},}};};const object_get_constants = () => ({object_argument_names: {file_regex: {short: "f",long: "file"},server_regex: {short: "e",long: "server"},help: {short: "h",long: "help"},},}); - replacement in bin/rm.js at line 29
const void_print_help = function (ns) {const void_print_help = (ns) => { - edit in bin/rm.js at line 60
const array_servers = [ns.getHostname()]; - replacement in bin/rm.js at line 61
const array_server_regexes = [];constarray_server_regexes = [],array_servers_matching_regexes = []; - replacement in bin/rm.js at line 67
array_servers.forEach(string_server => {const array_scan_results = ns.scan(string_server);array_scan_results.forEach(string_scan_result => {array_server_regexes.forEach(object_server_regex => {if (object_server_regex.test(string_scan_result) &&array_servers.indexOf(string_scan_result) === -1)array_servers.push(string_scan_result);});array_get_servers(ns).forEach(string_server => {array_server_regexes.forEach(object_server_regex => {object_server_regex.test(string_server) &&array_servers_matching_regexes.push(string_server); - edit in bin/rm.js at line 73
return array_servers_matching_regexes; - replacement in bin/rm.js at line 75
array_servers.forEach(string_server => {const array_scan_results = ns.scan(string_server);array_scan_results.forEach(string_scan_result => {if (array_servers.indexOf(string_scan_result) === -1)array_servers.push(string_scan_result);});});return array_get_servers(ns); - edit in bin/rm.js at line 77
return array_servers; - replacement in bin/rm.js at line 87
array_files = [];array_files_matching_regexes = []; - replacement in bin/rm.js at line 93
if (object_file_regex.test(string_file))array_files.push(string_file);object_file_regex.test(string_file) &&array_files_matching_regexes.push(string_file); - replacement in bin/rm.js at line 97
return array_files;return array_files_matching_regexes; - replacement in bin/rm.js at line 132
export const main = async function (ns) {export const main = async (ns) => { - edit in bin/main.js at line 4
* use the same server choosing logic used in hacker.js for picking which server to run helper scripts on - replacement in README.md at line 339
* Make sure there is enough RAM (see requirements in the "Overview" section above) on the server that you ran "main.js" from and that there are no scripts running on that server before "hacker.js" has a chance to get spawned into it. Sometimes, "weaken_manager.js" will run "cyclic_weaken.js" on that server so you might need to kill any instances of the latter on that server before "hacker.js" is spawned.* Make sure there is enough RAM for "hacker.js" (see requirements in the "Overview" section above) on the server that you ran "main.js" from. Sometimes, "weaken_manager.js" will run "cyclic_weaken.js" on that server so you might need to look out for and kill any instances of the latter that get executed on that server before "hacker.js" has a chance to get spawned.