Updated missing host script runner in autoexec and fixed auto purchase & upgrade servers

This commit is contained in:
2024-10-07 09:41:28 +02:00
parent aaea1f43d5
commit 38947d3d81
4 changed files with 7 additions and 8 deletions

View File

@@ -27,6 +27,7 @@ export async function main(ns) {
const sServerListFile = "serverList.txt";
const sBestServerFile = "bestTarget.txt";
const sBackdoorScript = "backdoor.js";
const sPServScript = "purchaseServers.js";
//settings
const nRefreshFrequency = 1000; //time in ms
@@ -105,7 +106,7 @@ export async function main(ns) {
if (nMoney > ns.singularity.getUpgradeHomeRamCost()) {
let nHomeRAMUpgradeCost = ns.singularity.getUpgradeHomeRamCost();
ns.singularity.upgradeHomeRam();
ns.tprint(cCyan + "Upgraded home RAM to " + (nHomeMaxRAM*2) + " for " + nHomeRAMUpgradeCost + cReset);
ns.tprint(cCyan + "Upgraded home RAM to " + (nHomeMaxRAM * 2) + " for " + nHomeRAMUpgradeCost + cReset);
}
else if (nCores < 8 && nMoney > ns.singularity.getUpgradeHomeCoresCost()) {
ns.singularity.upgradeHomeCores();
@@ -194,11 +195,9 @@ export async function main(ns) {
ns.tprint(cCyan + "Purchased " + oEXE.ds2.name + cReset);
ns.toast("Purchased " + oEXE.ds2.name, "info", 10000);
}
else if (getSetting(ns, "autoPurchaseServers") && nMoney >= 5e+6) { //Purchased Servers
else if (getSetting(ns, "autoPurchaseServers") && nMoney >= 5e+6 && !ns.scriptRunning(sPServScript, sThisRunner)) { //Purchased Servers
ns.tprint("purchasing servers ");
//await purchaseServers(ns);
//await purchaseAndUpgradeServers(ns);
ns.exec("purchaseServers.js");
ns.exec("purchaseServers.js", sThisRunner);
ns.exec(sServerLister, sThisRunner, 1, false, true);
}
/*else if (getSetting(ns, "autoUpgrades") && nLowestRAM < (2 ** 20) && !ns.scriptRunning("upgrade.js", sThisRunner) && nPServs >= 25 && nMoney >= 1e+6) {