hacker.js, lib_time.js: supress error messages. hacker.js: use `getBitNodeMultipliers`. lib_time.js: use `getStats`. README.md: update.

[?]
Apr 29, 2020, 4:21 PM
ZRPOW4ERZN63I6GSUF3DGU77MI4DVWBHOZQAMGJO57YVSYJ4CUDAC

Dependencies

  • [2] 2WOLGB42 README.md: update. kill.js: fix argument parser. lshw.js: add `-p` option. increase information given. main.js: fix error message. set saner defaults. hacker.js: split some functions into "lib_time.js" and "lib_score.js". ram.js: fix.
  • [3] P6ZJC2SH hacker.js: normalise factors used in server scoring function.
  • [4] EYKBOK3O optimised the scheduling logic by ensuring that cycles start and finish at minimum security of target.
  • [5] AXGQ7FML split and refactor hacking logic to "hacker.js" and argument parsing and script execution logic to "main.js". update "README.md".
  • [6] NQ22FUSW add more options to `main.js`. update `README.md`.
  • [7] BKG7YVUV main.js, hacker.js, servers.js, ram.js: refactor.
  • [8] Y5OWMCQR all: remove unecessary uses of `exec`. refactor. main.js: add RAM reservation logic. lib_ram.js: renamed to lib_ram_server.js. README.js: update.
  • [9] 2BKHJI2S init
  • [10] HSNSECD5 all: refactor. main.js: fix call to `void_kill_script_named_server_named`.

