2WOLGB42T4EO7ZKLA5KFUYWVPTR6I3ET3FPJT4BSJFL43RRFRUBAC MKHG4OQBVXNOJFRUKKI2KN7VXJHXDWZUUYKGF22TKTBYEUEFCC5AC BKG7YVUVECDMXYJHUCUG2OULA4MSHZURNSDR7PYPPCSFM5ZV326QC HSNSECD5D3ACWDKZNIEV7RZZ54IE5K33WS3DR37ABHM5QP5JJPIAC 2BKHJI2SJ3VXTFBK2BWNN3I3BDNMUU5YTJGKTQCOXV66VVRHCGKAC SLSWBNYTIFKBFLKXZTMONGDMEOHSOOCOSU4KVJCONZG2DK3BBIUQC 3NFCZ6IPQPUCWANJN5WMUHUCHEQN7U5HZXMHDKVC6V6HXA3FG5YQC P6ZJC2SHPVYCBRAQPEF4727M5GSKSI7WSW3HBPAXFR7D6CGZUSYQC DJDWBCCQHQRKHGRKKQ32QY3WDEM7EKDDQ2YQLSSCS7HZTLHDRCFQC VMXI7PS4GFDOWPFLHQ7TYKJ5K3K7FXNPJCBEVYHTTRN7YB5ZHEQAC Y5OWMCQRLGQ56HMM53HR6CVZEMAHOEKDYMFLBDEQOJ4HLUJL7HUAC AXGQ7FMLMADYBZWHFQPYL6Q4W5G6AE4GTYTWAON4MIJRI7G6FE4AC NQ22FUSWN6CBJKJ5H7UV5N2KEXBIXVNQDNL2EK6UJ3E7RFLWNVDQC 6MBUKAG6VK6XXGRSER273IP2R35P3C5K3KOY4QVSZXEOYD3H4WRAC RWMZ7DVLOVPLR4FCIAVSABA5OESYUIEQ2OOZUYNPCNFEBYK5627AC 7SRULDRFXA6ZZUEXRPCDO7NIUJDREKYI3ESUYTOXMSPVMORDJXIQC for (;ns.getServerMoneyAvailable("home") >= ns.getUpgradeHomeRamCost() &&float_get_network_ram_utilisation(ns) > float_ram_utilisation_threshold;
try {for (;ns.getServerMoneyAvailable("home") >= ns.getUpgradeHomeRamCost() &&float_get_network_ram_utilisation(ns) > float_ram_utilisation_threshold;
} catch (error) {ns.print(JSON.stringify(error));}await ns.sleep(float_period_check);
} catch (error) {ns.print(JSON.stringify(error));
const object_get_stats = function(ns) {// try {// return ns.getStats();// }// catch (error) {// ns.tprint(JSON.stringify(error));// return {// hacking: ns.getHackingLevel(),// strength: 1,// defense: 1,// dexterity: 1,// agility: 1,// charisma: 1,// intelligence: 1// };// }return {hacking: ns.getHackingLevel(),strength: 1,defense: 1,dexterity: 1,agility: 1,charisma: 1,intelligence: 1};};
// lshw.js - 2.45GB - Display information about one or more servers.
// lshw.js - 7.25GB - Display information about one or more servers. TODO:// * add flags that prevent certain information from being displayed.import { object_parse_arguments } from "lib_minimist.js";import {float_get_time_hack,float_get_time_grow,float_get_time_weaken,} from "lib_time.js";import { float_get_server_score } from "lib_score.js";
let array_arguments = ns.args,float_sleep_duration = 0;for (;;) {
// variableslet float_sleep_duration = 0,integer_precision = 2,array_servers = [];// argument parsingconst object_arguments = object_parse_arguments(ns.args);for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case "d":// fall-throughcase "delay":float_sleep_duration = 1e3 * argument_value;break;case "p":// fall-throughcase "precision":integer_precision = argument_value;break;case "_":array_servers = argument_value;break;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw (ns.tprint(`ERROR: ${string_message_error}`), new Error(string_message_error));}}// mainfor (0 === array_servers.length && array_servers.push(ns.getHostName()); ; ) {
const string_argument = array_arguments[integer_indices_0];("--delay" !== string_argument && "-d" !== string_argument) ||((float_sleep_duration = 1e3 * array_arguments[integer_indices_0 + 1]),array_arguments.splice(integer_indices_0, 2));
const string_server = array_servers[integer_indices_0];
Maximum cash ($): ${float_cash_max}Current cash ($): ${float_cash_current.toFixed(2)}Current cash (%): ${((float_cash_current * 100) / float_cash_max).toFixed(2)}Minimum security: ${float_security_minimum}Current security: ${float_security_current}
Maximum cash ($): ${float_cash_max.toFixed(integer_precision)}Current cash ($): ${float_cash_current.toFixed(integer_precision)}Current cash (%): ${((float_cash_current * 100) / float_cash_max).toFixed(integer_precision)}Minimum security: ${float_security_minimum.toFixed(integer_precision)}Current security: ${float_security_current.toFixed(integer_precision)}
Hacking level needed: ${ns.getServerRequiredHackingLevel(string_server)}
hack() time (s): ${float_get_time_hack(ns, string_server, float_security_current).toFixed(integer_precision)}grow() time (s): ${float_get_time_grow(ns, string_server, float_security_current).toFixed(integer_precision)}weaken() time (s): ${float_get_time_weaken(ns, string_server, float_security_current).toFixed(integer_precision)}Hacking level needed: ${ns.getServerRequiredHackingLevel(string_server)}Score: ${float_get_server_score(ns, string_server).toFixed(integer_precision)}
RAM total (GB): ${float_ram_total}RAM used (GB): ${float_ram_used.toFixed(2)}RAM used (%): ${((float_ram_used * 100) / float_ram_total).toFixed(2)}RAM free (GB): ${float_ram_free.toFixed(2)}RAM free (%): ${((float_ram_free * 100) / float_ram_total).toFixed(2)}
RAM total (GB): ${float_ram_total.toFixed(integer_precision)}RAM used (GB): ${float_ram_used.toFixed(integer_precision)}RAM used (%): ${((float_ram_used * 100) / float_ram_total).toFixed(integer_precision)}RAM free (GB): ${float_ram_free.toFixed(integer_precision)}RAM free (%): ${((float_ram_free * 100) / float_ram_total).toFixed(integer_precision)}
* Causes the terminal to output up-to-date information about the "home" and "foodnstuff" servers every second.
* 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.