hacknet.js: make this run based on whether the ratio of upgrades are still within threshold instead of until Netburners requirements are met, to make it more flexible. main.js, README.md: include changes to accomodate "hacknet.js" updates.

[?]
Sep 9, 2020, 11:43 AM
CEZ56FCMUQARV6EAVERV6VCQHODPUMID3TCZKB6BBSIHKN7TUMEQC

Dependencies

  • [2] J7PIMHBD hacknet.js: add. main.js, README.md: update.
  • [3] R7OI6M4U optimise for gain rate increase per cost to simplify computation by decreasing iterations done.
  • [4] JGNALSUQ add "cyclic_weaken.js" feature. hacker.js, main.js, libs: refactor. README.md: update.
  • [5] IFVY3INI contracts.js: add --verbose and --check-delay options. README.md: update.
  • [6] CTUEOIV2 hacknet.js: take into account the gain rate increases of upgrades.
  • [7] 2BKHJI2S init
  • [8] JS52JD4Q weaken_manager.js: add. lib_server_used.js: move to lib_ram_script. lib_ps: delete. main.js, hacker.js, lib_ram_script.js: refactor. README.md: update.
  • [*] FBAPT2WW executables: dynamically load help messages. lshw.js, main.js: add options to change score correction method and score factor multipliers. README.md: update.

Change contents

  • replacement in sbin/hacknet.js at line 1
    [4.11985][4.11986:12105]()
    // hacknet.js - 5.6 GB - purchases nodes and upgrades them until the node requirements for joining Netburners are met.
    [4.11985]
    [4.10]
    // hacknet.js - 5.6 GB - purchases nodes and upgrades them until the highest gain rate increase per cost ratio of the possible upgrades are below a given threshold.
  • replacement in sbin/hacknet.js at line 69
    [4.12738][3.579:680]()
    integer_netburners_level = 100,
    integer_netburners_ram = 8,
    integer_netburner_cores = 4;
    [4.12738]
    [4.645]
    float_minimum_ratio = ns.args[1];
  • replacement in sbin/hacknet.js at line 81
    [4.13073][3.681:857]()
    !(integer_netburners_level <= object_nodes_stats.level &&
    integer_netburners_ram <= object_nodes_stats.ram &&
    integer_netburner_cores <= object_nodes_stats.cores);
    [4.13073]
    [4.13217]
    ;
  • replacement in sbin/hacknet.js at line 125
    [4.1637][3.1621:1784]()
    if (
    object_nodes_stats.level < integer_netburners_level &&
    float_ratio_level > object_upgrade.float_gain_rate_increase_cost_ratio
    ) {
    [4.1637]
    [3.1784]
    if (float_ratio_level > object_upgrade.float_gain_rate_increase_cost_ratio) {
  • replacement in sbin/hacknet.js at line 131
    [4.1645][3.1987:2144]()
    if (
    object_nodes_stats.ram < integer_netburners_ram &&
    float_ratio_ram > object_upgrade.float_gain_rate_increase_cost_ratio
    ) {
    [4.1645]
    [3.2144]
    if (float_ratio_ram > object_upgrade.float_gain_rate_increase_cost_ratio) {
  • replacement in sbin/hacknet.js at line 137
    [4.2950][4.14389:14400](),[4.14389][4.14389:14400](),[4.14400][3.2343:2484](),[3.2484][4.14493:14503](),[4.3074][4.14493:14503](),[4.14493][4.14493:14503]()
    if (
    object_nodes_stats.cores < integer_netburner_cores &&
    float_ratio_cores > object_upgrade.float_gain_rate_increase_cost_ratio
    ) {
    [4.14126]
    [3.2485]
    if (float_ratio_cores > object_upgrade.float_gain_rate_increase_cost_ratio) {
  • replacement in sbin/hacknet.js at line 144
    [4.14767][3.2687:2722]()
    object_upgrade.void_upgrade();
    [4.14767]
    [4.14767]
    if (object_upgrade.float_gain_rate_increase_cost_ratio >= float_minimum_ratio) {
    object_upgrade.void_upgrade();
    } else {
    break;
    }
  • edit in bin/main.js at line 54
    [4.9034]
    [4.9034]
    // minimum gain rate increase per cost ratio used by the hacknet manager
    float_gain_rate_increase_cost_ratio: 0.0005,
  • edit in bin/main.js at line 139
    [4.10771]
    [4.10771]
    },
    hacknet_ratio: {
    short: "x",
    long: "hacknet-ratio",
  • edit in bin/main.js at line 227
    [4.13127]
    [4.13127]
    float_gain_rate_increase_cost_ratio = object_defaults.float_gain_rate_increase_cost_ratio,
  • edit in bin/main.js at line 311
    [4.16551]
    [4.16551]
    break;
    case object_argument_names.hacknet_ratio.short:
    // fall-through
    case object_argument_names.hacknet_ratio.long:
    float_gain_rate_increase_cost_ratio = argument_value;
  • replacement in bin/main.js at line 366
    [2.1767][2.1767:1809]()
    args: [float_period_check_seconds],
    [2.1767]
    [2.1809]
    args: [
    float_period_check_seconds,
    float_gain_rate_increase_cost_ratio
    ],
  • replacement in bin/main.js at line 541
    [4.27561][4.37948:38234]()
    FLOAT = The fraction of the botnet's current available RAM to be used by ${object_helpers.string_weaken_manager} to run threads of "${object_helpers.string_cyclic_weaken}". Should be a floating point number > 0. Defaults to ${object_defaults.float_ram_fraction_for_weaken_cyclic}.`
    [4.27561]
    [4.27791]
    FLOAT = The fraction of the botnet's current available RAM to be used by ${object_helpers.string_weaken_manager} to run threads of "${object_helpers.string_cyclic_weaken}". Should be a floating point number > 0. Defaults to ${object_defaults.float_ram_fraction_for_weaken_cyclic}.
    -${object_argument_names.hacknet_ratio.short}, --${object_argument_names.hacknet_ratio.long} <FLOAT>
    FLOAT = A value used in determining if "${object_helpers.string_hack_net}" should continue buying new Hacknet nodes/upgrades for these. Should be a floating point number >= 0. Higher values indicates a greater threshold so less upgrades/new nodes will be bought. Defaults to ${object_defaults.float_gain_rate_increase_cost_ratio}.`
  • edit in README.md at line 124
    [4.39005]
    [10.13794]
    `-x, --hacknet-ratio <FLOAT>`
    * FLOAT = A value used in determining if "hacknet.js" should continue buying new Hacknet nodes/upgrades for these. Should be a floating point number >= 0. Higher values indicates a greater threshold so less upgrades/new nodes will be bought. Defaults to 0.0005.