moving some files around

This commit is contained in:
2024-10-06 08:57:15 +02:00
parent 7a5338daf5
commit 3cf9484442
9 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
/** @param {NS} ns */
export async function main(ns) {
ns.tail();
const sTarget = ns.args[0]; // run on this target instead of best
const nHackThreads = ns.args[1] ? ns.args[1] : 1;
ns.disableLog("sleep");
ns.print("nHackThreads = " + nHackThreads);
//ns.tprint(ns.getHackingMultipliers());
let nHackAmountPercent = ns.hackAnalyze(sTarget) * nHackThreads;
let nTargetMoney = ns.getServerMoneyAvailable(sTarget);
let nHackAmount = nTargetMoney * nHackAmountPercent;
ns.print("nHackAmountPercent = " + nHackAmountPercent);
ns.print("nTargetMoney = " + nTargetMoney);
ns.print("nHackAmount = " + nHackAmount);
let nGrowthThreads = ns.growthAnalyze(sTarget, 1 + nHackAmountPercent, 1);
ns.print("nGrowthThreads = " + nGrowthThreads);
let nGrowThreadsINT = Math.ceil(nGrowthThreads);
ns.print("Hack() : Grow() Ratio = " + nHackThreads + ":" + nGrowThreadsINT);
//test hack() and grow()
/*
let nHackPID = ns.exec("RMhack.js", "home", nHackThreads, sTarget);
ns.tail(nHackPID);
let nGrowPID = ns.exec("RMgrow.js", "home", nGrowThreadsINT, sTarget);
ns.tail(nGrowPID);
ns.print("Wait for Hack and Grow...");
while (ns.isRunning(nHackPID) || ns.isRunning(nGrowPID)) {
await ns.sleep(1000);
}
ns.print("Wait complete");
nTargetMoney = ns.getServerMoneyAvailable(sTarget);
ns.print("nTargetMoney = " + nTargetMoney);
*/
}