save backup

This commit is contained in:
2022-09-11 05:03:16 +02:00
parent 7b393a7ffc
commit 3529597fb0
10 changed files with 71 additions and 9 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ export async function main(ns) {
let levelCap = 150;
let ramCap = 64;
let coreCap = 4;
let nodeCap = 15;
ns.tprint(`Bot started {nodeCostThreshold: ${nodeCostThreshold}, upgradeCostThreshold: ${upgradeCostThreshold}, upgradeCount: ${upgradeCount}}`);
while (true) {
@@ -16,7 +17,7 @@ export async function main(ns) {
let nodePurchaseCost = ns.hacknet.getPurchaseNodeCost();
let nodeCount = ns.hacknet.numNodes();
if (nodePurchaseCost / Math.abs(currentMoney) < nodeCostThreshold) {
if (nodeCount < nodeCap && nodePurchaseCost / Math.abs(currentMoney) < nodeCostThreshold) {
ns.hacknet.purchaseNode();
currentMoney = ns.getServerMoneyAvailable("home");
++nodeCount;