FBAPT2WW2IUZTIHZP3BMVWKAIAGICTTH2QRPLDJXWNSYBW5AMO6AC ZVQK2652XNKQ4QBNOFSROAP4QRJQCBYH2DQW7RCWZVRBRLUZ46SAC ZNH2OJ3CP2SRIGFJATPNLT7HQ5YNNLP4M2ZVO7QN3P3HSTVJJHOAC G7YVCY6HM6W46JYZWU6HY4VO4SQCHBP73LW2RTI2LPNRQD2TNKCAC 2BKHJI2SJ3VXTFBK2BWNN3I3BDNMUU5YTJGKTQCOXV66VVRHCGKAC IVSW4A6P6V4K5ZCXMOB4ENW45U6LNKX7HD7AYTCHNRBGC64FK5IAC 2WOLGB42T4EO7ZKLA5KFUYWVPTR6I3ET3FPJT4BSJFL43RRFRUBAC HSNSECD5D3ACWDKZNIEV7RZZ54IE5K33WS3DR37ABHM5QP5JJPIAC SXEJJKPIZE6AFCHQ32SROLWQUP733MRJZXNAR7OR37VVSRJIFFJQC 6TF4T3E2TNJENBEZ2O6FCNF6XTQPPZ7WM2GMMH453BWXE7PKZUMQC VMXI7PS4GFDOWPFLHQ7TYKJ5K3K7FXNPJCBEVYHTTRN7YB5ZHEQAC 3NFCZ6IPQPUCWANJN5WMUHUCHEQN7U5HZXMHDKVC6V6HXA3FG5YQC HLC2L3NJJSZLGSQ7JN6CTRE4YALVPLQSADZP3MDNLGB7BWPPH22QC Y5OWMCQRLGQ56HMM53HR6CVZEMAHOEKDYMFLBDEQOJ4HLUJL7HUAC 6MBUKAG6VK6XXGRSER273IP2R35P3C5K3KOY4QVSZXEOYD3H4WRAC DJDWBCCQHQRKHGRKKQ32QY3WDEM7EKDDQ2YQLSSCS7HZTLHDRCFQC export const float_get_server_score = function (ns, string_server) {
export const float_get_server_score = function (ns,string_server,string_method_score_correction,float_multiplier_factor_skill_argument,float_multiplier_factor_max_cash_argument,float_multiplier_factor_growth_argument) {letfloat_method_score_correction = float_get_standard_score,float_multiplier_factor_skill = 1,float_multiplier_factor_max_cash = 1,float_multiplier_factor_growth = 1;switch (string_method_score_correction) {case "standard":float_method_score_correction = float_get_standard_score;break;case "normal":float_method_score_correction = float_get_mean_normalised_score;break;default:ns.tprint(`WARNING: "${string_method_score_correction}" is not a valid value for the \`string_method_score_correction\` variable. Defaulting to "standard" method.`);}null !== float_multiplier_factor_skill_argument &&(float_multiplier_factor_skill = float_multiplier_factor_skill_argument),null !== float_multiplier_factor_max_cash_argument &&(float_multiplier_factor_max_cash = float_multiplier_factor_max_cash_argument),null !== float_multiplier_factor_growth_argument &&(float_multiplier_factor_growth = float_multiplier_factor_growth_argument);
1 * float_factor_skill +1 * float_factor_max_cash +1 * float_factor_growth
float_multiplier_factor_skill * float_factor_skill +float_multiplier_factor_max_cash * float_factor_max_cash +float_multiplier_factor_growth * float_factor_growth
// lshw.js - 7.25GB - Display information about one or more servers. TODO:// * add flags that prevent certain information from being displayed.
/* lshw.js - 7.25GB - Display information about one or more servers. TODO:* prevent parser from altering default values displayed in help message.* add flags that prevent certain information from being displayed.*/
const object_get_constants = function () {return {// default valuesobject_defaults: {// decimal places to use for displaying numerical informationinteger_precision: 2,// multiplier for skill factor used in server scoring systemfloat_multiplier_factor_skill: 1,// multiplier for max cash factor used in server scoring systemfloat_multiplier_factor_max_cash: 1,// multiplier for growth factor used in server scoring systemfloat_multiplier_factor_growth: 1,// correction method for factors used in server scoring system. can be "standard" or "normal"string_method_score_correction: "standard",float_sleep_duration: 0,},object_argument_names: {delay: {short: "d",long: "delay",},help: {short: "h",long: "help",},multiplier_skill: {short: "k",long: "multiplier-skill",},multiplier_cash: {short: "l",long: "multiplier-cash",},multiplier_growth: {short: "m",long: "multiplier-growth",},precision: {short: "p",long: "precision",},score_correction: {short: "q",long: "score-correction",},}}};
float_sleep_duration = 0,integer_precision = 2,
// multiplier for skill factor used in server scoring systemfloat_multiplier_factor_skill = object_defaults.float_multiplier_factor_skill,// multiplier for max cash factor used in server scoring systemfloat_multiplier_factor_max_cash = object_defaults.float_multiplier_factor_max_cash,// multiplier for growth factor used in server scoring systemfloat_multiplier_factor_growth = object_defaults.float_multiplier_factor_growth,// correction method for factors used in server scoring system. can be "standard" or "normal"string_method_score_correction = object_defaults.string_method_score_correction,float_sleep_duration = object_defaults.float_sleep_duration,integer_precision = object_defaults.integer_precision,
case "p":
case object_argument_names.multiplier_skill.short:// fall-throughcase object_argument_names.multiplier_skill.long:float_multiplier_factor_skill = argument_value;break;case object_argument_names.multiplier_cash.short:// fall-throughcase object_argument_names.multiplier_cash.long:float_multiplier_factor_max_cash = argument_value;break;case object_argument_names.multiplier_growth.short:// fall-throughcase object_argument_names.multiplier_growth.long:float_multiplier_factor_growth = argument_value;break;case object_argument_names.precision.short:
void_print_information(ns, string_server, integer_precision);
void_print_information(ns,string_server,integer_precision,string_method_score_correction,float_multiplier_factor_skill,float_multiplier_factor_max_cash,float_multiplier_factor_growth);
-p, --precision <INTEGER>INTEGER = The decimal places to display floating point values with. Should be an integer >= 0. Defaults to ${integer_precision}.
-${object_argument_names.multiplier_skill.short}, --${object_argument_names.multiplier_skill.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing your skill against the target server used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_skill}.-${object_argument_names.multiplier_cash.short}, --${object_argument_names.multiplier_cash.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing the target server's maximum cash used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_max_cash}.-${object_argument_names.multiplier_growth.short}, --${object_argument_names.multiplier_growth.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing the target server's growth used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_growth}.
FLAGS-h, --helpDisplays this message then exits.`
-${object_argument_names.precision.short}, --${object_argument_names.precision.long} <INTEGER>INTEGER = The decimal places to display floating point values with. Should be an integer >= 0. Defaults to ${object_defaults.integer_precision}.-${object_argument_names.score_correction.short}, --${object_argument_names.score_correction.long} <METHOD>METHOD = The method used to correct the factors used in the server scoring system. Can be "standard" (uses standard scoring) or "normal" (uses mean normalised scoring). Defaults to "${object_defaults.string_method_score_correction}".`
Score: ${float_get_server_score(ns, string_server).toFixed(integer_precision)}
Score: ${float_get_server_score(ns,string_server,string_method_score_correction,float_multiplier_factor_skill,float_multiplier_factor_max_cash,float_multiplier_factor_growth).toFixed(integer_precision)}
-e, --server <SERVER>SERVER = The name of a server on which scripts will be killed.FLAGS-h, --helpDisplays this message then exits.`
-${object_argument_names.server.short}, --${object_argument_names.server.long} <SERVER>SERVER = The name of a server on which scripts will be killed.`
`-k, --multiplier-skill <FLOAT>`FLOAT = The multiplier used to change the weight of the factor representing your skill against the target server used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to 1.`-l, --multiplier-cash <FLOAT>`FLOAT = The multiplier used to change the weight of the factor representing the target server's maximum cash used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to 1.`-m, --multiplier-growth <FLOAT>`FLOAT = The multiplier used to change the weight of the factor representing the target server's growth used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to 1.`-q, --score-correction <METHOD>`METHOD = The method used to correct the factors used in the server scoring system. Can be "standard" (uses standard scoring) or "normal" (uses mean normalised scoring). Defaults to "standard".`-v, --ram-cyclic-weaken <FLOAT>`FLOAT = The fraction of the botnet's available RAM to be used to run cyclic_weaken.js. Should be a floating point number > 0. Defaults to 0.5.#### EXAMPLES`run main.js`* Runs the script using default values.`run main.js -ao --no-botnet --job-cap 4000 -i "harakiri-sushi" -r 0.7 --steal-cap=0.5 -q normal`* Runs the script with up to 4000 jobs, targetting "harakiri-sushi", only upgrading/replacing servers when at least 0.7 of your network's total RAM is being used, stealing only up to 50% of harakiri-sushi's cash per "hack.js" job that finishes executing, and using the "mean normalised" score correction method, whilst the remaining variables are set to defaults. The "ram.js", "tor.js" and "botnet.js" helper scripts are also prevented from starting.---### "kill.js" (2.55 GB)* Kill all running scripts.* Optionally, kill only named scripts instead.* Optionally, kill only scripts on named servers instead.* Optionally, kill only named scripts on named servers instead.#### USAGE`run kill.js [FLAGS ...] [OPTIONS ...]`#### FLAGS`-h, --help`* Displays a help message then exits.#### OPTIONS`-c, --script <SCRIPT>`* SCRIPT = The name of a script to kill.`-e, --server <SERVER>`* SERVER = The name of a server on which scripts will be killed.#### EXAMPLES`run kill.js`* Kills all running scripts.`run kill.js -c grow.js --script hack.js`* Kills all scripts named "grow.js" and "hack.js" on any servers that they are currently running on.`run kill.js -e home --server harakiri-sushi`* Kills all scripts currently running on the "home" and "harakiri-sushi" servers.`run kill.js -c grow.js --script hack.js -e home --server harakiri-sushi`* Kills all scripts named "grow.js" and "hack.js" currently running on the "home" and "harakiri-sushi" servers.---### "lshw.js" (7.25 GB)* Display information about one or more servers.* Optionally, display the information at regular intervals.#### USAGE`run lshw.js [FLAGS ...] [OPTIONS ...] <ARGUMENT [ARGUMENT ...]>`* ARGUMENT = Server to display the information about.#### FLAGS`-h, --help`* Displays a help message then exits.#### OPTIONS`-d, --delay <SECONDS>`* 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.`-p, --precision <INTEGER>`* INTEGER = The decimal places to display floating point values with. Should be an integer >= 0. Defaults to 2.#### EXAMPLES`run lshw.js -d 1 --precision=4 home foodnstuff`* Causes the terminal to output up-to-date information about the "home" and "foodnstuff" servers every second, using 4 decimal places for the floating point values it displays.---### "cp.js" (2.65 GB)* Copy all files that contain particular substring(s) in their filenames from all servers to the current server.#### USAGE`run cp.js [FLAGS ...] <ARGUMENT [ARGUMENT ...]>`* ARGUMENT = Substring contained in the names of files to be copied to the current server.#### FLAGS`-h, --help`* Displays a help message then exits.#### EXAMPLES`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.---## InstallationSave all the `.js` files in this repository to the root directory of the "home" server using the same filenames that they currently have in this repository.---## LicenseThis Work is distributed and dual-licensed under the terms of both the [MIT License](https://nest.pijul.com/nicoty/bitburner_scripts:master/4bb17ded7a86f7decd) and the [Apache License 2.0](https://nest.pijul.com/nicoty/bitburner_scripts:master/4bb17ded7a86f7de02).### ContributionUnless You explicitly state otherwise, any Contribution submitted for inclusion in the Work by You, as defined in the Apache License 2.0, shall be dual-licensed as above, without any additional terms or conditions.