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.
[?]
May 12, 2020, 3:53 PM
SXEJJKPIZE6AFCHQ32SROLWQUP733MRJZXNAR7OR37VVSRJIFFJQCDependencies
- [2]
6TF4T3E2lshw.js: fix function call typo. - [3]
G7YVCY6Hlib_score.js: refactor. add two functions for score correction. remove unneeded arbitrary hard-coded multipliers. - [4]
ZRPOW4ERhacker.js, lib_time.js: supress error messages. hacker.js: use `getBitNodeMultipliers`. lib_time.js: use `getStats`. README.md: update. - [5]
6MBUKAG6remove unneeded functions and comments. update readme. - [6]
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. - [7]
3NFCZ6IPfixed the ram utilisation logic. added flags to `main.js` that can prevent the execution of helpers. - [8]
XQDYEN4Mhacker.js: change server scoring function. - [9]
VMXI7PS4added action cap. improved scoring system. fixed parts of security and cash predictors. made lshw loopable. - [10]
HLC2L3NJadd "tor.js" and "programs.js". use `minimist` for "main.js" argument parsing. - [11]
SLSWBNYTadded ram utilisation logic to `ram.js` and `servers.js`. split and refactored redundant code into separate library files. - [12]
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. - [13]
RYYLDBTSminor `README.md` change. - [14]
BZ6FC2BTadd `cp.js`. - [15]
4ACCU75Nimprove and refactor scheduling logic. - [16]
MKHG4OQBmake worker scripts and worker script executor time-aware. - [17]
P6ZJC2SHhacker.js: normalise factors used in server scoring function. - [18]
IVSW4A6Plib_score.js: normalised scores against average instead of using arbitrary values. - [19]
BKG7YVUVmain.js, hacker.js, servers.js, ram.js: refactor. - [20]
AXGQ7FMLsplit and refactor hacking logic to "hacker.js" and argument parsing and script execution logic to "main.js". update "README.md". - [21]
2BKHJI2Sinit - [22]
FA3U4WUJmore `README.md` changes. - [23]
NQ22FUSWadd more options to `main.js`. update `README.md`. - [24]
DJDWBCCQadd missing "nop.js". killall.js: rename to kill.js. add `--script` and `--server` options. - [25]
CJBGAILAadd optional `--target` parameter for `main.js`. update `README.md`. - [26]
RWMZ7DVLsplit and refactor various logics. update "README.md". - [27]
7SRULDRFminor refactoring. - [28]
HSNSECD5all: refactor. main.js: fix call to `void_kill_script_named_server_named`.
Change contents
- replacement in sbin/servers.js at line 65
let integer_indices_0 = 0;integer_indices_0 < array_servers_bought.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers_bought.length;++integer_index_server - replacement in sbin/servers.js at line 69
float_get_server_ram_total(ns, array_servers_bought[integer_indices_0]) <float_get_server_ram_total(ns, array_servers_bought[integer_index_server]) < - replacement in sbin/servers.js at line 82
let integer_indices_0 = 0;integer_indices_0 < array_servers_bought.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers_bought.length;++integer_index_server - replacement in sbin/servers.js at line 88
array_servers_bought[integer_indices_0]array_servers_bought[integer_index_server] - replacement in sbin/servers.js at line 91
((string_server_smallest = array_servers_bought[integer_indices_0]),((string_server_smallest = array_servers_bought[integer_index_server]), - replacement in sbin/servers.js at line 105
let integer_indices_0 = 0;integer_indices_0 < array_servers_bought.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers_bought.length;++integer_index_server - replacement in sbin/servers.js at line 111
array_servers_bought[integer_indices_0]array_servers_bought[integer_index_server] - replacement in sbin/servers.js at line 114
((string_server_biggest = array_servers_bought[integer_indices_0]),((string_server_biggest = array_servers_bought[integer_index_server]), - replacement in sbin/programs.js at line 9
let integer_indices_0 = 0;integer_indices_0 < array_programs.length;++integer_indices_0let integer_index_program = 0;integer_index_program < array_programs.length;++integer_index_program - replacement in sbin/programs.js at line 13
const string_program = array_programs[integer_indices_0];const string_program = array_programs[integer_index_program]; - replacement in sbin/hacker.js at line 2
* add a way to be able to target more than one server at a time.* add a function that will make and run a new schedule whilst there is already one running such that the newer schedule continues right after the old one finishes which would circumvent the down time that currently occurs after a schedule finishes running.* add a function that grinds XP by running cyclic weaken on a server using the remaining ram* remove unecessary cloning/copying* add a way to be able to target more than one server at a time? - replacement in sbin/hacker.js at line 7
* Maybe add functionality that allows on-the-fly hot loading of settings from a file.* add a job cap thing that prevents running more jobs if the first worker in a cycle finishes. add a thing to worker script that writes to a file (or to `window`) its identifier, when it started and when it finishes. add a padding optimiser that detects when tail collision occurs and increases padding each cycle if it does occur, and decreases it by half of how much it increases everytime no tail collision occurs* do we need to Add delay between each script execution?* add a job cap thing that prevents running more jobs if the first worker in a cycle finishes. add a thing to worker script that writes to a file (or to `window`) its identifier, when it started, and when it finishes. add a padding optimiser that detects when tail collision occurs and increases padding each cycle if it does occur, and decreases it by half of how much it increases everytime no tail collision occurs* add functionality that allows on-the-fly hot loading of settings from a file? - edit in sbin/hacker.js at line 10[5.6416]→[5.15445:15454](∅→∅),[5.15445]→[5.15445:15454](∅→∅),[5.15513]→[5.15513:15542](∅→∅),[5.15542]→[5.6417:6487](∅→∅),[5.6487]→[5.303:405](∅→∅),[5.405]→[5.6487:6562](∅→∅),[5.6487]→[5.6487:6562](∅→∅),[5.6562]→[5.406:494](∅→∅),[5.494]→[5.1094:1157](∅→∅),[5.6562]→[5.1094:1157](∅→∅)
import {float_get_server_ram_free,array_get_servers_rooted_sorted_by_ram,} from "lib_ram_server.js";import {float_get_time_hack,float_get_time_grow,float_get_time_weaken,} from "lib_time.js";import { boolean_can_server_run_script_threads } from "lib_ram_script.js";import {float_get_server_score,array_get_servers_hackable,} from "lib_score.js";import { boolean_array_scripts_any_running } from "lib_ps.js"; - edit in sbin/hacker.js at line 12
- edit in sbin/hacker.js at line 28
- replacement in sbin/hacker.js at line 30
const object_get_constants = function(ns) {const object_get_bitnode_multipliers = function(ns) {import {float_get_server_ram_total,float_get_server_ram_used,array_get_servers_useable} from "lib_ram_server.js";import { array_get_servers_hackable } from "lib_score.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";import { boolean_array_scripts_any_running } from "lib_ps.js";// https://stackoverflow.com/a/54157459const object_get_clone = function (object_original) {const object_serialised_deserialised = JSON.parse(JSON.stringify(object_original)),object_merged = Object.assign({}, object_original);return (Object.assign(object_merged, object_serialised_deserialised), object_merged);};const array_get_clone = function (array_original) {const array = [];for (let integer_index_element = 0;integer_index_element < array_original.length;++integer_index_element) {const element = array_original[integer_index_element];switch (typeof element) {case "object":// fall-throughcase "function":array.push(object_get_clone(element));break;default:array.push(element);}}return array;};const object_get_constants = function (ns) {const object_get_bitnode_multipliers = function (ns) { - replacement in sbin/botnet.js at line 11
let integer_indices_0 = 0;integer_indices_0 < array_servers_unrooted.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers_unrooted.length;++integer_index_server - replacement in sbin/botnet.js at line 15
const string_server_unrooted = array_servers_unrooted[integer_indices_0];const string_server_unrooted = array_servers_unrooted[integer_index_server]; - replacement in sbin/botnet.js at line 42
let integer_indices_0 = 0;integer_indices_0 < array_exploits.length;++integer_indices_0let integer_index_exploit = 0;integer_index_exploit < array_exploits.length;++integer_index_exploit - replacement in sbin/botnet.js at line 46
const string_exploit_function = array_exploits[integer_indices_0];const string_exploit_function = array_exploits[integer_index_exploit]; - replacement in lib/lib_time.js at line 2
const object_get_constants = function(ns) {const object_get_stats = function(ns) {const object_get_constants = function (ns) {const object_get_stats = function (ns) { - replacement in lib/lib_time.js at line 33
export const float_get_time_hack = function(ns, string_server_target, float_server_target_security) {export const float_get_time_hack = function (ns, string_server_target, float_server_target_security) { - replacement in lib/lib_time.js at line 54
export const float_get_time_grow = function(ns, string_server_target, float_server_target_security) {export const float_get_time_grow = function (ns, string_server_target, float_server_target_security) { - replacement in lib/lib_time.js at line 61
export const float_get_time_weaken = function(ns, string_server_target, float_server_target_security) {export const float_get_time_weaken = function (ns, string_server_target, float_server_target_security) { - replacement in lib/lib_servers.js at line 8
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in lib/lib_servers.js at line 12
const array_scan_results = ns.scan(array_servers[integer_indices_0]);const array_scan_results = ns.scan(array_servers[integer_index_server]); - replacement in lib/lib_servers.js at line 14
let integer_indices_1 = 0;integer_indices_1 < array_scan_results.length;++integer_indices_1let integer_index_scan_result = 0;integer_index_scan_result < array_scan_results.length;++integer_index_scan_result - replacement in lib/lib_servers.js at line 18
-1 === array_servers.indexOf(array_scan_results[integer_indices_1]) &&array_servers.push(array_scan_results[integer_indices_1]);-1 === array_servers.indexOf(array_scan_results[integer_index_scan_result]) &&array_servers.push(array_scan_results[integer_index_scan_result]); - edit in lib/lib_score.js at line 3
// return array of rooted servers that have required hacking levels <= current hacking level, growth rates > 0 and max cash > 0export const array_get_servers_hackable = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let array_servers_hackable = [];for (let integer_indices_0 = 0;integer_indices_0 < array_servers_rooted.length;++integer_indices_0) {const string_server = array_servers_rooted[integer_indices_0];ns.getHackingLevel() > ns.getServerRequiredHackingLevel(string_server) &&ns.getServerMaxMoney(string_server) > 0 &&ns.getServerGrowth(string_server) > 0 &&array_servers_hackable.push(string_server);}return array_servers_hackable;}; - replacement in lib/lib_score.js at line 7
let integer_indices_0 = 0;integer_indices_0 < array_numbers.length;++integer_indices_0let integer_index_number = 0;integer_index_number < array_numbers.length;++integer_index_number - replacement in lib/lib_score.js at line 11
float_total += array_numbers[integer_indices_0];float_total += array_numbers[integer_index_number]; - replacement in lib/lib_score.js at line 22
let integer_indices_0 = 0;integer_indices_0 < array_numbers.length;++integer_indices_0let integer_index_number = 0;integer_index_number < array_numbers.length;++integer_index_number - replacement in lib/lib_score.js at line 27
array_numbers[integer_indices_0] - float_mean,array_numbers[integer_index_number] - float_mean, - replacement in lib/lib_score.js at line 59
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in lib/lib_score.js at line 63
array_servers_trait.push(float_get_trait_score(ns, array_servers[integer_indices_0]));array_servers_trait.push(float_get_trait_score(ns, array_servers[integer_index_server])); - edit in lib/lib_score.js at line 81
// return array of rooted servers that have required hacking levels <= current hacking level, growth rates > 0 and max cash > 0export const array_get_servers_hackable = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let array_servers_hackable = [];for (let integer_index_server = 0;integer_index_server < array_servers_rooted.length;++integer_index_server) {const string_server = array_servers_rooted[integer_index_server];ns.getHackingLevel() > ns.getServerRequiredHackingLevel(string_server) &&ns.getServerMaxMoney(string_server) > 0 &&ns.getServerGrowth(string_server) > 0 &&array_servers_hackable.push(string_server);}return array_servers_hackable;}; - replacement in lib/lib_root.js at line 12
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in lib/lib_root.js at line 16
ns.hasRootAccess(array_servers[integer_indices_0]) &&array_servers_rooted.push(array_servers[integer_indices_0]);ns.hasRootAccess(array_servers[integer_index_server]) &&array_servers_rooted.push(array_servers[integer_index_server]); - replacement in lib/lib_root.js at line 26
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in lib/lib_root.js at line 30
ns.hasRootAccess(array_servers[integer_indices_0]) ||array_servers_unrooted.push(array_servers[integer_indices_0]);ns.hasRootAccess(array_servers[integer_index_server]) ||array_servers_unrooted.push(array_servers[integer_index_server]); - replacement in lib/lib_ram_server.js at line 8
export const float_get_server_ram_total = function(ns, string_server) {return (ns.getServerRam(string_server))[0];export const float_get_server_ram_total = function (ns, string_server) {return ns.getServerRam(string_server)[0]; - replacement in lib/lib_ram_server.js at line 13
const float_get_server_ram_used = function(ns, string_server) {return (ns.getServerRam(string_server))[1];export const float_get_server_ram_used = function (ns, string_server) {return ns.getServerRam(string_server)[1]; - replacement in lib/lib_ram_server.js at line 30
let integer_indices_0 = 0;integer_indices_0 < array_servers_rooted.length;++integer_indices_0let integer_index_server_rooted = 0;integer_index_server_rooted < array_servers_rooted.length;++integer_index_server_rooted - replacement in lib/lib_ram_server.js at line 36
array_servers_rooted[integer_indices_0]array_servers_rooted[integer_index_server_rooted] - edit in lib/lib_ram_server.js at line 63
};// returns an array of rooted servers that have ram > 0export const array_get_servers_useable = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let array_servers_useable = [];for (let integer_index_server_rooted = 0;integer_index_server_rooted < array_servers_rooted.length;++integer_index_server_rooted) {const string_server_rooted =array_servers_rooted[integer_index_server_rooted];float_get_server_ram_total(ns, string_server_rooted) > 0 &&array_servers_useable.push(string_server_rooted);}return array_servers_useable; - replacement in lib/lib_ps.js at line 7
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in lib/lib_ps.js at line 11
const string_server = array_servers[integer_indices_0],const string_server = array_servers[integer_index_server], - replacement in lib/lib_ps.js at line 15
let integer_indices_1 = 0;integer_indices_1 < array_scripts_running.length;++integer_indices_1let integer_index_script = 0;integer_index_script < array_scripts_running.length;++integer_index_script - replacement in lib/lib_ps.js at line 19
const object_script = array_scripts_running[integer_indices_1],const object_script = array_scripts_running[integer_index_script], - replacement in lib/lib_ps.js at line 30
let integer_indices_0 = 0;integer_indices_0 < array_scripts.length;++integer_indices_0let integer_index_script = 0;integer_index_script < array_scripts.length;++integer_index_script - replacement in lib/lib_ps.js at line 34
return boolean_script_running(ns, array_scripts[integer_indices_0]);return boolean_script_running(ns, array_scripts[integer_index_script]); - replacement in lib/lib_ls.js at line 11
let integer_indices_0 = 0;integer_indices_0 < array_files_in_server.length;++integer_indices_0let integer_index_file = 0;integer_index_file < array_files_in_server.length;++integer_index_file - replacement in lib/lib_ls.js at line 15
const string_file = array_files_in_server[integer_indices_0];const string_file = array_files_in_server[integer_index_file]; - edit in bin/main.js at line 2[5.2502]→[5.2584:2639](∅→∅),[5.2584]→[5.2584:2639](∅→∅),[5.2639]→[5.1607:1625](∅→∅),[5.1607]→[5.1607:1625](∅→∅)
* figure out a better way for this to run "hacker.js"* add --help flag - edit in bin/main.js at line 3
* Maybe make a cache script that saves runtime constants like max money of servers to a cache file to potentially reduce RAM usage further. - 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* figure out a better way for this to run "hacker.js"* Maybe make a cache script that saves runtime constants like max money of servers to a cache file to potentially reduce RAM usage further. - edit in bin/main.js at line 15[5.9848]→[5.9848:9990](∅→∅),[5.9990]→[5.3462:3514](∅→∅),[5.3514]→[5.9990:10048](∅→∅),[5.9990]→[5.9990:10048](∅→∅),[5.10048]→[5.1874:1875](∅→∅),[5.1874]→[5.1874:1875](∅→∅),[5.2084]→[5.2084:2486](∅→∅),[5.2486]→[5.10049:10384](∅→∅),[5.10384]→[5.2061:2150](∅→∅),[5.2150]→[5.2879:2959](∅→∅),[5.10451]→[5.2879:2959](∅→∅),[5.2879]→[5.2879:2959](∅→∅),[5.2959]→[5.1792:1887](∅→∅),[5.1887]→[5.2151:2181](∅→∅),[5.2181]→[3.4620:4751](∅→∅),[5.1953]→[5.3144:3468](∅→∅),[5.2215]→[5.3144:3468](∅→∅),[3.4751]→[5.3144:3468](∅→∅),[5.3144]→[5.3144:3468](∅→∅),[5.3468]→[5.1954:2039](∅→∅),[5.2039]→[5.3527:3572](∅→∅),[5.3527]→[5.3527:3572](∅→∅),[5.3572]→[5.10452:10485](∅→∅),[5.10485]→[5.5003:5090](∅→∅),[5.5003]→[5.5003:5090](∅→∅),[5.5090]→[5.10486:10561](∅→∅),[5.10561]→[5.5164:5238](∅→∅),[5.5164]→[5.5164:5238](∅→∅),[5.5238]→[5.10562:10698](∅→∅),[5.10698]→[5.5340:5410](∅→∅),[5.5340]→[5.5340:5410](∅→∅),[5.5410]→[5.10699:10741](∅→∅),[5.10741]→[5.5451:5526](∅→∅),[5.5451]→[5.5451:5526](∅→∅),[5.5526]→[5.10742:11036](∅→∅),[5.11036]→[5.5703:5776](∅→∅),[5.5703]→[5.5703:5776](∅→∅),[5.5776]→[5.11037:11086](∅→∅),[5.11086]→[5.5823:5840](∅→∅),[5.5823]→[5.5823:5840](∅→∅),[5.5840]→[5.11087:11137](∅→∅),[5.11137]→[5.5892:6016](∅→∅),[5.5892]→[5.5892:6016](∅→∅),[5.6016]→[5.11138:12495](∅→∅),[5.12495]→[5.7245:7251](∅→∅),[5.7245]→[5.7245:7251](∅→∅),[5.7255]→[5.7255:7490](∅→∅),[5.7490]→[5.12496:12653](∅→∅),[5.12685]→[5.12685:12805](∅→∅),[5.12805]→[5.7747:8432](∅→∅),[5.7747]→[5.7747:8432](∅→∅),[5.8432]→[5.12806:13062](∅→∅),[5.13062]→[5.8665:8728](∅→∅),[5.8665]→[5.8665:8728](∅→∅),[5.8728]→[5.13063:13327](∅→∅),[5.13327]→[5.8979:9052](∅→∅),[5.8979]→[5.8979:9052](∅→∅),[5.9052]→[5.13328:13461](∅→∅),[5.13461]→[5.9161:9244](∅→∅),[5.9161]→[5.9161:9244](∅→∅),[5.9244]→[5.13462:13828](∅→∅),[5.14613]→[5.14613:14617](∅→∅),[5.14630]→[5.14630:16094](∅→∅),[5.16142]→[5.16142:16729](∅→∅),[5.16729]→[5.9611:9615](∅→∅),[5.9611]→[5.9611:9615](∅→∅),[5.9615]→[5.16730:18171](∅→∅)
import { boolean_can_server_run_script_threads } from "lib_ram_script.js";import { void_kill_script_named_server_named } from "lib_kill.js";import { boolean_script_running } from "lib_ps.js";import { object_parse_arguments } from "lib_minimist.js";// mainexport const main = async function(ns) {// variables// helper scriptsconst object_helpers = object_get_constants().object_helpers;// threads of "nop.js" required to reserve enough RAM to run "hacker.js"const integer_threads_nop = integer_get_threads_nop(ns, object_helpers.string_hacker, ns.getScriptName());// if this server doesn't have enough RAM to run "hacker.js", ejectif (!boolean_can_server_run_script_threads(ns,float_get_server_ram_free(ns, ns.getHostname()),object_helpers.string_nop,integer_threads_nop)) {const string_message_error = `This server has insufficient RAM to run "${object_helpers.string_nop}" with "${integer_threads_nop}" thread(s).`;throw (ns.tprint(`ERROR: ${integer_threads_nop}`), new Error(string_message_error));}// name of purchased serverslet string_servers_bought_name = "server";// maximum amount of jobs to execute per schedule, used to prevent using up too much IRL RAMlet integer_job_cap = 1000;// duration between each job used to prevent collisions between them to keep them in sequencelet float_padding_seconds = 0.5;// precision of the percentage to steal calculatorlet float_precision = 0.001;// the maximum percentage of cash that should be stolen from a serverlet float_steal_cap = 0.9;// time period used for checking the time in secondslet float_period_check_seconds = 10;// targetlet string_server_target = "";// ram utilisiation threshold. upgrade ram or buy or replace servers when reached.let float_ram_utilisation_threshold = 0.9;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>let array_helpers = [{file: object_helpers.string_ram,threads: 1,args: [float_period_check_seconds, float_ram_utilisation_threshold],},{file: object_helpers.string_servers,threads: 1,args: [float_period_check_seconds,string_servers_bought_name,float_ram_utilisation_threshold,],},{file: object_helpers.string_tor,threads: 1,args: [float_period_check_seconds],},{file: object_helpers.string_programs,threads: 1,args: [float_period_check_seconds,["BruteSSH.exe","FTPCrack.exe","relaySMTP.exe","HTTPWorm.exe","SQLInject.exe","DeepscanV1.exe","DeepscanV2.exe","Autolink.exe",],],},{file: object_helpers.string_botnet,threads: 1,args: [float_period_check_seconds],},];// flagsfor (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];(("a" === string_argument && argument_value) ||("ram" === string_argument && !argument_value)) &&array_helpers.splice(integer_get_index_of_file(array_helpers, object_helpers.string_ram),1),(("e" === string_argument && argument_value) ||("servers" === string_argument && !argument_value)) &&array_helpers.splice(integer_get_index_of_file(array_helpers,object_helpers.string_servers),1),(("o" === string_argument && argument_value) ||("tor" === string_argument && !argument_value)) &&array_helpers.splice(integer_get_index_of_file(array_helpers, object_helpers.string_tor),1),(("g" === string_argument && argument_value) ||("programs" === string_argument && !argument_value)) &&array_helpers.splice(integer_get_index_of_file(array_helpers,object_helpers.string_programs),1),(("b" === string_argument && argument_value) ||("botnet" === string_argument && !argument_value)) &&array_helpers.splice(integer_get_index_of_file(array_helpers,object_helpers.string_botnet),1);}// main// reserve enough RAM for "hacker.js"ns.exec(object_helpers.string_nop, ns.getHostname(), integer_threads_nop);void_copy_scripts(ns);void_script_executor(ns, array_helpers);// kill "nop.js" scripts to free RAMvoid_kill_script_named_server_named(ns,ns.getHostname(),object_helpers.string_nop);ns.spawn(object_helpers.string_hacker,1,integer_job_cap,float_precision,float_steal_cap,float_padding_seconds,string_server_target);};// functionsconst object_get_constants = function() {return {// helper scriptsobject_helpers: {string_nop: "nop.js",string_hacker: "hacker.js",string_ram: "ram.js",string_servers: "servers.js",string_tor: "tor.js",string_programs: "programs.js",string_botnet: "botnet.js"}};};// return the difference in RAM requirements between two scriptsconst float_get_ram_difference = function(ns, string_script_0, string_script_1) {return ns.getScriptRam(string_script_0) - ns.getScriptRam(string_script_1);};// return the amount of threads of "nop.js" is required to make up RAM difference between two scriptsconst integer_get_threads_nop = function (ns,string_script_0,string_script_1) {return Math.ceil(float_get_ram_difference(ns, string_script_0, string_script_1) /ns.getScriptRam(object_get_constants().object_helpers.string_nop));};// copy all scripts from the current server to all serversconst void_copy_scripts = function (ns) {const string_host = ns.getHostname(),array_script_extensions = [".js", ".ns", ".script"];for (let integer_indices_0 = 0;integer_indices_0 < array_script_extensions.length;++integer_indices_0) {const string_extension = array_script_extensions[integer_indices_0];void_copy_files_to_servers(ns,array_get_files_to_copy(ns, string_host, string_extension),string_host);}};// returns the index of the scripts array which matches the filename inputconst integer_get_index_of_file = function (array_scripts, string_file) {for (let integer_indices_0 = 0;integer_indices_0 < array_scripts.length;++integer_indices_0) {const object_script = array_scripts[integer_indices_0],string_script_file = object_script.file;if (string_script_file === string_file) return integer_indices_0;}};// copies files to all rooted serversconst void_copy_files_to_servers = function (ns, array_files, string_source) {const array_servers = array_get_servers(ns);for (let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0)for (let integer_indices_1 = 0;integer_indices_1 < array_files.length;++integer_indices_1)ns.scp(array_files[integer_indices_1],string_source,array_servers[integer_indices_0]);};// runs scripts on any server that has enough available RAMconst void_script_executor = function (ns, array_scripts) {const array_servers_rooted_sorted_by_ram = array_get_servers_rooted_sorted_by_ram(ns);for (let integer_indices_0 = 0;integer_indices_0 < array_scripts.length;++integer_indices_0) {const object_script = array_scripts[integer_indices_0],string_file = object_script.file,float_ram = ns.getScriptRam(string_file),integer_threads = object_script.threads,array_arguments = object_script.args;if (!boolean_script_running(ns, string_file))// use servers with the biggest rams firstfor (let integer_indices_1 = array_servers_rooted_sorted_by_ram.length - 1;integer_indices_1 >= 0;--integer_indices_1) {const string_server_used =array_servers_rooted_sorted_by_ram[integer_indices_1];if (float_get_server_ram_free(ns, string_server_used) >=float_ram * integer_threads) {try {ns.exec(string_file,string_server_used,integer_threads,...array_arguments);} catch (error) {ns.tprint(JSON.stringify(error));}break;}0 === integer_indices_1 &&ns.tprint(`WARNING: Unable to find a server with sufficient RAM to run \"${string_file}\".`);}}};================================// argument parsing// optionsconst 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 "c":// fall-throughcase "check-delay":float_period_check_seconds = argument_value;break;case "d":// fall-throughcase "job-delay":float_padding_seconds = argument_value;break;case "i":// fall-throughcase "target":string_server_target = argument_value;break;case "j":// fall-throughcase "job-cap":integer_job_cap = argument_value;break;case "n":// fall-throughcase "server-name":string_servers_bought_name = argument_value;break;case "p":// fall-throughcase "precision":float_precision = argument_value;break;case "r":// fall-throughcase "ram-utilisation":float_ram_utilisation_threshold = argument_value;break;case "s":// fall-throughcase "steal-cap":float_steal_cap = argument_value;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< - replacement in bin/lshw.js at line 14
let float_sleep_duration = 0,letfloat_sleep_duration = 0, - replacement in bin/lshw.js at line 17
array_servers = [];array_servers = [],boolean_print_help = !1; - edit in bin/lshw.js at line 30
case "h":// fall-throughcase "help":boolean_print_help = argument_value;break; - edit in bin/lshw.js at line 50
if (boolean_print_help)return void_print_help(ns, integer_precision); - replacement in bin/lshw.js at line 54[5.18378]→[5.18378:18411](∅→∅),[5.18411]→[5.3619:3667](∅→∅),[5.3667]→[5.18461:18487](∅→∅),[5.18461]→[5.18461:18487](∅→∅)
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in bin/lshw.js at line 58
const string_server = array_servers[integer_indices_0];const string_server = array_servers[integer_index_server]; - replacement in bin/lshw.js at line 71[5.19014]→[5.3802:3883](∅→∅),[5.3883]→[5.11967:12179](∅→∅),[5.11967]→[5.11967:12179](∅→∅),[5.12179]→[5.19015:19105](∅→∅)
const void_print_information = function (ns, string_server, integer_precision) {const float_cash_max = ns.getServerMaxMoney(string_server);const float_cash_current = ns.getServerMoneyAvailable(string_server);const float_security_minimum = ns.getServerMinSecurityLevel(string_server);const float_security_current = Math.round(ns.getServerSecurityLevel(string_server)const void_print_help = function (ns,integer_precision) {ns.tprint(`DESCRIPTIONDisplay information about one or more servers.Optionally, display the information at regular intervals.USAGErun lshw.js [OPTIONS ...] <ARGUMENT [ARGUMENT ...]>ARGUMENT = Server to display the information about.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 ${integer_precision}.FLAGS-h, --helpDisplays this message then exits.` - replacement in bin/lshw.js at line 97
const array_ram = ns.getServerRam(string_server);const float_ram_total = array_ram[0];const float_ram_used = array_ram[1];const float_ram_free = array_ram[0] - array_ram[1];const string_server_information =};const void_print_information = function (ns,string_server,integer_precision) {constfloat_cash_max = ns.getServerMaxMoney(string_server),float_cash_current = ns.getServerMoneyAvailable(string_server),float_security_minimum = ns.getServerMinSecurityLevel(string_server),float_security_current = ns.getServerSecurityLevel(string_server),array_ram = ns.getServerRam(string_server),float_ram_total = array_ram[0],float_ram_used = array_ram[1],float_ram_free = array_ram[0] - array_ram[1],string_server_information = - replacement in bin/kill.js at line 1
// kill.js - 2.55GB - TODO:// * maybe implement a loop that repeats logic until all appropriate scripts have actually been killed./* kill.js - 2.55GB - TODO:* maybe implement a loop that repeats logic until all appropriate scripts have actually been killed.*/ - replacement in bin/kill.js at line 9
export const main = async function(ns) {export const main = async function (ns) { - replacement in bin/kill.js at line 11
let array_servers = [];let array_scripts = [];letarray_servers = [],array_scripts = [],boolean_print_help = !1; - replacement in bin/kill.js at line 25
array_scripts.push(argument_value);"object" == typeof argument_value? array_scripts.push(...argument_value): array_scripts.push(argument_value); - replacement in bin/kill.js at line 32
array_servers.push(argument_value);"object" == typeof argument_value? array_servers.push(...argument_value): array_servers.push(argument_value);break;case "h":// fall-throughcase "help":boolean_print_help = argument_value; - edit in bin/kill.js at line 51
if (boolean_print_help)return void_print_help(ns); - edit in bin/kill.js at line 64
const void_print_help = function (ns) {ns.tprint(`DESCRIPTIONKill 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.USAGErun kill.js [FLAGS ...] [OPTIONS ...]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.FLAGS-h, --helpDisplays this message then exits.`);}; - replacement in bin/kill.js at line 96
let integer_indices_0 = 0;integer_indices_0 < array_scripts.length;++integer_indices_0let integer_index_script = 0;integer_index_script < array_scripts.length;++integer_index_script - replacement in bin/kill.js at line 100
const string_script = array_scripts[integer_indices_0];const string_script = array_scripts[integer_index_script]; - replacement in bin/kill.js at line 112
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in bin/kill.js at line 116
const string_server = array_servers[integer_indices_0];const string_server = array_servers[integer_index_server]; - replacement in bin/kill.js at line 130
let integer_indices_0 = 0;integer_indices_0 < array_scripts_running.length;++integer_indices_0let integer_index_script = 0;integer_index_script < array_scripts_running.length;++integer_index_script - replacement in bin/kill.js at line 134
const object_script = array_scripts_running[integer_indices_0],const object_script = array_scripts_running[integer_index_script], - replacement in bin/kill.js at line 144
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in bin/kill.js at line 148
const string_server = array_servers[integer_indices_0];const string_server = array_servers[integer_index_server]; - edit in bin/cp.js at line 2
import { object_parse_arguments } from "lib_minimist.js"; - replacement in bin/cp.js at line 8
const array_arguments = ns.args;// argument parsingconst object_arguments = object_parse_arguments(ns.args);let array_substrings = [];for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case "h":// fall-throughcase "help":boolean_print_help = argument_value;break;case "_":"object" == typeof argument_value? array_substrings.push(...argument_value): array_substrings.push(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));}}// mainif (boolean_print_help)return void_print_help(ns); - replacement in bin/cp.js at line 35
let integer_indices_0 = 0;integer_indices_0 < array_arguments.length;++integer_indices_0let integer_index_substring = 0;integer_index_substring < array_substrings.length;++integer_index_substring - replacement in bin/cp.js at line 39
const string_substring = array_arguments[integer_indices_0];const string_substring = array_substrings[integer_index_substring]; - edit in bin/cp.js at line 45
const void_print_help = function (ns) {ns.tprint(`DESCRIPTIONCopy all files that contain particular substring(s) in their filenames from all servers to the current server.USAGErun cp.js [FLAGS ...] <ARGUMENT [ARGUMENT ...]>ARGUMENT = Substring contained in the names of files to be copied to the current server.FLAGS-h, --helpDisplays this message then exits.`);}; - replacement in bin/cp.js at line 85
let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server - replacement in bin/cp.js at line 89
const string_server_source = array_servers[integer_indices_0],const string_server_source = array_servers[integer_index_server], - replacement in bin/cp.js at line 96
let integer_indices_1 = 0;integer_indices_1 < array_files_to_copy.length;++integer_indices_1let integer_index_file = 0;integer_index_file < array_files_to_copy.length;++integer_index_file - replacement in bin/cp.js at line 100
const string_file_to_copy = array_files_to_copy[integer_indices_1];const string_file_to_copy = array_files_to_copy[integer_index_file]; - replacement in README.md at line 26[5.3327]→[5.9622:9664](∅→∅),[5.7256]→[5.3353:3400](∅→∅),[5.9664]→[5.3353:3400](∅→∅),[5.3353]→[5.3353:3400](∅→∅),[5.3400]→[5.3644:3794](∅→∅),[5.3794]→[5.3568:3600](∅→∅),[5.3568]→[5.3568:3600](∅→∅),[5.3600]→[3.4758:4880](∅→∅)
`run main.js [OPTIONS ...] [FLAGS ...]`#### OPTIONS`-c, --check-delay <SECONDS>`* 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.`-d, --job-delay <SECONDS>`* SECONDS = The duration of delay between each job, in seconds. Should be a floating-point number > 0. Defaults to 0.5.`run main.js [FLAGS ...] [OPTIONS ...]` - edit in README.md at line 28[5.3723]→[5.3723:3750](∅→∅),[5.3750]→[5.6241:6526](∅→∅),[5.6526]→[5.4035:4060](∅→∅),[5.4035]→[5.4035:4060](∅→∅),[5.3043]→[5.3499:3500](∅→∅),[5.4060]→[5.3499:3500](∅→∅),[5.3499]→[5.3499:3500](∅→∅),[5.3500]→[5.5609:5715](∅→∅),[5.2275]→[5.4162:4684](∅→∅),[5.5715]→[5.4162:4684](∅→∅),[5.4162]→[5.4162:4684](∅→∅),[5.4684]→[5.11621:12018](∅→∅),[5.12018]→[5.4684:4712](∅→∅),[5.4684]→[5.4684:4712](∅→∅),[5.4712]→[5.2276:2418](∅→∅),[5.2418]→[5.4855:4856](∅→∅),[5.4855]→[5.4855:4856](∅→∅)
`-i, --target <SERVER>`* SERVER = The server that should be targetted by the `weaken`, `grow` and `hack` functions. Should be a string. Defaults to choosing an optimal target using a scoring system based on the server's maximum cash, growth, required hacking level, and the player's current hacking level.`-j, --job-cap <CAP>`* CAP = The maximum amount of jobs to execute per schedule. Should be an integer > 0. Defaults to 1000.`-n, --server-name <NAME>`* NAME = The name to be used for purchased servers. Should be a string. Defaults to "server".`-p, --precision <PRECISION>`* PRECISION = A value used in determining how many cycles of bisection the binary search algorithm used for the percentage to steal calculator should use. Should be a floating point number > 0 <= 1. Values closer to 0 will result in greater precision in the calculation, but potentially longer run-times and compared to values closer to 1. Defaults to 0.001.`-r, --ram-utilisation <THRESHOLD>`* THRESHOLD = The botnet's ram utilisation threshold after which upgrades/replacements should be bought for servers and the RAM of "home". Should be a floating point number >= 0 <= 1. Values closer to 0 will result in attempting more frequent upgrades/replacements at the cost of less efficient RAM utilisation to cash spenditure ratios. Defaults to 0.9.`-s, --steal-cap <CAP>`* CAP = The maximum amount fraction of cash to steal from the target server per `hack` job. Should be an integer >= 0 <=1. Defaults to 0.9. - edit in README.md at line 41
`-h, --help`* Displays a help message then exits. - edit in README.md at line 52[5.4604]→[5.6337:6338](∅→∅),[5.6337]→[5.6337:6338](∅→∅),[5.6338]→[5.4856:4930](∅→∅),[5.7685]→[5.4856:4930](∅→∅),[5.4856]→[5.4856:4930](∅→∅),[5.4930]→[5.6339:6429](∅→∅),[5.6429]→[5.4988:4989](∅→∅),[5.7766]→[5.4988:4989](∅→∅),[5.12084]→[5.4988:4989](∅→∅),[5.4988]→[5.4988:4989](∅→∅),[5.4989]→[5.6430:6831](∅→∅),[5.6733]→[5.5163:5169](∅→∅),[5.6831]→[5.5163:5169](∅→∅),[5.8158]→[5.5163:5169](∅→∅),[5.12406]→[5.5163:5169](∅→∅),[5.5163]→[5.5163:5169](∅→∅),[5.5169]→[5.9665:9689](∅→∅),[5.5196]→[5.3528:3558](∅→∅),[5.9689]→[5.3528:3558](∅→∅),[5.45287]→[5.3528:3558](∅→∅),[5.3528]→[5.3528:3558](∅→∅),[5.3558]→[5.9690:9865](∅→∅)
#### EXAMPLES`run main.js`* Runs the script using default values.`run main.js --job-cap 4000 -i "harakiri-sushi" -r 0.7 --steal-cap=0.5 -ao --no-botnet`* 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, and stealing only up to 50% of harakiri-sushi's cash per "hack.js" job that finishes executing, 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. - edit in README.md at line 53
#### USAGE`run kill.js [OPTIONS ...]` - replacement in README.md at line 54
`-c, --script <SCRIPT>``-c, --check-delay <SECONDS>` - replacement in README.md at line 56
* SCRIPT = The name of a scripts to kill.* 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. - replacement in README.md at line 58
`-e, --server <SERVER>``-d, --job-delay <SECONDS>` - replacement in README.md at line 60
* SERVER = The name of a server on which running scripts will be killed.* SECONDS = The duration of delay between each job, in seconds. Should be a floating-point number > 0. Defaults to 1. - replacement in README.md at line 62[5.5393]→[5.5393:5407](∅→∅),[5.5407]→[5.10085:10178](∅→∅),[5.10178]→[5.5442:5443](∅→∅),[5.5442]→[5.5442:5443](∅→∅),[5.5443]→[5.6734:6837](∅→∅),[5.6837]→[5.10179:10505](∅→∅),[5.6837]→[5.5546:5552](∅→∅),[5.10505]→[5.5546:5552](∅→∅),[5.5546]→[5.5546:5552](∅→∅),[5.5552]→[5.5716:5740](∅→∅),[5.5576]→[5.3600:3651](∅→∅),[5.5740]→[5.3600:3651](∅→∅),[5.45312]→[5.3600:3651](∅→∅),[5.3600]→[5.3600:3651](∅→∅),[5.3651]→[5.5577:5651](∅→∅),[5.5651]→[5.5741:5797](∅→∅),[5.5797]→[5.5703:5774](∅→∅),[5.5703]→[5.5703:5774](∅→∅),[5.5774]→[5.4665:4691](∅→∅),[5.4691]→[5.5805:5806](∅→∅),[5.5805]→[5.5805:5806](∅→∅),[5.5806]→[5.4692:4902](∅→∅),[5.4902]→[5.6022:6023](∅→∅),[5.6022]→[5.6022:6023](∅→∅),[5.6023]→[5.5798:5943](∅→∅)
#### 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 [OPTIONS ...] <ARGUMENT [ARGUMENT ...]>`* ARGUMENT = Server to display the information about.#### 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.`-i, --target <SERVER>` - replacement in README.md at line 64
#### EXAMPLES`run lshw.js -d 1 --precision=4 home foodnstuff`* SERVER = The server that should be targetted by the `weaken`, `grow` and `hack` functions. Should be a string. Defaults to choosing an optimal target using a scoring system based on the server's maximum cash, growth, required hacking level, and the player's current hacking level. - replacement in README.md at line 66
* 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.`-j, --job-cap <CAP>` - replacement in README.md at line 68
---* CAP = The maximum amount of jobs to execute per schedule. Should be an integer > 0. Defaults to 300. - replacement in README.md at line 70[5.3873390]→[5.45313:45335](∅→∅),[5.6219]→[5.3004:3119](∅→∅),[5.45335]→[5.3004:3119](∅→∅),[5.3004]→[5.3004:3119](∅→∅),[5.3119]→[5.3668:3669](∅→∅),[5.3668]→[5.3668:3669](∅→∅),[5.3669]→[5.6220:6271](∅→∅),[5.6271]→[5.3760:3761](∅→∅),[5.3760]→[5.3760:3761](∅→∅),[5.3761]→[5.6272:6365](∅→∅)
### "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 <ARGUMENT [ARGUMENT ...]>`* ARGUMENT = Substring contained in the names of files to be copied to the current server.`-n, --server-name <NAME>` - replacement in README.md at line 72
#### EXAMPLES`run cp.js .lit .script .txt`* NAME = The name to be used for purchased servers. Should be a string. Defaults to "server". - replacement in README.md at line 74
* Copies all files that contain the strings ".lit", ".script" or ".txt" in their filename from all servers to the current server.`-p, --precision <PRECISION>` - replacement in README.md at line 76
---* PRECISION = A value used in determining how many cycles of bisection the binary search algorithm used for the percentage to steal calculator should use. Should be a floating point number > 0 <= 1. Values closer to 0 will result in greater precision in the calculation, but potentially longer run-times and compared to values closer to 1. Defaults to 0.01. - replacement in README.md at line 78
## 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.`-r, --ram-utilisation <THRESHOLD>` - replacement in README.md at line 80
---* THRESHOLD = The botnet's ram utilisation threshold after which upgrades/replacements should be bought for servers and the RAM of "home". Should be a floating point number >= 0 <= 1. Values closer to 0 will result in attempting more frequent upgrades/replacements at the cost of less efficient RAM utilisation to cash spenditure ratios. Defaults to 0.9. - replacement in README.md at line 82[5.2133]→[5.3873768:3873779](∅→∅),[5.3873768]→[5.3873768:3873779](∅→∅),[5.3873779]→[5.12407:12672](∅→∅)
## 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).`-s, --steal-cap <CAP>` - replacement in README.md at line 84
### 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.[5.3873925]* CAP = The maximum amount fraction of cash to steal from the target server per `hack` job. Should be an integer >= 0 <=1. Defaults to 0.9.