This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Scheduler } from "scheduler.js"; | |
function computeCounts(ns, target, hackThreads, hackFraction) { | |
let hackTime = ns.getHackTime(target); | |
let growTime = ns.getGrowTime(target); | |
let weakenTime = ns.getWeakenTime(target); | |
let growThreads = Math.ceil(ns.growthAnalyze(target, 1.06) * growTime / hackTime); | |
// Note: weaken weakens the security level by 0.05, so we have to multiply the rate of | |
// security increases by 20 to get the desired number of threads. |
OlderNewer