more work on the lowram scripts
This commit is contained in:
@@ -7,6 +7,7 @@ export async function main(ns) {
|
||||
const sBatchScript = "lowram/Lowhgw.js";
|
||||
const sPrepScript = "lowram/Lowprep.js";
|
||||
const sRunScript = "lowram/Lowrun.js";
|
||||
const sGrowScript = "lowram/Lowgrow.js";
|
||||
|
||||
const nTargetMoney = ns.getServerMoneyAvailable(sTarget);
|
||||
const nTargetMaxMoney = ns.getServerMaxMoney(sTarget);
|
||||
@@ -16,17 +17,14 @@ export async function main(ns) {
|
||||
ns.print(sTarget + " Money = " + nTargetMoney.toLocaleString() + " / " + nTargetMaxMoney.toLocaleString());
|
||||
ns.print(sTarget + " Security = " + nTargetSecurity.toLocaleString() + " / " + nTargetMinSecurity.toLocaleString());
|
||||
|
||||
if ( nTargetSecurity > nTargetMinSecurity) {
|
||||
ns.killall();
|
||||
if (nTargetSecurity > nTargetMinSecurity + 1) {
|
||||
ns.spawn(sPrepScript, { threads: 1, spawnDelay: 0 }, sTarget);
|
||||
}
|
||||
else if (nTargetMoney < nTargetMaxMoney){
|
||||
ns.print("need to prep MONEY, running "+sRunScript);
|
||||
ns.killall();
|
||||
ns.spawn(sBatchScript, { threads: 1, spawnDelay: 0 }, sTarget);
|
||||
else if (nTargetMoney < nTargetMaxMoney) {
|
||||
ns.print("need to prep MONEY, running " + sGrowScript);
|
||||
ns.spawn(sGrowScript, { threads: 1, spawnDelay: 0 }, sTarget);
|
||||
}
|
||||
else {
|
||||
ns.killall();
|
||||
ns.spawn(sBatchScript, { threads: 1, spawnDelay: 0 }, sTarget);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user