hacker.js: minor refactor.

[?]
May 17, 2020, 10:53 AM
U2SGR33GHWKKY4LEVFP3GYLFOSX7NAJN7HIKW4SDNY6G2JVX42SAC

Dependencies

  • [2] OCNYDSXA hacker.js: fix sleep time.
  • [3] 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.
  • [4] 2BKHJI2S init

Change contents

  • edit in sbin/hacker.js at line 960
    [3.32218]
    [3.32218]
    // makes and runs a schedule, returns the the time it'll take to finish in milliseconds.
  • edit in sbin/hacker.js at line 962
    [3.32244][3.32244:32337]()
    // makes and runs a schedule, returns the the time it'll take to finish in milliseconds.
  • edit in sbin/hacker.js at line 993
    [3.33294]
    [3.33294]
    // makes and runs a schedule, sleeps for the length of the sum of the paddings of the previous schedule, repeats.
  • replacement in sbin/hacker.js at line 995
    [3.33298][3.33298:33416]()
    // makes and runs a schedule, sleeps for the length of the sum of the paddings of the previous schedule, repeats.
    [3.33298]
    [3.33416]
    const void_runner_loop = async function (
    ns,
    integer_job_cap,
    float_precision,
    float_steal_cap,
    float_padding_seconds,
    string_server_target
    ) {
    const integer_time_start = Date.now();
    return (
    (array_schedule = array_make_schedule_hacking(
    ns,
    integer_job_cap,
    float_precision,
    float_steal_cap,
    float_padding_seconds,
    string_server_target
    )),
    array_schedule.length > 0
    ? void_schedule_hacking_runner(ns, array_schedule)
    : await ns.sleep(1e3 * float_padding_seconds),
    integer_time_start
    );
    };
  • edit in sbin/hacker.js at line 1021
    [3.33451]
    [3.33451]
    integer_time_start,
  • replacement in sbin/hacker.js at line 1023
    [3.33491][3.33491:33587]()
    string_server_target = string_server_target_argument,
    integer_time_start;
    for (
    [3.33491]
    [3.33626]
    string_server_target = string_server_target_argument;
    for (;;)
  • replacement in sbin/hacker.js at line 1026
    [3.33672][3.33672:33956](),[3.33956][2.11:50](),[2.50][3.33956:34009](),[3.33956][3.33956:34009]()
    (string_server_target = string_get_server_hackable_by_score_position(
    ns,
    1,
    string_method_score_correction,
    float_multiplier_factor_skill,
    float_multiplier_factor_max_cash,
    float_multiplier_factor_growth
    ));
    ;
    )
    integer_time_start = Date.now(),
    d.string_server_target = string_server_target,
    [3.33672]
    [3.34009]
    (string_server_target = string_get_server_hackable_by_score_position(
    ns,
    1,
    string_method_score_correction,
    float_multiplier_factor_skill,
    float_multiplier_factor_max_cash,
    float_multiplier_factor_growth
    )),
    // tell cyclic_weaken.js what to target
    (d.string_server_target = string_server_target),
  • replacement in sbin/hacker.js at line 1037
    [3.34043][3.34043:34101]()
    ? ((array_schedule = array_make_schedule_hacking(
    [3.34043]
    [3.34101]
    ? (integer_time_start = await void_runner_loop(
  • replacement in sbin/hacker.js at line 1044
    [3.34272][3.34272:34617]()
    )),
    array_schedule.length > 0
    ? void_schedule_hacking_runner(ns, array_schedule)
    : await ns.sleep(1e3 * float_padding_seconds))
    : (await ns.sleep((array_schedule.length * float_padding_seconds * 1e3) - integer_time_start + Date.now()),
    (array_schedule = array_make_schedule_hacking(
    [3.34272]
    [3.34617]
    ))
    : (await ns.sleep(
    array_schedule.length * float_padding_seconds * 1e3 -
    integer_time_start +
    Date.now()
    ),
    (integer_time_start = await void_runner_loop(
  • replacement in sbin/hacker.js at line 1057
    [3.34788][3.34788:34961]()
    )),
    array_schedule.length > 0
    ? void_schedule_hacking_runner(ns, array_schedule)
    : await ns.sleep(1e3 * float_padding_seconds));
    [3.34788]
    [3.34961]
    )));