Change contents

  • replacement in sbin/hacker.js at line 1
    [3.14850][2.272:302]()
    /* hacker.js - 8.75GB - TODO:
    [3.14850]
    [3.11]
    /* hacker.js - 12.75GB - TODO:
    * add a way to be able to target more than one server at a time.
  • edit in sbin/hacker.js at line 42
    [3.16173][3.16173:16210]()
    // from BitNode/BitNodeMultipliers
  • replacement in sbin/hacker.js at line 43
    [3.16266][3.16266:19634]()
    // try {
    // return ns.getBitNodeMultipliers();
    // }
    // catch (error) {
    // ns.tprint(JSON.stringify(error));
    // return {
    // HackingLevelMultiplier: 1,
    // StrengthLevelMultiplier: 1,
    // DefenseLevelMultiplier: 1,
    // DexterityLevelMultiplier: 1,
    // AgilityLevelMultiplier: 1,
    // CharismaLevelMultiplier: 1,
    // ServerGrowthRate: 1,
    // ServerMaxMoney: 1,
    // ServerStartingMoney: 1,
    // ServerStartingSecurity: 1,
    // ServerWeakenRate: 1,
    // HomeComputerRamCost: 1,
    // PurchasedServerCost: 1,
    // PurchasedServerLimit: 1,
    // PurchasedServerMaxRam: 1,
    // CompanyWorkMoney: 1,
    // CrimeMoney: 1,
    // HacknetNodeMoney: 1,
    // ManualHackMoney: 1,
    // ScriptHackMoney: 1,
    // CodingContractMoney: 1,
    // ClassGymExpGain: 1,
    // CompanyWorkExpGain: 1,
    // CrimeExpGain: 1,
    // FactionWorkExpGain: 1,
    // HackExpGain: 1,
    // FactionPassiveRepGain: 1,
    // FactionWorkRepGain: 1,
    // RepToDonateToFaction: 1,
    // AugmentationMoneyCost: 1,
    // AugmentationRepCost: 1,
    // InfiltrationMoney: 1,
    // InfiltrationRep: 1,
    // FourSigmaMarketDataCost: 1,
    // FourSigmaMarketDataApiCost: 1,
    // CorporationValuation: 1,
    // BladeburnerRank: 1,
    // BladeburnerSkillCost: 1,
    // DaedalusAugsRequirement: 1,
    // };
    // }
    return {
    HackingLevelMultiplier: 1,
    StrengthLevelMultiplier: 1,
    DefenseLevelMultiplier: 1,
    DexterityLevelMultiplier: 1,
    AgilityLevelMultiplier: 1,
    CharismaLevelMultiplier: 1,
    ServerGrowthRate: 1,
    ServerMaxMoney: 1,
    ServerStartingMoney: 1,
    ServerStartingSecurity: 1,
    ServerWeakenRate: 1,
    HomeComputerRamCost: 1,
    PurchasedServerCost: 1,
    PurchasedServerLimit: 1,
    PurchasedServerMaxRam: 1,
    CompanyWorkMoney: 1,
    CrimeMoney: 1,
    HacknetNodeMoney: 1,
    ManualHackMoney: 1,
    ScriptHackMoney: 1,
    CodingContractMoney: 1,
    ClassGymExpGain: 1,
    CompanyWorkExpGain: 1,
    CrimeExpGain: 1,
    FactionWorkExpGain: 1,
    HackExpGain: 1,
    FactionPassiveRepGain: 1,
    FactionWorkRepGain: 1,
    RepToDonateToFaction: 1,
    AugmentationMoneyCost: 1,
    AugmentationRepCost: 1,
    InfiltrationMoney: 1,
    InfiltrationRep: 1,
    FourSigmaMarketDataCost: 1,
    FourSigmaMarketDataApiCost: 1,
    CorporationValuation: 1,
    BladeburnerRank: 1,
    BladeburnerSkillCost: 1,
    DaedalusAugsRequirement: 1,
    };
    [3.16266]
    [3.19634]
    try {
    // comment out the following line to save ~4GB
    return ns.getBitNodeMultipliers();
    throw new Error("WARNING: Uncommented the call to `getBitNodeMultipliers`.");
    }
    catch (error) {
    return (
    ns.print(`${JSON.stringify(error)}\nUsing default values instead.`),
    // from BitNode/BitNodeMultipliers
    {
    HackingLevelMultiplier: 1,
    StrengthLevelMultiplier: 1,
    DefenseLevelMultiplier: 1,
    DexterityLevelMultiplier: 1,
    AgilityLevelMultiplier: 1,
    CharismaLevelMultiplier: 1,
    ServerGrowthRate: 1,
    ServerMaxMoney: 1,
    ServerStartingMoney: 1,
    ServerStartingSecurity: 1,
    ServerWeakenRate: 1,
    HomeComputerRamCost: 1,
    PurchasedServerCost: 1,
    PurchasedServerLimit: 1,
    PurchasedServerMaxRam: 1,
    CompanyWorkMoney: 1,
    CrimeMoney: 1,
    HacknetNodeMoney: 1,
    ManualHackMoney: 1,
    ScriptHackMoney: 1,
    CodingContractMoney: 1,
    ClassGymExpGain: 1,
    CompanyWorkExpGain: 1,
    CrimeExpGain: 1,
    FactionWorkExpGain: 1,
    HackExpGain: 1,
    FactionPassiveRepGain: 1,
    FactionWorkRepGain: 1,
    RepToDonateToFaction: 1,
    AugmentationMoneyCost: 1,
    AugmentationRepCost: 1,
    InfiltrationMoney: 1,
    InfiltrationRep: 1,
    FourSigmaMarketDataCost: 1,
    FourSigmaMarketDataApiCost: 1,
    CorporationValuation: 1,
    BladeburnerRank: 1,
    BladeburnerSkillCost: 1,
    DaedalusAugsRequirement: 1,
    }
    );
    }
  • replacement in sbin/hacker.js at line 109
    [3.20287][3.6808:6909]()
    // object_constants are from https://github.com/danielyxie/bitburner/blob/master/src/Constants.js
    [3.19640]
    [3.6909]
    // from https://github.com/danielyxie/bitburner/blob/master/src/Constants.js
  • edit in lib/lib_time.js at line 5
    [3.3711384]
    [3.3711384]
    // comment out the following line to save ~0.5GB
  • edit in lib/lib_time.js at line 7
    [3.3711412]
    [3.3711412]
    throw new Error("WARNING: Uncommented the call to `getStats`.");
  • replacement in lib/lib_time.js at line 10
    [3.3711438][3.3711438:3711478]()
    ns.tprint(JSON.stringify(error));
    [3.3711438]
    [3.3711478]
    ns.print(`${JSON.stringify(error)}\nUsing default values instead.`);
  • replacement in bin/cp.js at line 33
    [3.20224][3.20224:20333]()
    `Attempted to copy the file "${string_file_to_copy}" located in the server "${string_server_source}".`
    [3.20224]
    [3.20333]
    `${error}\nAttempted to copy the file "${string_file_to_copy}" located in the server "${string_server_source}".`
  • edit in bin/cp.js at line 35
    [3.20340][3.3803486:3803513](),[3.3803486][3.3803486:3803513]()
    ns.tprint(`${error}`);
  • replacement in README.md at line 11
    [3.4253][2.5414:5487]()
    * Reserve at least enough RAM to be able to run "hacker.js" (8.75 GB).
    [3.4253]
    [3.2728]
    * Reserve at least enough RAM to be able to run "hacker.js" (12.75 GB).