contracts.js: add --verbose and --check-delay options. README.md: update.
[?]
May 16, 2020, 11:36 PM
IFVY3INITLTHXUCAU5ZTYELKOD2CP45KVYP77ZT6BNKF34BNHROACDependencies
- [2]
FCJA5EXScontracts.js: add. README.md: update. - [3]
HSNSECD5all: refactor. main.js: fix call to `void_kill_script_named_server_named`. - [4]
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. - [5]
DJDWBCCQadd missing "nop.js". killall.js: rename to kill.js. add `--script` and `--server` options. - [6]
FBAPT2WWexecutables: dynamically load help messages. lshw.js, main.js: add options to change score correction method and score factor multipliers. README.md: update. - [7]
JGNALSUQadd "cyclic_weaken.js" feature. hacker.js, main.js, libs: refactor. README.md: update. - [8]
2BKHJI2Sinit - [9]
VMXI7PS4added action cap. improved scoring system. fixed parts of security and cash predictors. made lshw loopable. - [10]
2WOLGB42README.md: update. kill.js: fix argument parser. lshw.js: add `-p` option. increase information given. main.js: fix error message. set saner defaults. hacker.js: split some functions into "lib_time.js" and "lib_score.js". ram.js: fix.
Change contents
- edit in bin/main.js at line 59
// whether to display help and exitboolean_print_help = !1 - replacement in bin/main.js at line 202
// whether to display help and exitboolean_print_help = !1;boolean_print_help = object_defaults.boolean_print_help; - replacement in bin/main.js at line 457
SECONDS = The duration of delay between each main loop used in helper scripts, in seconds. Should be a floating-point number > 0. Defaults to ${object_defaults.float_period_check_seconds}.SECONDS = The duration of delay between each repeat of the helper scripts' main loops, in seconds. Should be a floating-point number > 0. Defaults to ${object_defaults.float_period_check_seconds}. - replacement in bin/lshw.js at line 31
float_sleep_duration: 0,// time period used for checking the time in secondsfloat_sleep_duration_seconds: 0, - edit in bin/lshw.js at line 76
// multiplier for skill factor used in server scoring system - edit in bin/lshw.js at line 77
// multiplier for max cash factor used in server scoring system - edit in bin/lshw.js at line 78
// multiplier for growth factor used in server scoring system - edit in bin/lshw.js at line 79
// correction method for factors used in server scoring system. can be "standard" or "normal" - replacement in bin/lshw.js at line 80
float_sleep_duration = object_defaults.float_sleep_duration,float_sleep_duration_seconds = object_defaults.float_sleep_duration_seconds, - edit in bin/lshw.js at line 82
// initial state of the servers array - edit in bin/lshw.js at line 84
// whether to display help and exit - replacement in bin/lshw.js at line 95
float_sleep_duration = 1e3 * argument_value;float_sleep_duration_seconds = argument_value; - replacement in bin/lshw.js at line 160
if (float_sleep_duration < 1) break;await ns.sleep(float_sleep_duration);if (float_sleep_duration_seconds < 1) break;await ns.sleep(1e3 * float_sleep_duration_seconds); - replacement in bin/lshw.js at line 186
SECONDS = The duration of delay between update, in seconds. Should be a floating-point number >= 0.001. By default, the script will only display server information once, unless this option is manually set.SECONDS = The duration of delay between updates, in seconds. Should be a floating-point number >= 0.001. By default, the script will only display server information once, unless this option is manually set. - edit in bin/contracts.js at line 2
* make messages optional* add an option to loop forever? - edit in bin/contracts.js at line 14
// variableslet boolean_print_help = !1; - replacement in bin/contracts.js at line 16
object_argument_names = object_get_constants().object_argument_names,object_arguments = object_parse_arguments(ns.args);object_constants = object_get_constants(),// defaultsobject_defaults = object_constants.object_defaults,// argument namesobject_argument_names = object_constants.object_argument_names;letfloat_period_check_seconds = object_defaults.float_period_check_seconds,boolean_verbose = object_defaults.boolean_verbose,boolean_print_help = object_defaults.boolean_print_help;const object_arguments = object_parse_arguments(ns.args); - edit in bin/contracts.js at line 30
case object_argument_names.check_delay.short:// fall-throughcase object_argument_names.check_delay.long:float_period_check_seconds = argument_value;break;case object_argument_names.verbose.short:// fall-throughcase object_argument_names.verbose.long:boolean_verbose = argument_value;break; - replacement in bin/contracts.js at line 52
// main - replacement in bin/contracts.js at line 55
void_contracts_solver(ns);if (float_period_check_seconds > 0) {const float_period_check = 1e3 * float_period_check_seconds;for (;;)void_contracts_solver(ns, float_period_check_seconds, boolean_verbose),await ns.sleep(float_period_check);}else void_contracts_solver(ns, float_period_check_seconds, boolean_verbose); - edit in bin/contracts.js at line 64
// functions - replacement in bin/contracts.js at line 67
const object_solvers = {};constobject_argument_names = {check_delay: {short: "c",long: "check-delay",},help: {short: "h",long: "help",},verbose: {short: "v",long: "verbose",},},object_defaults = {// time period used for checking the time in secondsfloat_period_check_seconds: 0,// whether to display notification messages or notboolean_verbose: !1,// whether to display help and exitboolean_print_help: !1,},object_solvers = {}; - replacement in bin/contracts.js at line 402
object_argument_names: {help: {short: "h",long: "help",},}object_defaults,object_argument_names, - replacement in bin/contracts.js at line 412
Attempts to solve existing coding contracts in the network. Displays whether or not any attempts were successful.Attempts to solve existing coding contracts in the network. - replacement in bin/contracts.js at line 415
run ${ns.getScriptName()} [FLAGS ...]run ${ns.getScriptName()} [FLAGS ...] [OPTIONS] - replacement in bin/contracts.js at line 419
Displays this message then exits.`Displays this message then exits.-${object_argument_names.verbose.short}, --${object_argument_names.verbose.long}If set, displays messages regarding succesful attempts (in addition to standard failed attempt messages).OPTIONS-${object_argument_names.check_delay.short}, --${object_argument_names.check_delay.long} <SECONDS>SECONDS = The duration of delay between each network-wide contract search and solve attempts, in seconds. Should be a floating-point number >= 0.001. By default, the script will only search for and attempt to solve contracts once, unless this option is manually set.` - replacement in bin/contracts.js at line 468
solve: function (answer) {solve: function (answer, boolean_verbose) { - replacement in bin/contracts.js at line 474
returnReward: !0,returnReward: boolean_verbose, - replacement in bin/contracts.js at line 485
const void_contracts_solver = function (ns) {const void_contracts_solver = function (ns,boolean_verbose) { - replacement in bin/contracts.js at line 500
string_output = object_contract.solve(answer);"" === object_contract.solve(answer)? ns.tprint(output = object_contract.solve(answer, boolean_verbose);switch (output) {case "":// fall-throughcase !1:ns.tprint( - edit in bin/contracts.js at line 511
): ns.tprint(`${string_output}` - edit in bin/contracts.js at line 512
break;case !0:break;default:ns.tprint(`${output}`);break;} - replacement in README.md at line 65
* SECONDS = The duration of delay between each main loop used in helper scripts, in seconds. Should be a floating-point number > 0. Defaults to 10.* SECONDS = The duration of delay between each repeat of the helper scripts' main loops, in seconds. Should be a floating-point number > 0. Defaults to 10. - edit in README.md at line 170
* Displays whether or not any attempts were successful. - replacement in README.md at line 172
`run contracts.js [FLAGS ...]``run contracts.js [FLAGS ...] [OPTIONS]` - edit in README.md at line 178
`-v, --verbose`* If set, displays messages regarding succesful attempts (in addition to standard failed attempt messages).#### OPTIONS`-c, --check-delay`* The duration of delay between each network-wide contract search and solve attempts, in seconds. Should be a floating-point number >= 0.001. By default, the script will only search for and attempt to solve contracts once, unless this option is manually set. - replacement in README.md at line 207
* SECONDS = The duration of delay between update, in seconds. Should be a floating-point number >= 0.001. By default, the script will only display server information once, unless this option is manually set.* SECONDS = The duration of delay between updates, in seconds. Should be a floating-point number >= 0.001. By default, the script will only display server information once, unless this option is manually set.