7SRULDRFXA6ZZUEXRPCDO7NIUJDREKYI3ESUYTOXMSPVMORDJXIQC 3NFCZ6IPQPUCWANJN5WMUHUCHEQN7U5HZXMHDKVC6V6HXA3FG5YQC 2BKHJI2SJ3VXTFBK2BWNN3I3BDNMUU5YTJGKTQCOXV66VVRHCGKAC SLSWBNYTIFKBFLKXZTMONGDMEOHSOOCOSU4KVJCONZG2DK3BBIUQC HHZNTFCTPVDB5GIBDLZFZPDKR62SD47HQ5QALRBSP5UN52M6GLEAC NQ22FUSWN6CBJKJ5H7UV5N2KEXBIXVNQDNL2EK6UJ3E7RFLWNVDQC VMXI7PS4GFDOWPFLHQ7TYKJ5K3K7FXNPJCBEVYHTTRN7YB5ZHEQAC CJBGAILAK7G3WXYUBNUZMUMM3U5CPHWVK6ZAJWYBL4IOB5SZN32AC YXH7ERRNAV2FHHAFREYBN7VJZZMGH3UJOXGM4IKS2USVKI543TFQC RWMZ7DVLOVPLR4FCIAVSABA5OESYUIEQ2OOZUYNPCNFEBYK5627AC // main.js - 8.85GB - TODO: Separate logic that requires source files so that they are only ran when you have the required source file - need a cheap way to check if you have source file? Maybe make a cache script that saves runtime constants like max money of servers to a cache file to potentially reduce RAM usage further. Maybe add functionality that allows on-the-fly hot loading of settings from a file. Possibly split the helper script execution management to a different script?
/* main.js - 8.85GB - TODO:* add --help flag* Separate logic that requires source files so that they are only ran when you have the required source file - need a cheap way to check if you have source file?* Maybe make a cache script that saves runtime constants like max money of servers to a cache file to potentially reduce RAM usage further.* 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?*/
const string_helper_file_botnet = "botnet.js";const integer_helper_threads_botnet = 1;const array_helper_arguments_botnet = [float_period_check_seconds];let array_helpers = [{file: string_helper_file_ram,threads: integer_helper_threads_ram,args: array_helper_arguments_ram},{file: string_helper_file_servers,threads: integer_helper_threads_servers,args: array_helper_arguments_servers},{file: string_helper_file_botnet,threads: integer_helper_threads_botnet,args: [array_helper_arguments_botnet]}];
// fall-throughcase "--no-ram":array_arguments.splice(0, 1);array_helpers.splice(integer_get_index_of_file(array_helpers, string_helper_file_ram), 1);break;
// fall-throughcase "--no-ram":array_arguments.splice(0, 1);array_helpers.splice(integer_get_index_of_file(array_helpers, string_helper_file_ram), 1);break;
================================
let integer_time_start = Date.now();let string_server_target = string_server_target_argument;if (string_server_target_argument === "") {string_server_target = string_get_server_rooted_hackable_with_score_biggest(ns);}// copy scripts to rooted serversvoid_copy_files_to_string_servers_rooted(ns, [object_get_constants(ns).array_workers], ns.getHostname());// prepare the target if necessarywhile (true) {if (ns.getServerSecurityLevel(string_server_target) === ns.getServerMinSecurityLevel(string_server_target) &&ns.getServerMoneyAvailable(string_server_target) === ns.getServerMaxMoney(string_server_target)) {break;}const array_schedule_prepare = array_make_schedule(ns, integer_job_cap, float_precision, float_steal_cap, float_padding_seconds, string_server_target, string_job_decider_prepare);if (array_schedule_prepare.length > 0) {await void_schedule_runner(ns, array_schedule_prepare);await ns.sleep((array_schedule_prepare[array_schedule_prepare.length - 1].integer_time_job_finishes_seconds * 1000) - integer_time_start + Date.now());}}// make and run actual hacking scheduleconst array_schedule = array_make_schedule(ns, integer_job_cap, float_precision, float_steal_cap, float_padding_seconds, string_server_target, string_job_decider);await void_schedule_runner(ns, array_schedule);return (array_schedule[array_schedule.length - 1].integer_time_job_finishes_seconds * 1000) - integer_time_start + Date.now();
* MILLISECONDS = The duration of delay between update, in milliseconds. Should be a floating-point number >= 1. By default, the script will only display server information once, unless this option is manually set.
* 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.