hacknet.js: fix typo, remove unecessary functions and lines.

[?]
Sep 10, 2020, 9:06 AM
HNZOVUVQPVZ77VAZHPF464CQONRZPTCGMLPWPV7M6JDE3PE42ZQAC

Dependencies

  • [2] R7OI6M4U optimise for gain rate increase per cost to simplify computation by decreasing iterations done.
  • [3] 2BKHJI2S init
  • [4] CTUEOIV2 hacknet.js: take into account the gain rate increases of upgrades.
  • [5] CEZ56FCM 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.

Change contents

  • edit in sbin/hacknet.js at line 46
    [3.12106][3.12106:12644]()
    const object_get_nodes_stats = function (ns) {
    const object_output = {
    level: 0,
    ram: 0,
    cores: 0,
    };
    const integer_nodes = ns.hacknet.numNodes();
    for (
    let integer_index_nodes = 0;
    integer_index_nodes < integer_nodes;
    ++integer_index_nodes
    ) {
    const object_node_stats = ns.hacknet.getNodeStats(integer_index_nodes);
    object_output.level += object_node_stats.level;
    object_output.ram += object_node_stats.ram;
    object_output.cores += object_node_stats.cores;
    }
    return object_output;
    };
  • edit in sbin/hacknet.js at line 59
    [3.13004][3.13004:13059]()
    let object_nodes_stats = object_get_nodes_stats(ns);
  • edit in sbin/hacknet.js at line 64
    [3.13224][3.13224:13277]()
    object_nodes_stats = object_get_nodes_stats(ns);
  • replacement in sbin/hacknet.js at line 101
    [2.1595][2.1595:1620]()
    1,
    0
    [2.1595]
    [3.1626]
    0,
    1