sync corp
This commit is contained in:
33
Ramses/home/lowram/Lowrun.js
Normal file
33
Ramses/home/lowram/Lowrun.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/** @param {NS} ns */
|
||||
export async function main(ns) {
|
||||
ns.tail();
|
||||
const sTarget = ns.args[0]; // target server
|
||||
|
||||
// Lowram settings
|
||||
const sBatchScript = "lowram/Lowhgw.js";
|
||||
const sPrepScript = "lowram/Lowprep.js";
|
||||
const sRunScript = "lowram/Lowrun.js";
|
||||
const sGrowScript = "lowram/Lowgrow.js";
|
||||
const sDistScript = "testdistribute.js";
|
||||
|
||||
await ns.sleep(1);
|
||||
|
||||
const nTargetMoney = ns.getServerMoneyAvailable(sTarget);
|
||||
const nTargetMaxMoney = ns.getServerMaxMoney(sTarget);
|
||||
const nTargetSecurity = ns.getServerSecurityLevel(sTarget);
|
||||
const nTargetMinSecurity = ns.getServerMinSecurityLevel(sTarget);
|
||||
|
||||
//ns.print(sTarget + " Money = " + nTargetMoney.toLocaleString() + " / " + nTargetMaxMoney.toLocaleString());
|
||||
//ns.print(sTarget + " Security = " + nTargetSecurity.toLocaleString() + " / " + nTargetMinSecurity.toLocaleString());
|
||||
|
||||
if (nTargetSecurity > nTargetMinSecurity + 1) {
|
||||
ns.spawn(sPrepScript, { 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.spawn(sBatchScript, { threads: 1, spawnDelay: 0 }, sTarget);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user