2LU5Y77OWHXI4FV3YKELPYQSUOQGRSO7CXWPKUCQZ2WM5YUBZBRQC BZ6FC2BTR7M7T6KQX5OJEFY4B3OWAKCOALYOF7GYBXZ4ZNSGSCYQC EYKBOK3OG5YHBBZV3OQB423I7RVDK2HLSXEKKWJLQLKXZKUTUJBAC VHWFHMNWZS4GA5ZW6QSOTDXS4WONZLGEZS5P2RFM7DK7VWDYSHHAC 2BKHJI2SJ3VXTFBK2BWNN3I3BDNMUU5YTJGKTQCOXV66VVRHCGKAC VMXI7PS4GFDOWPFLHQ7TYKJ5K3K7FXNPJCBEVYHTTRN7YB5ZHEQAC 6MBUKAG6VK6XXGRSER273IP2R35P3C5K3KOY4QVSZXEOYD3H4WRAC HHZNTFCTPVDB5GIBDLZFZPDKR62SD47HQ5QALRBSP5UN52M6GLEAC const bool_is_ram_enough_after_hack_percentage = function(ns, float_server_used_ram_free, string_server_target, float_server_target_cash, float_server_target_security, float_percentage_to_steal) {void_debug(bool_is_ram_enough_after_hack_percentage, Array.from(arguments));
const boolean_is_ram_enough_after_hack_percentage = function(ns, float_server_used_ram_free, string_server_target, float_server_target_cash, float_server_target_security, float_percentage_to_steal) {void_debug(boolean_is_ram_enough_after_hack_percentage, Array.from(arguments));
const float_ram_required = (integer_threads_required_for_weaken_minimum_security_after_hack * object_scripts.grow.weaken) + (integer_threads_required_for_cash_grow_after_percentage_stolen * object_scripts.grow.ram) + (integer_threads_required_for_weaken_minimum_security_after_grow * object_scripts.grow.weaken);
const float_ram_required = (integer_threads_required_for_weaken_minimum_security_after_hack * object_scripts.weaken.ram) + (integer_threads_required_for_cash_grow_after_percentage_stolen * object_scripts.grow.ram) + (integer_threads_required_for_weaken_minimum_security_after_grow * object_scripts.weaken.ram);
for (let integer_indices_0 = 0; integer_indices_0 < integer_get_cycles_for_bisection_precision(ns, float_precision); ++integer_indices_0) {if (bool_is_ram_enough_after_hack_percentage(ns, float_server_used_ram_free, string_server_target, float_server_target_cash, float_server_target_security, float_percentage_to_steal)) {
for (let integer_indices_0 = 0; integer_indices_0 < integer_cycles_for_bisection_precision; ++integer_indices_0) {if (boolean_is_ram_enough_after_hack_percentage(ns, float_server_used_ram_free, string_server_target, float_server_target_cash, float_server_target_security, float_percentage_to_steal)) {
const bool_can_server_run_script_threads = function(ns, float_server_used_ram_free, float_script_ram, integer_threads) {void_debug(bool_can_server_run_script_threads, Array.from(arguments));
const boolean_can_server_run_script_threads = function(ns, float_server_used_ram_free, float_script_ram, integer_threads) {void_debug(boolean_can_server_run_script_threads, Array.from(arguments));
// // this is supposed to be the section that uses the `float_get_percentage_to_steal` function to calculate and hack the optimum amount of cash, but it doesn't seem to work properly and I still haven't figured why or how to fix it, so for now I think it just hacks whatever `float_steal_cap` percent of cash the server has.// const integer_threads_hack = integer_get_threads_hack(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_get_percentage_to_steal(ns, float_server_used_ram_free_current, string_server_target, float_server_target_cash_current, float_server_target_security_current, float_precision, float_steal_cap));
const integer_threads_hack = integer_get_threads_hack(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_steal_cap);
const integer_threads_hack = integer_get_threads_hack(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_get_percentage_to_steal(ns, float_server_used_ram_free_current, string_server_target, float_server_target_cash_current, float_server_target_security_current, float_precision, float_steal_cap));
// TODO: Separate logic that can finish running (e.g. server buying logic which becomes redundant after 25 fully upgraded servers have been bought) to other sbins so that RAM usage is more efficient. Also separate logic that requires source files so that they are only ran when you have the required 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.
// TODO: Separate logic that can finish running (e.g. server buying logic which becomes redundant after 25 fully upgraded servers have been bought) to other sbins so that RAM usage is more efficient. Also separate logic that requires source files so that they are only ran when you have the required 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.